aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java
diff options
context:
space:
mode:
authorAlex Ning <chineseperson5@gmail.com>2022-01-21 12:37:31 +0000
committerAlex Ning <chineseperson5@gmail.com>2022-01-21 12:37:31 +0000
commitf33cf68624cd69b78605d3f85f6ee649138bd7ad (patch)
tree76a28a950671e9438a592761240084654d3e50ac /app/src/main/java
parente68f8ed4bca78214debc2ffafba7580bebdc63d0 (diff)
downloadinfinity-for-reddit-f33cf68624cd69b78605d3f85f6ee649138bd7ad.tar
infinity-for-reddit-f33cf68624cd69b78605d3f85f6ee649138bd7ad.tar.gz
infinity-for-reddit-f33cf68624cd69b78605d3f85f6ee649138bd7ad.tar.bz2
infinity-for-reddit-f33cf68624cd69b78605d3f85f6ee649138bd7ad.tar.lz
infinity-for-reddit-f33cf68624cd69b78605d3f85f6ee649138bd7ad.tar.xz
infinity-for-reddit-f33cf68624cd69b78605d3f85f6ee649138bd7ad.tar.zst
infinity-for-reddit-f33cf68624cd69b78605d3f85f6ee649138bd7ad.zip
New option: Hide Comment Awards.
Diffstat (limited to 'app/src/main/java')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java6
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java1
2 files changed, 4 insertions, 3 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
index 53edff81..9ea07970 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java
@@ -114,6 +114,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
private boolean mShowAbsoluteNumberOfVotes;
private boolean mFullyCollapseComment;
private boolean mShowOnlyOneCommentLevelIndicator;
+ private boolean mHideCommentAwards;
private CommentRecyclerViewAdapterCallback mCommentRecyclerViewAdapterCallback;
private boolean isInitiallyLoading;
private boolean isInitiallyLoadingFailed;
@@ -233,10 +234,9 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
mSwapTapAndLong = sharedPreferences.getBoolean(SharedPreferencesUtils.SWAP_TAP_AND_LONG_COMMENTS, false);
mShowCommentDivider = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_COMMENT_DIVIDER, false);
mShowAbsoluteNumberOfVotes = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_ABSOLUTE_NUMBER_OF_VOTES, true);
-
mFullyCollapseComment = sharedPreferences.getBoolean(SharedPreferencesUtils.FULLY_COLLAPSE_COMMENT, false);
-
mShowOnlyOneCommentLevelIndicator = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_ONLY_ONE_COMMENT_LEVEL_INDICATOR, false);
+ mHideCommentAwards = sharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_COMMENT_AWARDS, false);
mCommentRecyclerViewAdapterCallback = commentRecyclerViewAdapterCallback;
isInitiallyLoading = true;
@@ -437,7 +437,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi
((CommentViewHolder) holder).topScoreTextView.setVisibility(View.GONE);
}
- if (comment.getAwards() != null && !comment.getAwards().equals("")) {
+ if (!mHideCommentAwards && comment.getAwards() != null && !comment.getAwards().equals("")) {
((CommentViewHolder) holder).awardsTextView.setVisibility(View.VISIBLE);
Utils.setHTMLWithImageToTextView(((CommentViewHolder) holder).awardsTextView, comment.getAwards(), true);
}
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 74dc9a7f..7291de2c 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java
@@ -202,6 +202,7 @@ public class SharedPreferencesUtils {
public static final String PINCH_TO_ZOOM_VIDEO = "pinch_to_zoom_video";
public static final String FIXED_HEIGHT_PREVIEW_IN_CARD = "fixed_height_preview_in_card";
public static final String HIDE_TEXT_POST_CONTENT = "hide_text_post_content";
+ public static final String HIDE_COMMENT_AWARDS = "hide_comment_awards";
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";