From f6750a1583bee48b055adeac4fdf70a1462a2e83 Mon Sep 17 00:00:00 2001 From: adbenitez Date: Mon, 5 May 2025 19:11:21 +0200 Subject: [PATCH 1/3] add "Donate" button to main settings --- .../securesms/ApplicationPreferencesActivity.java | 8 ++++++++ src/main/res/drawable/ic_donate_24dp.xml | 3 +++ src/main/res/xml/preferences.xml | 5 +++++ 3 files changed, 16 insertions(+) create mode 100644 src/main/res/drawable/ic_donate_24dp.xml 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" /> + + Date: Mon, 5 May 2025 21:48:15 +0200 Subject: [PATCH 2/3] put donate and help in category --- src/main/res/xml/preferences.xml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml index 1f9bdff00..e09faabed 100644 --- a/src/main/res/xml/preferences.xml +++ b/src/main/res/xml/preferences.xml @@ -35,14 +35,18 @@ android:icon="@drawable/ic_advanced_24dp" android:layout="@layout/preference_item" /> - + - + + + + + From 8e8b49508d59dbd71c86c87a52012156bc1185bb Mon Sep 17 00:00:00 2001 From: adbenitez Date: Mon, 5 May 2025 22:11:15 +0200 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 849b14e17..7369cfc26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * fix: webxdc.selfName uses the name otherwise displayed * fix potential crash on startup +* add donation link to app settings ## v1.58.2 2025-04