Disable marking posts as read if in anonymous mode.

This commit is contained in:
Alex Ning 2020-12-12 00:08:41 +08:00
parent 35ae9c547f
commit 72fd7917af

View File

@ -1936,7 +1936,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
} }
void markPostRead(Post post) { void markPostRead(Post post) {
if (!post.isRead()) { if (mAccessToken != null && !post.isRead()) {
post.markAsRead(); post.markAsRead();
cardView.setBackgroundTintList(ColorStateList.valueOf(mReadPostCardViewBackgroundColor)); cardView.setBackgroundTintList(ColorStateList.valueOf(mReadPostCardViewBackgroundColor));
titleTextView.setTextColor(mReadPostTitleColor); titleTextView.setTextColor(mReadPostTitleColor);
@ -2991,7 +2991,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
} }
void markPostRead(Post post) { void markPostRead(Post post) {
if (!post.isRead()) { if (mAccessToken != null && !post.isRead()) {
post.markAsRead(); post.markAsRead();
itemView.setBackgroundColor(mReadPostCardViewBackgroundColor); itemView.setBackgroundColor(mReadPostCardViewBackgroundColor);
titleTextView.setTextColor(mReadPostTitleColor); titleTextView.setTextColor(mReadPostTitleColor);