diff options
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"; |