diff options
author | Docile-Alligator <chineseperson5@gmail.com> | 2022-02-18 11:48:00 +0000 |
---|---|---|
committer | Docile-Alligator <chineseperson5@gmail.com> | 2022-02-18 11:48:00 +0000 |
commit | f508132f328286d0c1f08f61e326631e2191ef5e (patch) | |
tree | bbcc89b2d508160a6c0f42077b863a98843110d6 /app/src/main/java/ml | |
parent | b933c9d08b6c1e3517313094cc92a443e9403bec (diff) | |
download | infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.tar infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.tar.gz infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.tar.bz2 infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.tar.lz infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.tar.xz infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.tar.zst infinity-for-reddit-f508132f328286d0c1f08f61e326631e2191ef5e.zip |
New option: Interface->Comment->Always show the number of child comments. Fix notification icon. Tweak the app icon.
Diffstat (limited to 'app/src/main/java/ml')
2 files changed, 9 insertions, 2 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 90626e4d..cbb15ce6 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/CommentsRecyclerViewAdapter.java @@ -116,6 +116,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi private boolean mShowOnlyOneCommentLevelIndicator; private boolean mHideCommentAwards; private boolean mShowAuthorAvatar; + private boolean mAlwaysShowChildCommentCount; private int mDepthThreshold; private CommentRecyclerViewAdapterCallback mCommentRecyclerViewAdapterCallback; private boolean isInitiallyLoading; @@ -239,6 +240,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi mShowOnlyOneCommentLevelIndicator = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_ONLY_ONE_COMMENT_LEVEL_INDICATOR, false); mHideCommentAwards = sharedPreferences.getBoolean(SharedPreferencesUtils.HIDE_COMMENT_AWARDS, false); mShowAuthorAvatar = sharedPreferences.getBoolean(SharedPreferencesUtils.SHOW_AUTHOR_AVATAR, false); + mAlwaysShowChildCommentCount = sharedPreferences.getBoolean(SharedPreferencesUtils.ALWAYS_SHOW_CHILD_COMMENT_COUNT, false); mDepthThreshold = sharedPreferences.getInt(SharedPreferencesUtils.SHOW_FEWER_TOOLBAR_OPTIONS_THRESHOLD, 5); mCommentRecyclerViewAdapterCallback = commentRecyclerViewAdapterCallback; @@ -463,7 +465,7 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi } if (comment.hasReply()) { - if (comment.getChildCount() > 0 && !comment.isExpanded()) { + if (comment.getChildCount() > 0 && (mAlwaysShowChildCommentCount || !comment.isExpanded())) { ((CommentViewHolder) holder).expandButton.setText("+" + comment.getChildCount()); } if (comment.isExpanded()) { @@ -1550,7 +1552,11 @@ public class CommentsRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVi } else { notifyItemRangeInserted(commentPosition + 1, newList.size()); } - expandButton.setText(""); + if (mAlwaysShowChildCommentCount && comment.getChildCount() > 0) { + expandButton.setText("+" + comment.getChildCount()); + } else { + expandButton.setText(""); + } expandButton.setCompoundDrawablesWithIntrinsicBounds(collapseDrawable, null, null, null); } } 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 803ca8ef..3b166d7f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -206,6 +206,7 @@ public class SharedPreferencesUtils { public static final String HIDE_COMMENT_AWARDS = "hide_comment_awards"; 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 DEFAULT_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit_preferences"; public static final String MAIN_PAGE_TABS_SHARED_PREFERENCES_FILE = "ml.docilealligator.infinityforreddit.main_page_tabs"; |