diff options
author | Alex Ning <chineseperson5@gmail.com> | 2020-02-20 07:43:53 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2020-02-20 07:43:53 +0000 |
commit | b06c24402b5d32527c8449f8a5bd02ddfd15736a (patch) | |
tree | fc1e4a3dc073a4e489d00dd23510ac0586bfa490 /app/src/main/java | |
parent | d9b9a7c3c13303e2f61b2cb557ab96ec1a23a7ac (diff) | |
download | infinity-for-reddit-b06c24402b5d32527c8449f8a5bd02ddfd15736a.tar infinity-for-reddit-b06c24402b5d32527c8449f8a5bd02ddfd15736a.tar.gz infinity-for-reddit-b06c24402b5d32527c8449f8a5bd02ddfd15736a.tar.bz2 infinity-for-reddit-b06c24402b5d32527c8449f8a5bd02ddfd15736a.tar.lz infinity-for-reddit-b06c24402b5d32527c8449f8a5bd02ddfd15736a.tar.xz infinity-for-reddit-b06c24402b5d32527c8449f8a5bd02ddfd15736a.tar.zst infinity-for-reddit-b06c24402b5d32527c8449f8a5bd02ddfd15736a.zip |
Add a F-Droid option in settings.
Diffstat (limited to 'app/src/main/java')
2 files changed, 14 insertions, 3 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AboutPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AboutPreferenceFragment.java index 0a0bd3bf..3d81bb30 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AboutPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Settings/AboutPreferenceFragment.java @@ -28,7 +28,8 @@ public class AboutPreferenceFragment extends PreferenceFragmentCompat { setPreferencesFromResource(R.xml.about_preferences, rootKey); Preference openSourcePreference = findPreference(SharedPreferencesUtils.OPEN_SOURCE_KEY); - Preference reviewPreference = findPreference(SharedPreferencesUtils.RATE_KEY); + Preference ratePreference = findPreference(SharedPreferencesUtils.RATE_KEY); + Preference fDroidPreference = findPreference(SharedPreferencesUtils.F_DROID_KEY); Preference emailPreference = findPreference(SharedPreferencesUtils.EMAIL_KEY); Preference redditAccountPreference = findPreference(SharedPreferencesUtils.REDDIT_ACCOUNT_KEY); Preference subredditPreference = findPreference(SharedPreferencesUtils.SUBREDDIT_KEY); @@ -43,8 +44,8 @@ public class AboutPreferenceFragment extends PreferenceFragmentCompat { }); } - if (reviewPreference != null) { - reviewPreference.setOnPreferenceClickListener(preference -> { + if (ratePreference != null) { + ratePreference.setOnPreferenceClickListener(preference -> { Intent playStoreIntent = new Intent(Intent.ACTION_VIEW); playStoreIntent.setData(Uri.parse("market://details?id=ml.docilealligator.infinityforreddit")); if (playStoreIntent.resolveActivity(activity.getPackageManager()) != null) { @@ -58,6 +59,15 @@ public class AboutPreferenceFragment extends PreferenceFragmentCompat { }); } + if (fDroidPreference != null) { + fDroidPreference.setOnPreferenceClickListener(preference -> { + Intent intent = new Intent(activity, LinkResolverActivity.class); + intent.setData(Uri.parse("https://www.reddit.com/r/Infinity_For_Reddit/comments/f23o0y/for_anyone_who_wants_to_use_fdroid/")); + startActivity(intent); + return true; + }); + } + if (emailPreference != null) { emailPreference.setOnPreferenceClickListener(preference -> { Intent intent = new Intent(Intent.ACTION_SENDTO); 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 357ee2a5..85c1f9f9 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/Utils/SharedPreferencesUtils.java @@ -21,6 +21,7 @@ public class SharedPreferencesUtils { public static final String MATERIAL_ICONS_KEY = "material_icons"; public static final String OPEN_SOURCE_KEY = "open_source"; public static final String RATE_KEY = "rate"; + public static final String F_DROID_KEY = "f-droid"; public static final String EMAIL_KEY = "email"; public static final String REDDIT_ACCOUNT_KEY = "reddit_account"; public static final String SUBREDDIT_KEY = "subreddit"; |