diff options
author | Docile-Alligator <chineseperson5@gmail.com> | 2022-02-21 07:38:17 +0000 |
---|---|---|
committer | Docile-Alligator <chineseperson5@gmail.com> | 2022-02-21 07:38:17 +0000 |
commit | 3a69e028673181f014630bb68205166dc39ded0a (patch) | |
tree | df6a252ca00ddc9a9183f5072c6010b419a1a9d0 /app/src/main/java | |
parent | 4b3e11c62df47977c9696f4c066d32f14b28e6b3 (diff) | |
download | infinity-for-reddit-3a69e028673181f014630bb68205166dc39ded0a.tar infinity-for-reddit-3a69e028673181f014630bb68205166dc39ded0a.tar.gz infinity-for-reddit-3a69e028673181f014630bb68205166dc39ded0a.tar.bz2 infinity-for-reddit-3a69e028673181f014630bb68205166dc39ded0a.tar.lz infinity-for-reddit-3a69e028673181f014630bb68205166dc39ded0a.tar.xz infinity-for-reddit-3a69e028673181f014630bb68205166dc39ded0a.tar.zst infinity-for-reddit-3a69e028673181f014630bb68205166dc39ded0a.zip |
New option: Settings->Interface->Post Details->Hide Upvote Ratio.
Diffstat (limited to '')
2 files changed, 8 insertions, 1 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java index 954853f1..d64a9d1b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java @@ -166,6 +166,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler private boolean mOnlyDisablePreviewInVideoAndGifPosts; private boolean mHidePostType; private boolean mHidePostFlair; + private boolean mHideUpvoteRatio; private boolean mHideTheNumberOfAwards; private boolean mHideSubredditAndUserPrefix; private boolean mHideTheNumberOfVotes; @@ -353,6 +354,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler mHidePostType = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_POST_TYPE, false); mHidePostFlair = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_POST_FLAIR, false); + mHideUpvoteRatio = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_UPVOTE_RATIO, false); mHideTheNumberOfAwards = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_AWARDS, false); mHideSubredditAndUserPrefix = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_SUBREDDIT_AND_USER_PREFIX, false); mHideTheNumberOfVotes = postDetailsSharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_VOTES, false); @@ -622,7 +624,11 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler Utils.setHTMLWithImageToTextView(((PostDetailBaseViewHolder) holder).mAwardsTextView, mPost.getAwards(), true); } - ((PostDetailBaseViewHolder) holder).mUpvoteRatioTextView.setText(mPost.getUpvoteRatio() + "%"); + if (mHideUpvoteRatio) { + ((PostDetailBaseViewHolder) holder).mUpvoteRatioTextView.setVisibility(View.GONE); + } else { + ((PostDetailBaseViewHolder) holder).mUpvoteRatioTextView.setText(mPost.getUpvoteRatio() + "%"); + } if (mPost.isNSFW()) { ((PostDetailBaseViewHolder) holder).mNSFWTextView.setVisibility(View.VISIBLE); 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 3b166d7f..4ade7642 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -207,6 +207,7 @@ public class SharedPreferencesUtils { public static final String SHOW_FEWER_TOOLBAR_OPTIONS_THRESHOLD = "show_fewer_toolbar_options_threshold"; public static final String SHOW_AUTHOR_AVATAR = "show_author_avatar"; public static final String ALWAYS_SHOW_CHILD_COMMENT_COUNT = "always_show_child_comment_count"; + public static final String HIDE_UPVOTE_RATIO = "hide_upvote_ratio"; public static final String DEFAULT_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit_preferences"; public static final String MAIN_PAGE_TABS_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.main_page_tabs"; |