From f508132f328286d0c1f08f61e326631e2191ef5e Mon Sep 17 00:00:00 2001 From: Docile-Alligator Date: Fri, 18 Feb 2022 19:48:00 +0800 Subject: New option: Interface->Comment->Always show the number of child comments. Fix notification icon. Tweak the app icon. --- .../adapters/CommentsRecyclerViewAdapter.java | 10 ++++++++-- .../infinityforreddit/utils/SharedPreferencesUtils.java | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/ml') 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 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 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"; -- cgit v1.2.3