From 8dd4759035bae9cff7a0d8bd0af1d1624193c796 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Tue, 29 Sep 2020 14:18:48 +0800 Subject: Add credits for national flag icons. --- .../infinityforreddit/Settings/CreditsPreferenceFragment.java | 10 ++++++++++ .../infinityforreddit/Utils/SharedPreferencesUtils.java | 1 + app/src/main/res/values/strings.xml | 7 ++++--- app/src/main/res/xml/about_preferences.xml | 3 ++- app/src/main/res/xml/credits_preferences.xml | 5 +++++ 5 files changed, 22 insertions(+), 4 deletions(-) (limited to 'app/src') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/CreditsPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/CreditsPreferenceFragment.java index 3bb14843..7382df42 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/CreditsPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/CreditsPreferenceFragment.java @@ -34,6 +34,7 @@ public class CreditsPreferenceFragment extends PreferenceFragmentCompat { Preference thumbtackIconPreference = findPreference(SharedPreferencesUtils.THUMBTACK_ICON_KEY); Preference bestRocketIconPreference = findPreference(SharedPreferencesUtils.BEST_ROCKET_ICON_KEY); Preference materialIconsPreference = findPreference(SharedPreferencesUtils.MATERIAL_ICONS_KEY); + Preference nationalFlagsPreference = findPreference(SharedPreferencesUtils.NATIONAL_FLAGS); if (iconForegroundPreference != null) { iconForegroundPreference.setOnPreferenceClickListener(preference -> { @@ -106,6 +107,15 @@ public class CreditsPreferenceFragment extends PreferenceFragmentCompat { return true; }); } + + if (nationalFlagsPreference != null) { + nationalFlagsPreference.setOnPreferenceClickListener(preference -> { + Intent intent = new Intent(activity, LinkResolverActivity.class); + intent.setData(Uri.parse("https://www.flaticon.com/packs/countrys-flags")); + startActivity(intent); + return true; + }); + } } @Override diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java index 141cceaa..78c1567f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java @@ -134,6 +134,7 @@ public class SharedPreferencesUtils { public static final String DATA_SAVING_MODE_OFF = "0"; public static final String DATA_SAVING_MODE_ONLY_ON_CELLULAR_DATA = "1"; public static final String DATA_SAVING_MODE_ALWAYS = "2"; + public static final String NATIONAL_FLAGS = "national_flags"; public static final String MAIN_PAGE_TABS_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.main_page_tabs"; public static final String MAIN_PAGE_TAB_COUNT = "_main_page_tab_count"; diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 018969fa..bd3f0681 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -490,7 +490,10 @@ Floating Action Button Data Saving Mode In data saving mode, preview images are in lower resolution. - Translation + Translation + Translate this app on POEditor. Thanks to all contributors. + National Flags + Icon made by Freepik from www.flaticon.com Cannot get the link @@ -908,7 +911,5 @@ Code: %1$d/\n Message: %2$s Award given Failed - - Hello blank fragment diff --git a/app/src/main/res/xml/about_preferences.xml b/app/src/main/res/xml/about_preferences.xml index 74a17eaa..03ba5f4e 100644 --- a/app/src/main/res/xml/about_preferences.xml +++ b/app/src/main/res/xml/about_preferences.xml @@ -12,7 +12,8 @@ + + -- cgit v1.2.3