diff --git a/src/main/java/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java b/src/main/java/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java index e52da6f86..2602dc77e 100644 --- a/src/main/java/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java +++ b/src/main/java/org/thoughtcrime/securesms/ApplicationPreferencesActivity.java @@ -45,6 +45,7 @@ import org.thoughtcrime.securesms.preferences.NotificationsPreferenceFragment; import org.thoughtcrime.securesms.preferences.widgets.ProfilePreference; import org.thoughtcrime.securesms.qr.BackupTransferActivity; import org.thoughtcrime.securesms.util.DynamicTheme; +import org.thoughtcrime.securesms.util.IntentUtils; import org.thoughtcrime.securesms.util.Prefs; import org.thoughtcrime.securesms.util.ScreenLockUtil; @@ -65,6 +66,7 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA private static final String PREFERENCE_CATEGORY_MULTIDEVICE = "preference_category_multidevice"; private static final String PREFERENCE_CATEGORY_ADVANCED = "preference_category_advanced"; private static final String PREFERENCE_CATEGORY_CONNECTIVITY = "preference_category_connectivity"; + private static final String PREFERENCE_CATEGORY_DONATE = "preference_category_donate"; private static final String PREFERENCE_CATEGORY_HELP = "preference_category_help"; public static final int REQUEST_CODE_SET_BACKGROUND = 11; @@ -142,6 +144,9 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA this.findPreference(PREFERENCE_CATEGORY_ADVANCED) .setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_ADVANCED)); + this.findPreference(PREFERENCE_CATEGORY_DONATE) + .setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_DONATE)); + this.findPreference(PREFERENCE_CATEGORY_HELP) .setOnPreferenceClickListener(new CategoryClickListener(PREFERENCE_CATEGORY_HELP)); @@ -241,6 +246,9 @@ public class ApplicationPreferencesActivity extends PassphraseRequiredActionBarA case PREFERENCE_CATEGORY_ADVANCED: fragment = new AdvancedPreferenceFragment(); break; + case PREFERENCE_CATEGORY_DONATE: + IntentUtils.showInBrowser(requireActivity(), "https://delta.chat/donate"); + break; case PREFERENCE_CATEGORY_HELP: startActivity(new Intent(getActivity(), LocalHelpActivity.class)); break; diff --git a/src/main/res/drawable/ic_donate_24dp.xml b/src/main/res/drawable/ic_donate_24dp.xml new file mode 100644 index 000000000..07ab6aae9 --- /dev/null +++ b/src/main/res/drawable/ic_donate_24dp.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml index fa1624b8c..1f9bdff00 100644 --- a/src/main/res/xml/preferences.xml +++ b/src/main/res/xml/preferences.xml @@ -35,6 +35,11 @@ android:icon="@drawable/ic_advanced_24dp" android:layout="@layout/preference_item" /> + +