diff --git a/app/build.gradle b/app/build.gradle
index 8376b247..a8ce4a96 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -21,6 +21,7 @@ apply plugin: 'com.android.application'
apply plugin: 'com.squareup.sqldelight'
apply plugin: 'com.github.triplet.play'
apply plugin: 'com.bugsnag.android.gradle'
+apply plugin: 'com.google.gms.oss.licenses.plugin'
bugsnag {
apiKey '600a00bfd5bd72e5df7f288f74df8f9b'
@@ -139,7 +140,10 @@ android {
final AUTO_VALUE_GSON_VERSION = '0.7.0'
final AUTO_VALUE_PARCEL_VERSION = '0.2.5'
- implementation 'com.google.firebase:firebase-core:15.0.0'
+ implementation 'com.google.firebase:firebase-core:15.0.2'
+ implementation 'com.google.firebase:firebase-analytics:15.0.2'
+
+ implementation 'com.google.android.gms:play-services-oss-licenses:15.0.1'
implementation "com.android.support:support-compat:$SUPPORT_LIBRARY_VERSION"
implementation "com.android.support:support-core-utils:$SUPPORT_LIBRARY_VERSION"
@@ -196,7 +200,6 @@ android {
implementation 'com.malinskiy:materialicons:1.0.2'
implementation 'com.github.amlcurran.showcaseview:library:5.4.0'
implementation 'com.github.afollestad.material-dialogs:core:0.8.5.5'
- implementation 'de.psdev.licensesdialog:licensesdialog:1.8.0'
//noinspection GradleDynamicVersion
implementation 'com.bugsnag:bugsnag-android:4.+'
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 42455077..11a4d87e 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -121,5 +121,11 @@
+
+
+
+
diff --git a/app/src/main/java/com/shalzz/attendance/billing/BillingManager.java b/app/src/main/java/com/shalzz/attendance/billing/BillingManager.java
index e2501159..41aebfee 100644
--- a/app/src/main/java/com/shalzz/attendance/billing/BillingManager.java
+++ b/app/src/main/java/com/shalzz/attendance/billing/BillingManager.java
@@ -233,15 +233,17 @@ public void queryPurchases() {
if (areSubscriptionsSupported()) {
PurchasesResult subscriptionResult
= mBillingClient.queryPurchases(SkuType.SUBS);
- Timber.i("Querying purchases and subscriptions elapsed time: %s ms",
- (System.currentTimeMillis() - time));
- Timber.i( "Querying subscriptions result code: %d res: %d"
- , subscriptionResult.getResponseCode()
- , subscriptionResult.getPurchasesList().size());
- if (subscriptionResult.getResponseCode() == BillingResponse.OK) {
+ if (subscriptionResult!= null && subscriptionResult.getResponseCode()
+ == BillingResponse.OK) {
purchasesResult.getPurchasesList().addAll(
subscriptionResult.getPurchasesList());
+
+ Timber.i("Querying purchases and subscriptions elapsed time: %s ms",
+ (System.currentTimeMillis() - time));
+ Timber.i( "Querying subscriptions result code: %d res: %d"
+ , subscriptionResult.getResponseCode()
+ , subscriptionResult.getPurchasesList().size());
} else {
Timber.e( "Got an error response trying to query subscription purchases");
}
diff --git a/app/src/main/java/com/shalzz/attendance/data/local/DbOpenHelper.java b/app/src/main/java/com/shalzz/attendance/data/local/DbOpenHelper.java
index 4889dd75..08a9574d 100644
--- a/app/src/main/java/com/shalzz/attendance/data/local/DbOpenHelper.java
+++ b/app/src/main/java/com/shalzz/attendance/data/local/DbOpenHelper.java
@@ -55,14 +55,7 @@ public void onCreate(SupportSQLiteDatabase db) {
@Override
public void onUpgrade(SupportSQLiteDatabase db, int oldVersion, int newVersion) {
switch (oldVersion) {
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
+ default:
// Drop older table if existed
db.execSQL("DROP TABLE IF EXISTS " + Subject.TABLE_NAME);
diff --git a/app/src/main/java/com/shalzz/attendance/data/remote/interceptor/CacheControlInterceptor.java b/app/src/main/java/com/shalzz/attendance/data/remote/interceptor/CacheControlInterceptor.java
index 8833b239..730b495f 100644
--- a/app/src/main/java/com/shalzz/attendance/data/remote/interceptor/CacheControlInterceptor.java
+++ b/app/src/main/java/com/shalzz/attendance/data/remote/interceptor/CacheControlInterceptor.java
@@ -15,6 +15,7 @@
import okhttp3.Interceptor;
import okhttp3.Request;
import okhttp3.Response;
+import timber.log.Timber;
public class CacheControlInterceptor implements Interceptor {
private Context mContext;
@@ -26,27 +27,34 @@ public CacheControlInterceptor(@ApplicationContext Context context) {
@Override
public Response intercept(@NonNull Chain chain) throws IOException {
+ Request request = chain.request();
if (NetworkUtil.isNetworkConnected(mContext)) {
- Response originalResponse = chain.proceed(chain.request());
- int maxAge = 60; // read from cache for 1 minute
- return originalResponse.newBuilder()
- .header("Cache-Control", "public, max-age=" + maxAge)
- .build();
-
- } else {
- Request request = chain.request();
- // only for the 'verify' api route
- if (request.url().encodedPath().equals("/api/v1/verify")) {
- CacheControl cacheControl = new CacheControl.Builder()
- .onlyIfCached()
- .maxStale(7, TimeUnit.DAYS)
+ // Do not cache the '/me' api route
+ if (request.url().encodedPath().equals("/api/v1/me")) {
+ Response originalResponse = chain.proceed(request);
+ return originalResponse.newBuilder()
+ .header("Cache-Control", "public, max-age=0")
.build();
-
- request = request.newBuilder()
- .cacheControl(cacheControl)
+ }
+ else {
+ Timber.d("Caching: %s",request.url().encodedPath());
+ Response originalResponse = chain.proceed(request);
+ int maxAge = 60; // read from cache for 1 minute
+ return originalResponse.newBuilder()
+ .header("Cache-Control", "public, max-age=" + maxAge)
.build();
}
- return chain.proceed(request);
+ // only for the 'verify' api route
+ } else if (request.url().encodedPath().equals("/api/v1/verify")) {
+ CacheControl cacheControl = new CacheControl.Builder()
+ .onlyIfCached()
+ .maxStale(7, TimeUnit.DAYS)
+ .build();
+
+ request = request.newBuilder()
+ .cacheControl(cacheControl)
+ .build();
}
+ return chain.proceed(request);
}
}
diff --git a/app/src/main/java/com/shalzz/attendance/sync/Authenticator.java b/app/src/main/java/com/shalzz/attendance/sync/Authenticator.java
index 3f5bccb4..7473624f 100644
--- a/app/src/main/java/com/shalzz/attendance/sync/Authenticator.java
+++ b/app/src/main/java/com/shalzz/attendance/sync/Authenticator.java
@@ -48,7 +48,7 @@ public Bundle addAccount(
String s,
String s2,
String[] strings,
- Bundle bundle) throws NetworkErrorException {
+ Bundle bundle) {
return null;
}
// Ignore attempts to confirm credentials
@@ -56,7 +56,7 @@ public Bundle addAccount(
public Bundle confirmCredentials(
AccountAuthenticatorResponse r,
Account account,
- Bundle bundle) throws NetworkErrorException {
+ Bundle bundle) {
return null;
}
// Getting an authentication token is not supported
@@ -65,7 +65,7 @@ public Bundle getAuthToken(
AccountAuthenticatorResponse r,
Account account,
String s,
- Bundle bundle) throws NetworkErrorException {
+ Bundle bundle) {
throw new UnsupportedOperationException();
}
// Getting a label for the auth token is not supported
@@ -78,14 +78,14 @@ public String getAuthTokenLabel(String s) {
public Bundle updateCredentials(
AccountAuthenticatorResponse r,
Account account,
- String s, Bundle bundle) throws NetworkErrorException {
+ String s, Bundle bundle) {
throw new UnsupportedOperationException();
}
// Checking features for the account is not supported
@Override
public Bundle hasFeatures(
AccountAuthenticatorResponse r,
- Account account, String[] strings) throws NetworkErrorException {
+ Account account, String[] strings) {
throw new UnsupportedOperationException();
}
}
diff --git a/app/src/main/java/com/shalzz/attendance/ui/attendance/ExpandableListAdapter.java b/app/src/main/java/com/shalzz/attendance/ui/attendance/ExpandableListAdapter.java
index 87ec1bed..9f0cf86c 100644
--- a/app/src/main/java/com/shalzz/attendance/ui/attendance/ExpandableListAdapter.java
+++ b/app/src/main/java/com/shalzz/attendance/ui/attendance/ExpandableListAdapter.java
@@ -256,18 +256,18 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
private void inflateChildView(final View view) {
final GenericViewHolder views = (GenericViewHolder) view.getTag();
- ViewStub stub = (ViewStub) view.findViewById(R.id.subject_details_stub);
+ ViewStub stub = view.findViewById(R.id.subject_details_stub);
if (stub != null) {
views.childView = (RelativeLayout) stub.inflate();
}
else
- views.childView = (RelativeLayout) views.itemView.findViewById(R.id.subTree);
+ views.childView = views.itemView.findViewById(R.id.subTree);
// child view
View childView = views.childView;
- views.tvAbsent = (TextView) childView.findViewById(R.id.tvAbsent);
- views.tvReach = (TextView) childView.findViewById(R.id.tvReach);
- views.ivAlert = (ImageView) childView.findViewById(R.id.imageView1);
+ views.tvAbsent = childView.findViewById(R.id.tvAbsent);
+ views.tvReach = childView.findViewById(R.id.tvReach);
+ views.ivAlert = childView.findViewById(R.id.imageView1);
bindChildView(views,views.position);
}
@@ -476,9 +476,9 @@ private void prepareHeaderFooter(HeaderFooterViewHolder vh, View view){
/** --------footer-------- */
view.setVisibility(View.VISIBLE);
- TextView tvPercent = (TextView) view.findViewById(R.id.tvTotalPercent);
- TextView tvClasses = (TextView) view.findViewById(R.id.tvClass);
- ProgressBar pbPercent = (ProgressBar) view.findViewById(R.id.pbTotalPercent);
+ TextView tvPercent = view.findViewById(R.id.tvTotalPercent);
+ TextView tvClasses = view.findViewById(R.id.tvClass);
+ ProgressBar pbPercent = view.findViewById(R.id.pbTotalPercent);
tvPercent.setText(mResources.getString(R.string.atten_list_percentage,
mFooter.getPercentage()));
tvClasses.setText(mResources.getString(R.string.atten_list_attended_upon_held,
diff --git a/app/src/main/java/com/shalzz/attendance/ui/login/LoginPresenter.java b/app/src/main/java/com/shalzz/attendance/ui/login/LoginPresenter.java
index 096ffb8e..a2e96368 100644
--- a/app/src/main/java/com/shalzz/attendance/ui/login/LoginPresenter.java
+++ b/app/src/main/java/com/shalzz/attendance/ui/login/LoginPresenter.java
@@ -85,13 +85,14 @@ public void onNext(User user) {
@Override
public void onError(Throwable e) {
- RetrofitException error = (RetrofitException) e;
- if (error.getKind() == RetrofitException.Kind.UNEXPECTED) {
- getMvpView().showError(error.getMessage());
- Timber.e(e);
- }
- else {
- getMvpView().showError(error.getMessage());
+ if (isViewAttached()) {
+ RetrofitException error = (RetrofitException) e;
+ if (error.getKind() == RetrofitException.Kind.HTTP) {
+ getMvpView().showError(error.getMessage());
+ } else {
+ getMvpView().showError(error.getMessage());
+ Timber.e(e);
+ }
}
}
diff --git a/app/src/main/java/com/shalzz/attendance/ui/main/MainActivity.java b/app/src/main/java/com/shalzz/attendance/ui/main/MainActivity.java
index 4fbc2b34..1c63b101 100644
--- a/app/src/main/java/com/shalzz/attendance/ui/main/MainActivity.java
+++ b/app/src/main/java/com/shalzz/attendance/ui/main/MainActivity.java
@@ -179,6 +179,7 @@ protected void onCreate(Bundle savedInstanceState) {
// Set the list's click listener
mNavigationView.setNavigationItemSelectedListener(new NavigationItemSelectedListener());
+ initDrawer();
init(savedInstanceState);
}
@@ -196,13 +197,6 @@ protected void onResume() {
}
}
- @Override
- protected void onStart() {
- super.onStart();
-
- initDrawer();
- }
-
/**
* Initialise a fragment
**/
diff --git a/app/src/main/java/com/shalzz/attendance/ui/settings/AboutSettingsFragment.java b/app/src/main/java/com/shalzz/attendance/ui/settings/AboutSettingsFragment.java
index 0b5e1da3..5cd24384 100644
--- a/app/src/main/java/com/shalzz/attendance/ui/settings/AboutSettingsFragment.java
+++ b/app/src/main/java/com/shalzz/attendance/ui/settings/AboutSettingsFragment.java
@@ -20,12 +20,14 @@
package com.shalzz.attendance.ui.settings;
import android.content.Context;
+import android.content.Intent;
import android.os.Bundle;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceFragmentCompat;
import android.support.v7.preference.PreferenceScreen;
import com.bugsnag.android.Bugsnag;
+import com.google.android.gms.oss.licenses.OssLicensesMenuActivity;
import com.google.firebase.analytics.FirebaseAnalytics;
import com.shalzz.attendance.BuildConfig;
import com.shalzz.attendance.R;
@@ -35,8 +37,6 @@
import javax.inject.Inject;
import javax.inject.Named;
-import de.psdev.licensesdialog.LicensesDialog;
-
public class AboutSettingsFragment extends PreferenceFragmentCompat {
private MainActivity mainActivity;
@@ -50,12 +50,16 @@ public class AboutSettingsFragment extends PreferenceFragmentCompat {
@Override
public void onCreatePreferences(Bundle bundle, String s) {
- ((MainActivity) getActivity()).activityComponent().inject(this);
Bugsnag.setContext("About");
+ addPreferencesFromResource(R.xml.pref_about);
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
mainActivity = ((MainActivity) getActivity());
+ mainActivity.activityComponent().inject(this);
mainActivity.setDrawerAsUp(true);
-
- addPreferencesFromResource(R.xml.pref_about);
+ super.onActivityCreated(savedInstanceState);
}
@Override
@@ -84,34 +88,9 @@ public void onResume() {
return true;
});
-// Preference pref = prefScreen.getPreference(index++);
-// pref.setOnPreferenceClickListener(preference -> {
-// final String name = getString(R.string.app_name);
-// final String url = getString(R.string.app_url);
-// final String copyright = getString(R.string.copyright_year) + " "
-// + getString(R.string.app_copyright);
-// final License license = new GnuGeneralPublicLicense20();
-// final Notice notice = new Notice(name, url, copyright, license);
-// new LicensesDialog.Builder(mContext)
-// .setNotices(notice)
-// .setShowFullLicenseText(true)
-// .build()
-// .show();
-//
-// mTracker.send(new HitBuilders.EventBuilder()
-// .setCategory("Click")
-// .setAction("License")
-// .build());
-// return true;
-// });
-
Preference noticePref = prefScreen.getPreference(index++);
noticePref.setOnPreferenceClickListener(preference -> {
- new LicensesDialog.Builder(mContext)
- .setNotices(R.raw.notices)
- .setIncludeOwnLicense(true)
- .build()
- .show();
+ startActivity(new Intent(mContext, OssLicensesMenuActivity.class));
Bundle bundle = new Bundle();
bundle.putString(FirebaseAnalytics.Param.ITEM_ID, getString(R.string.pref_key_info_notices));
diff --git a/app/src/main/java/com/shalzz/attendance/ui/settings/SettingsFragment.java b/app/src/main/java/com/shalzz/attendance/ui/settings/SettingsFragment.java
index 763471c5..29537766 100644
--- a/app/src/main/java/com/shalzz/attendance/ui/settings/SettingsFragment.java
+++ b/app/src/main/java/com/shalzz/attendance/ui/settings/SettingsFragment.java
@@ -72,9 +72,6 @@ public class SettingsFragment extends PreferenceFragmentCompat implements
@Inject
PreferencesHelper mPreferences;
- @Inject
- Activity mActivity;
-
@ActivityContext
@Inject
Context mContext;
@@ -88,41 +85,48 @@ public class SettingsFragment extends PreferenceFragmentCompat implements
private SwitchPreference proModePref;
private ProModeListPreference proThemePref;
private SwitchPreference weekendsPref;
+ private Activity mActivity;
private Disposable PurchaseEventDisposable;
+ @Override
+ public void onStart() {
+ super.onStart();
+ mTracker.setCurrentScreen(mActivity, getClass().getSimpleName(), getClass().getSimpleName());
+ }
+
@Override
public void onCreatePreferences(Bundle bundle, String s) {
- ((MainActivity) getActivity()).activityComponent().inject(this);
Bugsnag.setContext("Settings");
addPreferencesFromResource(R.xml.preferences);
- mBillingProvider = (BillingProvider) mActivity;
-
key_sync_interval = getString(R.string.pref_key_sync_interval);
ListPreference synclistPref = (ListPreference) findPreference(key_sync_interval);
synclistPref.setSummary(synclistPref.getEntry());
syncPref = (SwitchPreference) findPreference(getString(R.string.pref_key_sync));
+ proThemePref = (ProModeListPreference) findPreference(getString(R.string.pref_key_day_night));
+ weekendsPref = (SwitchPreference) findPreference(getString(R.string.pref_key_hide_weekends));
+ proModePref = (SwitchPreference) findPreference(getString(R.string.pref_key_pro_mode));
+ }
+
+ @Override
+ public void onActivityCreated(Bundle savedInstanceState) {
+ mActivity = getActivity();
+ ((MainActivity) mActivity).activityComponent().inject(this);
+
+ mBillingProvider = (BillingProvider) mActivity;
+
if (ContextCompat.checkSelfPermission(mContext, Manifest.permission.GET_ACCOUNTS) !=
PackageManager.PERMISSION_GRANTED) {
toggleSync(false);
syncPref.setChecked(false);
}
- proThemePref = (ProModeListPreference) findPreference(getString(R.string.pref_key_day_night));
- weekendsPref = (SwitchPreference) findPreference(getString(R.string.pref_key_hide_weekends));
-
- proModePref = (SwitchPreference) findPreference(getString(R.string.pref_key_pro_mode));
PurchaseEventDisposable = mEventBus.filteredObservable(ProKeyPurchaseEvent.class)
- .subscribe(proKeyPurchaseEvent -> proModePref.setChecked(true), Timber::e);
- }
-
- @Override
- public void onStart() {
- super.onStart();
- mTracker.setCurrentScreen(mActivity, getClass().getSimpleName(), getClass().getSimpleName());
+ .subscribe(proKeyPurchaseEvent -> proModePref.setChecked(true), Timber::e);
+ super.onActivityCreated(savedInstanceState);
}
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {
@@ -252,7 +256,6 @@ public void onResume() {
transaction.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN);
transaction.addToBackStack(null);
- // TODO: use an EventBus
((MainActivity)mActivity).mPopSettingsBackStack = true;
transaction.commit();
diff --git a/app/src/main/res/drawable-v21/launch_screen.xml b/app/src/main/res/drawable-v21/launch_screen.xml
index 78e7cdbb..72082ade 100644
--- a/app/src/main/res/drawable-v21/launch_screen.xml
+++ b/app/src/main/res/drawable-v21/launch_screen.xml
@@ -28,7 +28,6 @@
-
diff --git a/app/src/main/res/drawable/launch_screen.xml b/app/src/main/res/drawable/launch_screen.xml
index be419a08..cee9d390 100644
--- a/app/src/main/res/drawable/launch_screen.xml
+++ b/app/src/main/res/drawable/launch_screen.xml
@@ -28,7 +28,6 @@
-
diff --git a/app/src/main/res/raw/notices.xml b/app/src/main/res/raw/notices.xml
deleted file mode 100644
index 99bda928..00000000
--- a/app/src/main/res/raw/notices.xml
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
- Material Dialogs
- https://github.com/afollestad/material-dialogs
- Copyright (c) 2014 Aidan Michael Follestad
- MIT License
-
-
- Butter Knife
- http://jakewharton.github.io/butterknife/
- Copyright 2013 Jake Wharton
- Apache Software License 2.0
-
-
- Bugsnag
- https://bugsnag.com/
- Copyright (c) 2012 Bugsnag
- MIT License
-
-
- Showcase View
- http://amlcurran.github.io/ShowcaseView/
- Copyright Alex Curran © 2012-2014. All rights reserved.
- Apache Software License 2.0
-
-
- okHttp
- square.github.io/okhttp/
- Copyright 2014 Square, Inc.
- Apache Software License 2.0
-
-
- Android Volley
- https://android.googlesource.com/platform/frameworks/volley/
- Copyright (C) 2011 The Android Open Source Project
- Apache Software License 2.0
-
-
- v4 Support Library
- https://developer.android.com/tools/support-library/features.html#v4
- Copyright (C) 2014 The Android Open Source Project
- Apache Software License 2.0
-
-
- v7 recyclerview library
- https://developer.android.com/tools/support-library/features.html#v7
- Copyright (C) 2014 The Android Open Source Project
- Apache Software License 2.0
-
-
- v7 appcompat library
- https://developer.android.com/tools/support-library/features.html#v7
- Copyright (C) 2014 The Android Open Source Project
- Apache Software License 2.0
-
-
- v13 Support Library
- https://developer.android.com/tools/support-library/features.html#v13
- Copyright (C) 2014 The Android Open Source Project
- Apache Software License 2.0
-
-
- v14 Preference Support Library
- https://developer.android.com/tools/support-library/features.html#v14-preference
- Copyright (C) 2015 The Android Open Source Project
- Apache Software License 2.0
-
-
- Design Support Library
- https://developer.android.com/tools/support-library/features.html#design
- Copyright (C) 2015 The Android Open Source Project
- Apache Software License 2.0
-
-
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 3a834cdb..bea7e95b 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -102,7 +102,7 @@
Refresh Interval
About
Author
- Open Source License
+ Open Source Licenses
License details for open source softwares
Build Version
Google Analytics
diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml
index 140941a5..38ae420f 100644
--- a/app/src/main/res/values/styles.xml
+++ b/app/src/main/res/values/styles.xml
@@ -39,17 +39,20 @@
+
+
+
diff --git a/app/src/main/res/xml/pref_about.xml b/app/src/main/res/xml/pref_about.xml
index 0df3f6f7..8f8ad63a 100644
--- a/app/src/main/res/xml/pref_about.xml
+++ b/app/src/main/res/xml/pref_about.xml
@@ -24,10 +24,6 @@
android:key="@string/pref_key_info_author"
android:title="@string/pref_author"
android:persistent="false"/>
-
-
-
-
result = new TestObserver<>();
mDatabaseHelper.getUserCount().subscribe(result);
result.assertNoErrors();
@@ -109,7 +109,7 @@ public void getUserCount() throws Exception {
}
@Test
- public void getSubjectCount() throws Exception {
+ public void getSubjectCount() {
TestObserver result = new TestObserver<>();
mDatabaseHelper.getSubjectCount().subscribe(result);
result.assertNoErrors();
@@ -117,7 +117,7 @@ public void getSubjectCount() throws Exception {
}
@Test
- public void getPeriodCount() throws Exception {
+ public void getPeriodCount() {
TestObserver result = new TestObserver<>();
mDatabaseHelper.getPeriodCount(new Date()).subscribe(result);
result.assertNoErrors();
diff --git a/app/src/test/java/com/shalzz/attendance/util/RxSchedulersOverrideRule.java b/app/src/test/java/com/shalzz/attendance/util/RxSchedulersOverrideRule.java
index a6b41e88..89bbcdee 100644
--- a/app/src/test/java/com/shalzz/attendance/util/RxSchedulersOverrideRule.java
+++ b/app/src/test/java/com/shalzz/attendance/util/RxSchedulersOverrideRule.java
@@ -3,11 +3,11 @@
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
+
import java.util.concurrent.Callable;
import io.reactivex.Scheduler;
import io.reactivex.android.plugins.RxAndroidPlugins;
-import io.reactivex.annotations.NonNull;
import io.reactivex.functions.Function;
import io.reactivex.plugins.RxJavaPlugins;
import io.reactivex.schedulers.Schedulers;
@@ -21,21 +21,10 @@
public class RxSchedulersOverrideRule implements TestRule {
private final Function, Scheduler> mRxAndroidSchedulersHook =
- new Function, Scheduler>() {
- @Override
- public Scheduler apply(@NonNull Callable schedulerCallable)
- throws Exception {
- return getScheduler();
- }
- };
+ schedulerCallable -> getScheduler();
private final Function mRxJavaImmediateScheduler =
- new Function() {
- @Override
- public Scheduler apply(@NonNull Scheduler scheduler) throws Exception {
- return getScheduler();
- }
- };
+ scheduler -> getScheduler();
@Override
public Statement apply(final Statement base, Description description) {
diff --git a/build.gradle b/build.gradle
index dfa8d8b8..c6c9b415 100644
--- a/build.gradle
+++ b/build.gradle
@@ -25,10 +25,11 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.1.1'
+ classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.squareup.sqldelight:gradle-plugin:0.7.0'
classpath 'com.github.triplet.gradle:play-publisher:1.2.0'
- classpath 'com.google.gms:google-services:3.2.1'
+ classpath 'com.google.gms:google-services:3.3.0'
+ classpath "com.google.gms:oss-licenses:0.9.2"
//noinspection GradleDynamicVersion
classpath 'com.bugsnag:bugsnag-android-gradle-plugin:3.+'