aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java6
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostDetailsPreferenceFragment.java18
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java2
3 files changed, 26 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java b/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java
index 435969a0..49120eca 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/AppModule.java
@@ -277,6 +277,12 @@ class AppModule {
}
@Provides
+ @Named("post_details")
+ SharedPreferences providePostDetailsSharedPreferences() {
+ return mApplication.getSharedPreferences(SharedPreferencesUtils.POST_DETAILS_SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE);
+ }
+
+ @Provides
@Singleton
CustomThemeWrapper provideCustomThemeWrapper(@Named("light_theme") SharedPreferences lightThemeSharedPreferences,
@Named("dark_theme") SharedPreferences darkThemeSharedPreferences,
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostDetailsPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostDetailsPreferenceFragment.java
new file mode 100644
index 00000000..2e0db830
--- /dev/null
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostDetailsPreferenceFragment.java
@@ -0,0 +1,18 @@
+package ml.docilealligator.infinityforreddit.settings;
+
+import android.os.Bundle;
+
+import androidx.preference.PreferenceFragmentCompat;
+import androidx.preference.PreferenceManager;
+
+import ml.docilealligator.infinityforreddit.R;
+import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils;
+
+public class PostDetailsPreferenceFragment extends PreferenceFragmentCompat {
+ @Override
+ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
+ PreferenceManager preferenceManager = getPreferenceManager();
+ preferenceManager.setSharedPreferencesName(SharedPreferencesUtils.POST_DETAILS_SHARED_PREFERENCES_FILE);
+ setPreferencesFromResource(R.xml.post_details_preferences, rootKey);
+ }
+}
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 470aad37..c1fe0797 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java
@@ -319,6 +319,8 @@ public class SharedPreferencesUtils {
public static final String HIDE_FAVORITE_SUBREDDITS_SECTION = "hide_favorite_subreddits_sections";
public static final String HIDE_SUBSCRIBED_SUBREDDITS_SECTIONS = "hide_subscribed_subreddits_sections";
+ public static final String POST_DETAILS_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.post_details";
+
//Legacy Settings
public static final String MAIN_PAGE_TAB_1_TITLE_LEGACY = "main_page_tab_1_title";
public static final String MAIN_PAGE_TAB_2_TITLE_LEGACY = "main_page_tab_2_title";