diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java index 87025e50..46f3f7d9 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -210,6 +210,8 @@ public class PostRecyclerViewAdapter extends PagedListAdapter { @@ -89,5 +93,19 @@ public class PostPreferenceFragment extends PreferenceFragmentCompat { return true; }); } + + if (hideSubredditAndUserPrefixSwitch != null) { + hideSubredditAndUserPrefixSwitch.setOnPreferenceChangeListener((preference, newValue) -> { + EventBus.getDefault().post(new ChangeHideSubredditAndUserPrefixEvent((Boolean) newValue)); + return true; + }); + } + + if (hideTheNumberOfVotesSwitch != null) { + hideTheNumberOfVotesSwitch.setOnPreferenceChangeListener((preference, newValue) -> { + EventBus.getDefault().post(new ChangeHideTheNumberOfVotesEvent((Boolean) newValue)); + return true; + }); + } } } \ No newline at end of file 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 965f8145..abef106a 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -165,6 +165,8 @@ public class SharedPreferencesUtils { public static final String CLICK_TO_SHOW_MEDIA_IN_GALLERY_LAYOUT = "click_to_show_media_in_gallery_layout"; public static final String HIDE_POST_TYPE = "hide_post_type"; public static final String HIDE_THE_NUMBER_OF_AWARDS = "hide_the_number_of_awards"; + public static final String HIDE_SUBREDDIT_AND_USER_PREFIX = "hide_subreddit_and_user_prefix"; + public static final String HIDE_THE_NUMBER_OF_VOTES = "hide_the_number_of_votes"; 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/layout/fragment_post_layot_bottom_sheet.xml b/app/src/main/res/layout/fragment_post_layot_bottom_sheet.xml index 3cf40d28..e42263a0 100644 --- a/app/src/main/res/layout/fragment_post_layot_bottom_sheet.xml +++ b/app/src/main/res/layout/fragment_post_layot_bottom_sheet.xml @@ -28,6 +28,22 @@ android:textSize="?attr/font_default" android:fontFamily="?attr/font_family" /> + + - - \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 97c0a842..92097b7c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -537,6 +537,8 @@ Click to Show Media in Gallery Layout Hide Post Type Hide the Number of Awards + Hide Subreddit and User Prefix + Hide the Number of Votes Cannot get the link @@ -1024,7 +1026,7 @@ Having Trouble Login Do you want to try another way to login? - - Hello blank fragment + + Vote diff --git a/app/src/main/res/xml/post_preferences.xml b/app/src/main/res/xml/post_preferences.xml index bafe60fd..c695d63c 100644 --- a/app/src/main/res/xml/post_preferences.xml +++ b/app/src/main/res/xml/post_preferences.xml @@ -24,6 +24,16 @@ app:key="hide_the_number_of_awards" app:title="@string/settings_hide_the_number_of_awards" /> + + + +