Show upvoted or downvoted color in topScoreTextView in CommentViewHolder.

This commit is contained in:
Alex Ning 2020-12-01 14:52:36 +08:00
parent 924128f09a
commit a18c912987

View File

@ -1112,11 +1112,13 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
((CommentViewHolder) holder).upvoteButton ((CommentViewHolder) holder).upvoteButton
.setColorFilter(mUpvotedColor, android.graphics.PorterDuff.Mode.SRC_IN); .setColorFilter(mUpvotedColor, android.graphics.PorterDuff.Mode.SRC_IN);
((CommentViewHolder) holder).scoreTextView.setTextColor(mUpvotedColor); ((CommentViewHolder) holder).scoreTextView.setTextColor(mUpvotedColor);
((CommentViewHolder) holder).topScoreTextView.setTextColor(mUpvotedColor);
break; break;
case Comment.VOTE_TYPE_DOWNVOTE: case Comment.VOTE_TYPE_DOWNVOTE:
((CommentViewHolder) holder).downvoteButton ((CommentViewHolder) holder).downvoteButton
.setColorFilter(mDownvotedColor, android.graphics.PorterDuff.Mode.SRC_IN); .setColorFilter(mDownvotedColor, android.graphics.PorterDuff.Mode.SRC_IN);
((CommentViewHolder) holder).scoreTextView.setTextColor(mDownvotedColor); ((CommentViewHolder) holder).scoreTextView.setTextColor(mDownvotedColor);
((CommentViewHolder) holder).topScoreTextView.setTextColor(mDownvotedColor);
break; break;
} }
@ -3459,12 +3461,14 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
newVoteType = APIUtils.DIR_UPVOTE; newVoteType = APIUtils.DIR_UPVOTE;
upvoteButton.setColorFilter(mUpvotedColor, android.graphics.PorterDuff.Mode.SRC_IN); upvoteButton.setColorFilter(mUpvotedColor, android.graphics.PorterDuff.Mode.SRC_IN);
scoreTextView.setTextColor(mUpvotedColor); scoreTextView.setTextColor(mUpvotedColor);
topScoreTextView.setTextColor(mUpvotedColor);
} else { } else {
//Upvoted before //Upvoted before
comment.setVoteType(Comment.VOTE_TYPE_NO_VOTE); comment.setVoteType(Comment.VOTE_TYPE_NO_VOTE);
newVoteType = APIUtils.DIR_UNVOTE; newVoteType = APIUtils.DIR_UNVOTE;
upvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); upvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
scoreTextView.setTextColor(mCommentIconAndInfoColor); scoreTextView.setTextColor(mCommentIconAndInfoColor);
topScoreTextView.setTextColor(mSecondaryTextColor);
} }
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
@ -3480,10 +3484,12 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
comment.setVoteType(Comment.VOTE_TYPE_UPVOTE); comment.setVoteType(Comment.VOTE_TYPE_UPVOTE);
upvoteButton.setColorFilter(mUpvotedColor, android.graphics.PorterDuff.Mode.SRC_IN); upvoteButton.setColorFilter(mUpvotedColor, android.graphics.PorterDuff.Mode.SRC_IN);
scoreTextView.setTextColor(mUpvotedColor); scoreTextView.setTextColor(mUpvotedColor);
topScoreTextView.setTextColor(mUpvotedColor);
} else { } else {
comment.setVoteType(Comment.VOTE_TYPE_NO_VOTE); comment.setVoteType(Comment.VOTE_TYPE_NO_VOTE);
upvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); upvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
scoreTextView.setTextColor(mCommentIconAndInfoColor); scoreTextView.setTextColor(mCommentIconAndInfoColor);
topScoreTextView.setTextColor(mSecondaryTextColor);
} }
downvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); downvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
@ -3525,12 +3531,14 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
newVoteType = APIUtils.DIR_DOWNVOTE; newVoteType = APIUtils.DIR_DOWNVOTE;
downvoteButton.setColorFilter(mDownvotedColor, android.graphics.PorterDuff.Mode.SRC_IN); downvoteButton.setColorFilter(mDownvotedColor, android.graphics.PorterDuff.Mode.SRC_IN);
scoreTextView.setTextColor(mDownvotedColor); scoreTextView.setTextColor(mDownvotedColor);
topScoreTextView.setTextColor(mDownvotedColor);
} else { } else {
//Downvoted before //Downvoted before
comment.setVoteType(Comment.VOTE_TYPE_NO_VOTE); comment.setVoteType(Comment.VOTE_TYPE_NO_VOTE);
newVoteType = APIUtils.DIR_UNVOTE; newVoteType = APIUtils.DIR_UNVOTE;
downvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); downvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
scoreTextView.setTextColor(mCommentIconAndInfoColor); scoreTextView.setTextColor(mCommentIconAndInfoColor);
topScoreTextView.setTextColor(mSecondaryTextColor);
} }
scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes,
@ -3546,10 +3554,12 @@ public class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<Recy
comment.setVoteType(Comment.VOTE_TYPE_DOWNVOTE); comment.setVoteType(Comment.VOTE_TYPE_DOWNVOTE);
downvoteButton.setColorFilter(mDownvotedColor, android.graphics.PorterDuff.Mode.SRC_IN); downvoteButton.setColorFilter(mDownvotedColor, android.graphics.PorterDuff.Mode.SRC_IN);
scoreTextView.setTextColor(mDownvotedColor); scoreTextView.setTextColor(mDownvotedColor);
topScoreTextView.setTextColor(mDownvotedColor);
} else { } else {
comment.setVoteType(Comment.VOTE_TYPE_NO_VOTE); comment.setVoteType(Comment.VOTE_TYPE_NO_VOTE);
downvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); downvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);
scoreTextView.setTextColor(mCommentIconAndInfoColor); scoreTextView.setTextColor(mCommentIconAndInfoColor);
topScoreTextView.setTextColor(mSecondaryTextColor);
} }
upvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); upvoteButton.setColorFilter(mCommentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN);