Skip to content

Commit

Permalink
Merge pull request #297 from ZeusWPI/updates2019
Browse files Browse the repository at this point in the history
Various updates
  • Loading branch information
niknetniko authored Sep 18, 2019
2 parents 21336cb + a7993da commit aea5707
Show file tree
Hide file tree
Showing 14 changed files with 56 additions and 37 deletions.
18 changes: 9 additions & 9 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,19 @@ dependencies {

implementation 'androidx.multidex:multidex:2.0.1'

implementation 'androidx.core:core:1.0.2'
implementation 'androidx.media:media:1.0.1'
implementation 'androidx.fragment:fragment:1.0.0'
implementation 'androidx.core:core:1.1.0'
implementation 'androidx.media:media:1.1.0'
implementation 'androidx.fragment:fragment:1.1.0'

implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.slice:slice-builders:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.0.0'
testImplementation 'androidx.arch.core:core-testing:2.0.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.1.0'
testImplementation 'androidx.arch.core:core-testing:2.1.0'

implementation 'androidx.room:room-runtime:2.1.0'
annotationProcessor 'androidx.room:room-compiler:2.1.0'
Expand All @@ -122,14 +122,14 @@ dependencies {
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'

// Use our own fork, since it seems the original library is abandoned.
implementation 'com.github.niknetniko:material-intro:1624'
implementation 'com.heinrichreimersoftware:material-intro:2.0.0'
implementation 'com.jonathanfinerty.once:once:1.2.2'
implementation 'com.github.captain-miao:optroundcardview:1.1.0'
implementation 'blue.aodev:material-values:1.1.1'

implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'com.google.firebase:firebase-core:17.0.0'
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'

if (props.getProperty("hydra.debug.leaks").toBoolean()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat

private void onError(Throwable throwable) {
Log.e(TAG, "Error while getting data.", throwable);
Snackbar.make(requireView(this), getString(R.string.error_network), Snackbar.LENGTH_LONG)
Snackbar.make(requireView(), getString(R.string.error_network), Snackbar.LENGTH_LONG)
.setAction(getString(R.string.action_again), v -> viewModel.onRefresh())
.show();
}

@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
super.onCreateOptionsMenu(menu, inflater);
inflater.inflate(R.menu.menu_main_events, menu);
requireBaseActivity(this).tintToolbarIcons(menu, R.id.action_refresh);
Expand All @@ -106,4 +106,4 @@ public boolean onOptionsItemSelected(MenuItem item) {

return super.onOptionsItemSelected(item);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public boolean onOptionsItemSelected(MenuItem item) {

private void onError(Throwable throwable) {
Log.e(TAG, "Error while getting data.", throwable);
Snackbar.make(requireView(this), getString(R.string.error_network), Snackbar.LENGTH_LONG)
Snackbar.make(requireView(), getString(R.string.error_network), Snackbar.LENGTH_LONG)
.setAction(getString(R.string.action_again), v -> viewModel.onRefresh())
.show();
}
Expand All @@ -104,4 +104,4 @@ public void onStop() {
super.onStop();
helper.unbindCustomTabsService(getActivity());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private void onError(Throwable throwable) {
if (snackbar != null) {
snackbar.dismiss();
}
snackbar = Snackbar.make(requireView(this), getString(R.string.feed_general_error), Snackbar.LENGTH_LONG)
snackbar = Snackbar.make(requireView(), getString(R.string.feed_general_error), Snackbar.LENGTH_LONG)
.setAction(getString(R.string.action_again), v -> onRefresh());
snackbar.show();
}
Expand Down Expand Up @@ -197,4 +197,4 @@ private void onCommandExecuted(CommandResult result) {
snackbar.show();
}
}
}
}
4 changes: 2 additions & 2 deletions app/src/main/java/be/ugent/zeus/hydra/info/InfoFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat

private void onError(Throwable throwable) {
Log.e(TAG, "Error while getting data.", throwable);
Snackbar.make(requireView(this), getString(R.string.error_network), Snackbar.LENGTH_LONG).show();
Snackbar.make(requireView(), getString(R.string.error_network), Snackbar.LENGTH_LONG).show();
}
}
}
4 changes: 2 additions & 2 deletions app/src/main/java/be/ugent/zeus/hydra/info/InfoType.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void doOnClick(Context context, ActivityHelper helper, InfoItem infoItem)
public Drawable getDrawable(Context context, @ColorRes int color) {

//If there is no drawable, return null.
if(drawable == NO_DRAWABLE) {
if (drawable == NO_DRAWABLE) {
return null;
}

Expand All @@ -119,4 +119,4 @@ public Drawable getDrawable(Context context, @ColorRes int color) {
* @param infoItem The item.
*/
public abstract void doOnClick(Context context, ActivityHelper helper, InfoItem infoItem);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public boolean onOptionsItemSelected(MenuItem item) {

private void onError(Throwable throwable) {
Log.e(TAG, "Error while getting data.", throwable);
Snackbar.make(requireView(this), getString(R.string.error_network), Snackbar.LENGTH_LONG)
Snackbar.make(requireView(), getString(R.string.error_network), Snackbar.LENGTH_LONG)
.setAction(getString(R.string.action_again), v -> viewModel.onRefresh())
.show();
}
Expand All @@ -109,4 +109,4 @@ public void onStop() {
adapter.clearObservers();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static SingleDayFragment newInstance(RestoMenu menu) {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
data = requireArguments(this).getParcelable(ARG_DATA_MENU);
data = requireArguments().getParcelable(ARG_DATA_MENU);
}

@Override
Expand Down Expand Up @@ -96,4 +96,4 @@ public String getEventName() {
return Reporting.getEvents().viewItem();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceStat
recyclerView.addItemDecoration(new DividerItemDecoration(requireContext(), DividerItemDecoration.VERTICAL));
recyclerView.setAdapter(adapter);

int position = requireArguments(this).getInt(ARG_POSITION);
int position = requireArguments().getInt(ARG_POSITION);

viewModel = ViewModelProviders.of(requireActivity()).get(ExtraFoodViewModel.class);
viewModel.getData().observe(this, PartialErrorObserver.with(this::onError));
Expand All @@ -75,8 +75,8 @@ protected void onEmpty() {

private void onError(Throwable throwable) {
Log.e(TAG, "Error while getting data.", throwable);
Snackbar.make(requireView(this), getString(R.string.error_network), Snackbar.LENGTH_LONG)
Snackbar.make(requireView(), getString(R.string.error_network), Snackbar.LENGTH_LONG)
.setAction(getString(R.string.action_again), v -> viewModel.onRefresh())
.show();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public void onNothingSelected(AdapterView<?> parent) {
private void onError(Throwable throwable) {
pageAdapter.setData(Collections.emptyList());
Log.e(TAG, "Error while getting data.", throwable);
Snackbar.make(requireView(this), getString(R.string.error_network), Snackbar.LENGTH_LONG)
Snackbar.make(requireView(), getString(R.string.error_network), Snackbar.LENGTH_LONG)
.setAction(getString(R.string.action_again), v -> menuViewModel.onRefresh())
.show();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public boolean onOptionsItemSelected(MenuItem item) {

private void onError(Throwable throwable) {
Log.e(TAG, "Error while getting data.", throwable);
Snackbar.make(requireView(this), getString(R.string.error_network), Snackbar.LENGTH_LONG)
Snackbar.make(requireView(), getString(R.string.error_network), Snackbar.LENGTH_LONG)
.setAction(getString(R.string.action_again), v -> viewModel.onRefresh())
.show();
}
Expand All @@ -108,4 +108,4 @@ public void onStop() {
super.onStop();
helper.unbindCustomTabsService(getActivity());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ public boolean onOptionsItemSelected(MenuItem item) {

private void onError(Throwable throwable) {
Log.e(TAG, "Error while getting data.", throwable);
Snackbar.make(requireView(this), getString(R.string.error_network), Snackbar.LENGTH_LONG)
Snackbar.make(requireView(), getString(R.string.error_network), Snackbar.LENGTH_LONG)
.setAction(getString(R.string.action_again), v -> viewModel.onRefresh())
.show();
}
}
}
18 changes: 18 additions & 0 deletions app/src/main/res/drawable/info_ufora.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<vector android:height="32dp"
android:viewportHeight="240"
android:viewportWidth="240"
android:width="32dp"
xmlns:android="http://schemas.android.com/apk/res/android">
<path
android:fillAlpha="1"
android:fillColor="#000000"
android:pathData="m74.32,190.062c26.247,0 38.947,-12.277 38.947,-43.392L113.266,49.938L97.18,49.938v96.52c0,22.437 -7.197,29.422 -22.86,29.422 -15.663,0 -22.86,-6.985 -22.86,-29.422v-96.52L35.373,49.938L35.373,146.67c0,31.538 12.488,43.392 38.947,43.392z"
android:strokeColor="#00000000"
android:strokeWidth="0.26458332" />
<path
android:fillAlpha="1"
android:fillColor="#000000"
android:pathData="m145.572,187.522h16.087v-63.923h34.502L196.16,109.84h-34.502v-46.143h42.968v-13.758h-59.055z"
android:strokeColor="#00000000"
android:strokeWidth="0.26458332" />
</vector>
11 changes: 6 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ buildscript {
// For Fabric (Firebase Crashlytics)
maven { url 'https://maven.fabric.io/public' }
// For the license plugin
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.android.tools.build:gradle:3.5.0'
classpath 'com.google.gms:google-services:4.3.2'
classpath 'com.google.android.gms:oss-licenses-plugin:0.9.5'
classpath 'io.fabric.tools:gradle:1.27.1'
}
Expand All @@ -21,15 +22,15 @@ allprojects {
repositories {
// Google libraries
google()
// Some custom libraries
maven { url 'https://jitpack.io' }
// Other libraries
mavenCentral()
// Fallback for libraries not in Maven
jcenter()
// Some custom libraries
maven { url 'https://jitpack.io' }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
}

0 comments on commit aea5707

Please sign in to comment.