summaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorcyBerta <cyberta@riseup.net>2019-04-01 01:46:00 +0200
committercyBerta <cyberta@riseup.net>2019-04-01 01:46:00 +0200
commitced2e5f4973fb8aae015f8d2ec2e3cd70d450ea7 (patch)
tree8a579c275bc7b3af4c1cfb76bb256eed92b21803 /app/src/main/java
parent673621f070d91e14f3daa35e751f14df1e3bfacd (diff)
fix layout inflation exeption occuring with vector graphics on Android 4.X
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/BitmaskApp.java2
-rw-r--r--app/src/main/java/se/leap/bitmaskclient/fragments/DonationReminderDialog.java28
2 files changed, 13 insertions, 17 deletions
diff --git a/app/src/main/java/se/leap/bitmaskclient/BitmaskApp.java b/app/src/main/java/se/leap/bitmaskclient/BitmaskApp.java
index fd9aa029..45664653 100644
--- a/app/src/main/java/se/leap/bitmaskclient/BitmaskApp.java
+++ b/app/src/main/java/se/leap/bitmaskclient/BitmaskApp.java
@@ -3,6 +3,7 @@ package se.leap.bitmaskclient;
import android.content.Context;
import android.content.SharedPreferences;
import android.support.multidex.MultiDexApplication;
+import android.support.v7.app.AppCompatDelegate;
import com.squareup.leakcanary.LeakCanary;
import com.squareup.leakcanary.RefWatcher;
@@ -36,6 +37,7 @@ public class BitmaskApp extends MultiDexApplication {
providerObservable = ProviderObservable.getInstance();
providerObservable.updateProvider(getSavedProviderFromSharedPreferences(preferences));
EipSetupObserver.init(this, preferences);
+ AppCompatDelegate.setCompatVectorFromResourcesEnabled(true);
}
/**
diff --git a/app/src/main/java/se/leap/bitmaskclient/fragments/DonationReminderDialog.java b/app/src/main/java/se/leap/bitmaskclient/fragments/DonationReminderDialog.java
index 001d7e6c..66db9bc8 100644
--- a/app/src/main/java/se/leap/bitmaskclient/fragments/DonationReminderDialog.java
+++ b/app/src/main/java/se/leap/bitmaskclient/fragments/DonationReminderDialog.java
@@ -55,23 +55,17 @@ public class DonationReminderDialog extends AppCompatDialogFragment {
isShown = true;
builder.setView(view);
- btnDonate.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(DONATION_URL));
- startActivity(browserIntent);
- PreferenceHelper.putString(getContext(), LAST_DONATION_REMINDER_DATE,
- DateHelper.getCurrentDateString());
- dismiss();
- }
+ btnDonate.setOnClickListener(v -> {
+ Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(DONATION_URL));
+ startActivity(browserIntent);
+ PreferenceHelper.putString(getContext(), LAST_DONATION_REMINDER_DATE,
+ DateHelper.getCurrentDateString());
+ dismiss();
});
- btnLater.setOnClickListener(new View.OnClickListener() {
- @Override
- public void onClick(View v) {
- PreferenceHelper.putString(getContext(), LAST_DONATION_REMINDER_DATE,
- DateHelper.getCurrentDateString());
- dismiss();
- }
+ btnLater.setOnClickListener(v -> {
+ PreferenceHelper.putString(getContext(), LAST_DONATION_REMINDER_DATE,
+ DateHelper.getCurrentDateString());
+ dismiss();
});
return builder.create();
@@ -90,7 +84,7 @@ public class DonationReminderDialog extends AppCompatDialogFragment {
Log.e(TAG, "context is null!");
return false;
}
-
+
String firstTimeUserDate = PreferenceHelper.getString(context, FIRST_TIME_USER_DATE, null);
if (firstTimeUserDate == null) {
PreferenceHelper.putString(context, FIRST_TIME_USER_DATE, DateHelper.getCurrentDateString());