From b9a1980f754245d1ef3b9476552e34c5daa4b33e Mon Sep 17 00:00:00 2001 From: Eric Kok Date: Tue, 23 Apr 2019 10:13:13 +0200 Subject: [PATCH] Removed donate link in Transdrone version to meet Play Store regulations --- app/src/lite/res/values/strings.xml | 4 ++-- .../transdroid/core/gui/settings/MainSettingsActivity.java | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/lite/res/values/strings.xml b/app/src/lite/res/values/strings.xml index d0af0753..36912a08 100644 --- a/app/src/lite/res/values/strings.xml +++ b/app/src/lite/res/values/strings.xml @@ -18,7 +18,7 @@ Transdrone - Donate via transdroid.org - https://transdroid.org + + diff --git a/app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java b/app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java index 4e66825f..7d803716 100644 --- a/app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java +++ b/app/src/main/java/org/transdroid/core/gui/settings/MainSettingsActivity.java @@ -178,6 +178,7 @@ public class MainSettingsActivity extends PreferenceCompatActivity { boolean enableSearchUi = navigationHelper.enableSearchUi(); boolean enableRssUi = navigationHelper.enableRssUi(); + boolean enableDonateLink = !getString(R.string.donate_url).isEmpty(); // Load the preference menu and attach actions addPreferencesFromResource(R.xml.pref_main); @@ -191,7 +192,11 @@ public class MainSettingsActivity extends PreferenceCompatActivity { findPreference("header_background").setOnPreferenceClickListener(onBackgroundSettings); findPreference("header_system").setOnPreferenceClickListener(onSystemSettings); findPreference("header_help").setOnPreferenceClickListener(onHelpSettings); - findPreference("header_donate").setOnPreferenceClickListener(onDonate); + if (enableDonateLink) { + findPreference("header_donate").setOnPreferenceClickListener(onDonate); + } else { + getPreferenceScreen().removePreference(findPreference("header_donate")); + } // Keep a list of the server codes and names (for default server selection) List serverCodes = new ArrayList<>();