From 71c055ba64de20f00b09339544f456377edc5f2f Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Sat, 4 Nov 2023 23:31:08 -0400 Subject: Continue deleting awards related components. --- .../adapters/HistoryPostRecyclerViewAdapter.java | 114 +++++---------------- .../adapters/PostDetailRecyclerViewAdapter.java | 30 ------ .../adapters/PostRecyclerViewAdapter.java | 68 +----------- .../customtheme/CustomThemeWrapper.java | 10 -- .../events/ChangeHideTheNumberOfAwardsEvent.java | 9 -- .../fragments/HistoryPostFragment.java | 9 -- .../infinityforreddit/fragments/PostFragment.java | 9 -- .../infinityforreddit/post/Post.java | 26 ----- .../infinityforreddit/postfilter/PostFilter.java | 6 -- .../settings/PostPreferenceFragment.java | 9 -- .../utils/SharedPreferencesUtils.java | 2 +- 11 files changed, 26 insertions(+), 266 deletions(-) delete mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/events/ChangeHideTheNumberOfAwardsEvent.java (limited to 'app/src/main/java/ml/docilealligator/infinityforreddit') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java index 2e6d8850..d306c151 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java @@ -190,8 +190,6 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter 0 && !mHideTheNumberOfAwards) { - ((PostBaseViewHolder) holder).awardsTextView.setVisibility(View.VISIBLE); - if (post.getNAwards() == 1) { - ((PostBaseViewHolder) holder).awardsTextView.setText(mActivity.getString(R.string.one_award)); - } else { - ((PostBaseViewHolder) holder).awardsTextView.setText(mActivity.getString(R.string.n_awards, post.getNAwards())); - } - } - switch (post.getVoteType()) { case 1: //Upvoted @@ -1135,7 +1120,6 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter 0 && !mHideTheNumberOfAwards) { - ((PostCompactBaseViewHolder) holder).awardsTextView.setVisibility(View.VISIBLE); - if (nAwards == 1) { - ((PostCompactBaseViewHolder) holder).awardsTextView.setText(mActivity.getString(R.string.one_award)); - } else { - ((PostCompactBaseViewHolder) holder).awardsTextView.setText(mActivity.getString(R.string.n_awards, nAwards)); - } - } - switch (post.getVoteType()) { case 1: //Upvoted @@ -2221,10 +2196,6 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter 0 && !mHideTheNumberOfAwards) { - ((PostBaseViewHolder) holder).awardsTextView.setVisibility(View.VISIBLE); - if (post.getNAwards() == 1) { - ((PostBaseViewHolder) holder).awardsTextView.setText(mActivity.getString(R.string.one_award)); - } else { - ((PostBaseViewHolder) holder).awardsTextView.setText(mActivity.getString(R.string.n_awards, post.getNAwards())); - } - } - switch (post.getVoteType()) { case 1: //Upvoted @@ -1197,7 +1182,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter 0 && !mHideTheNumberOfAwards) { - ((PostCompactBaseViewHolder) holder).awardsTextView.setVisibility(View.VISIBLE); - if (nAwards == 1) { - ((PostCompactBaseViewHolder) holder).awardsTextView.setText(mActivity.getString(R.string.one_award)); - } else { - ((PostCompactBaseViewHolder) holder).awardsTextView.setText(mActivity.getString(R.string.n_awards, nAwards)); - } - } - switch (post.getVoteType()) { case 1: //Upvoted @@ -2309,10 +2284,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter 0 && post.getNComments() < postFilter.minComments) { return false; } - if (postFilter.maxAwards > 0 && post.getNAwards() > postFilter.maxAwards) { - return false; - } - if (postFilter.minAwards > 0 && post.getNAwards() < postFilter.minAwards) { - return false; - } if (postFilter.onlyNSFW && !post.isNSFW()) { if (postFilter.onlySpoiler) { return post.isSpoiler(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostPreferenceFragment.java index 7f4fe935..af70a9ac 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/PostPreferenceFragment.java @@ -17,7 +17,6 @@ import ml.docilealligator.infinityforreddit.events.ChangeHidePostFlairEvent; import ml.docilealligator.infinityforreddit.events.ChangeHidePostTypeEvent; import ml.docilealligator.infinityforreddit.events.ChangeHideSubredditAndUserPrefixEvent; import ml.docilealligator.infinityforreddit.events.ChangeHideTextPostContent; -import ml.docilealligator.infinityforreddit.events.ChangeHideTheNumberOfAwardsEvent; import ml.docilealligator.infinityforreddit.events.ChangeHideTheNumberOfCommentsEvent; import ml.docilealligator.infinityforreddit.events.ChangeHideTheNumberOfVotesEvent; import ml.docilealligator.infinityforreddit.events.ChangeLongPressToHideToolbarInCompactLayoutEvent; @@ -41,7 +40,6 @@ public class PostPreferenceFragment extends CustomFontPreferenceFragmentCompat { SwitchPreference postCompactLayoutToolbarHiddenByDefaultSwitch = findPreference(SharedPreferencesUtils.POST_COMPACT_LAYOUT_TOOLBAR_HIDDEN_BY_DEFAULT); SwitchPreference hidePostTypeSwitch = findPreference(SharedPreferencesUtils.HIDE_POST_TYPE); SwitchPreference hidePostFlairSwitch = findPreference(SharedPreferencesUtils.HIDE_POST_FLAIR); - SwitchPreference hideTheNumberOfAwardsSwitch = findPreference(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_AWARDS); SwitchPreference hideSubredditAndUserPrefixSwitch = findPreference(SharedPreferencesUtils.HIDE_SUBREDDIT_AND_USER_PREFIX); SwitchPreference hideTheNumberOfVotesSwitch = findPreference(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_VOTES); SwitchPreference hideTheNumberOfCommentsSwitch = findPreference(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_COMMENTS); @@ -111,13 +109,6 @@ public class PostPreferenceFragment extends CustomFontPreferenceFragmentCompat { }); } - if (hideTheNumberOfAwardsSwitch != null) { - hideTheNumberOfAwardsSwitch.setOnPreferenceChangeListener((preference, newValue) -> { - EventBus.getDefault().post(new ChangeHideTheNumberOfAwardsEvent((Boolean) newValue)); - return true; - }); - } - if (hideSubredditAndUserPrefixSwitch != null) { hideSubredditAndUserPrefixSwitch.setOnPreferenceChangeListener((preference, newValue) -> { EventBus.getDefault().post(new ChangeHideSubredditAndUserPrefixEvent((Boolean) newValue)); 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 56900dd3..684d9468 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -178,7 +178,6 @@ 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_POST_FLAIR = "hide_post_flair"; - 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 HIDE_THE_NUMBER_OF_COMMENTS = "hide_the_number_of_comments"; @@ -395,4 +394,5 @@ public class SharedPreferencesUtils { public static final String OPEN_LINK_IN_APP_LEGACY = "open_link_in_app"; public static final String DO_NOT_SHOW_REDDIT_API_INFO_AGAIN_LEGACY = "do_not_show_reddit_api_info_again"; + public static final String HIDE_THE_NUMBER_OF_AWARDS_LEGACY = "hide_the_number_of_awards"; } -- cgit v1.2.3