From 5c51450a8ebd9a1bbcf39377d639dca0c4994987 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Mon, 3 Sep 2018 16:17:51 +0800 Subject: Fixed a bug that the expand less button and the expand more button is not shown at the right time. --- .../infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/src') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java index ce241a4c..1e46b62f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/CommentMultiLevelRecyclerViewAdapter.java @@ -67,8 +67,8 @@ class CommentMultiLevelRecyclerViewAdapter extends MultiLevelAdapter { @Override public void onClick(View view) { if(commentItem.hasChildren() && commentItem.getChildren().size() > 0) { - setExpandButton(((CommentViewHolder) holder).expandButton, commentItem.isExpanded()); mMultiLevelRecyclerView.toggleItemsGroup(holder.getAdapterPosition()); + setExpandButton(((CommentViewHolder) holder).expandButton, commentItem.isExpanded()); } else { ((CommentViewHolder) holder).loadMoreCommentsProgressBar.setVisibility(View.VISIBLE); FetchComment.fetchComment(subredditNamePrefixed, article, commentItem.getId(), @@ -83,6 +83,8 @@ class CommentMultiLevelRecyclerViewAdapter extends MultiLevelAdapter { ((CommentViewHolder) holder).loadMoreCommentsProgressBar .setVisibility(View.GONE); mMultiLevelRecyclerView.toggleItemsGroup(holder.getAdapterPosition()); + ((CommentViewHolder) holder).expandButton + .setImageResource(R.drawable.ic_expand_less_black_20dp); } @Override -- cgit v1.2.3