Fixed clicking username in comments in user's comment section opening current accout profile. Fixed downvote state would not retain after orientation change. Reverse the color of upvote and downvote buttons.

This commit is contained in:
Alex Ning 2019-09-10 09:23:49 +08:00
parent c50da35b4f
commit f4515514c1
3 changed files with 7 additions and 7 deletions

View File

@ -544,12 +544,12 @@ class CommentAndPostRecyclerViewAdapter extends RecyclerView.Adapter<RecyclerVie
}
switch (comment.getVoteType()) {
case 1:
case CommentData.VOTE_TYPE_UPVOTE:
((CommentViewHolder) holder).upVoteButton
.setColorFilter(ContextCompat.getColor(mActivity, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN);
((CommentViewHolder) holder).scoreTextView.setTextColor(ContextCompat.getColor(mActivity, R.color.upvoted));
break;
case 2:
case CommentData.VOTE_TYPE_DOWNVOTE:
((CommentViewHolder) holder).downVoteButton
.setColorFilter(ContextCompat.getColor(mActivity, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN);
((CommentViewHolder) holder).scoreTextView.setTextColor(ContextCompat.getColor(mActivity, R.color.downvoted));

View File

@ -117,7 +117,7 @@ class CommentsListingRecyclerViewAdapter extends PagedListAdapter<CommentData, R
((DataViewHolder) holder).authorTextView.setTextColor(mTextColorPrimaryDark);
((DataViewHolder) holder).authorTextView.setOnClickListener(view -> {
Intent intent = new Intent(mContext, ViewUserDetailActivity.class);
intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, comment.getAuthor());
intent.putExtra(ViewUserDetailActivity.EXTRA_USER_NAME_KEY, comment.getLinkAuthor());
mContext.startActivity(intent);
});
} else {
@ -137,12 +137,12 @@ class CommentsListingRecyclerViewAdapter extends PagedListAdapter<CommentData, R
((DataViewHolder) holder).scoreTextView.setText(Integer.toString(comment.getScore() + comment.getVoteType()));
switch (comment.getVoteType()) {
case 1:
case CommentData.VOTE_TYPE_UPVOTE:
((DataViewHolder) holder).upvoteButton
.setColorFilter(ContextCompat.getColor(mContext, R.color.upvoted), android.graphics.PorterDuff.Mode.SRC_IN);
((DataViewHolder) holder).scoreTextView.setTextColor(ContextCompat.getColor(mContext, R.color.upvoted));
break;
case 2:
case CommentData.VOTE_TYPE_DOWNVOTE:
((DataViewHolder) holder).downvoteButton
.setColorFilter(ContextCompat.getColor(mContext, R.color.downvoted), android.graphics.PorterDuff.Mode.SRC_IN);
((DataViewHolder) holder).scoreTextView.setTextColor(ContextCompat.getColor(mContext, R.color.downvoted));

View File

@ -28,9 +28,9 @@
<color name="roundedBottomSheetPrimaryNavigationBarColor">@color/roundedBottomSheetPrimaryBackground</color>
<color name="upvoted">#007DDE</color>
<color name="upvoted">#E91E63</color>
<color name="downvoted">#E91E63</color>
<color name="downvoted">#007DDE</color>
<color name="voteAndReplyUnavailableVoteButtonColor">#F0F0F0</color>