mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2024-12-30 21:07:11 +01:00
Prevent inserting read posts into database multiple times when clicking posts.
This commit is contained in:
parent
a4232a54bd
commit
69af53ddba
@ -1880,14 +1880,16 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
}
|
}
|
||||||
|
|
||||||
void markPostRead(Post post) {
|
void markPostRead(Post post) {
|
||||||
post.markAsRead();
|
if (!post.isRead()) {
|
||||||
cardView.setBackgroundTintList(ColorStateList.valueOf(mReadPostCardViewBackgroundColor));
|
post.markAsRead();
|
||||||
titleTextView.setTextColor(mReadPostTitleColor);
|
cardView.setBackgroundTintList(ColorStateList.valueOf(mReadPostCardViewBackgroundColor));
|
||||||
if (this instanceof PostTextTypeViewHolder) {
|
titleTextView.setTextColor(mReadPostTitleColor);
|
||||||
((PostTextTypeViewHolder) this).contentTextView.setTextColor(mReadPostContentColor);
|
if (this instanceof PostTextTypeViewHolder) {
|
||||||
}
|
((PostTextTypeViewHolder) this).contentTextView.setTextColor(mReadPostContentColor);
|
||||||
if (mActivity != null && mActivity instanceof MarkPostAsReadInterface) {
|
}
|
||||||
((MarkPostAsReadInterface) mActivity).markPostAsRead(post);
|
if (mActivity != null && mActivity instanceof MarkPostAsReadInterface) {
|
||||||
|
((MarkPostAsReadInterface) mActivity).markPostAsRead(post);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2933,11 +2935,13 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
}
|
}
|
||||||
|
|
||||||
void markPostRead(Post post) {
|
void markPostRead(Post post) {
|
||||||
post.markAsRead();
|
if (!post.isRead()) {
|
||||||
itemView.setBackgroundColor(mReadPostCardViewBackgroundColor);
|
post.markAsRead();
|
||||||
titleTextView.setTextColor(mReadPostTitleColor);
|
itemView.setBackgroundColor(mReadPostCardViewBackgroundColor);
|
||||||
if (mActivity != null && mActivity instanceof MarkPostAsReadInterface) {
|
titleTextView.setTextColor(mReadPostTitleColor);
|
||||||
((MarkPostAsReadInterface) mActivity).markPostAsRead(post);
|
if (mActivity != null && mActivity instanceof MarkPostAsReadInterface) {
|
||||||
|
((MarkPostAsReadInterface) mActivity).markPostAsRead(post);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user