New option: Hide Comment Awards.

This commit is contained in:
Alex Ning 2022-01-21 20:37:31 +08:00
parent e68f8ed4bc
commit f33cf68624
4 changed files with 15 additions and 3 deletions

View File

@ -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);
}

View File

@ -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";

View File

@ -626,6 +626,7 @@
<string name="settings_custom_content_font_family_title">Custom Content Font Family</string>
<string name="settings_fixed_height_preview_in_card_title">Fixed Height in Card</string>
<string name="settings_hide_text_post_content">Hide Text Post Content</string>
<string name="settings_hide_comment_awards_title">Hide Comment Awards</string>
<string name="no_link_available">Cannot get the link</string>

View File

@ -32,4 +32,14 @@
app:key="fully_collapse_comment"
android:title="@string/settings_fully_collapse_comment_title" />
<ml.docilealligator.infinityforreddit.customviews.CustomFontSwitchPreference
app:defaultValue="false"
app:key="fully_collapse_comment"
android:title="@string/settings_fully_collapse_comment_title" />
<ml.docilealligator.infinityforreddit.customviews.CustomFontSwitchPreference
app:defaultValue="false"
app:key="hide_comment_awards"
android:title="@string/settings_hide_comment_awards_title" />
</PreferenceScreen>