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,6 +1880,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
||||
}
|
||||
|
||||
void markPostRead(Post post) {
|
||||
if (!post.isRead()) {
|
||||
post.markAsRead();
|
||||
cardView.setBackgroundTintList(ColorStateList.valueOf(mReadPostCardViewBackgroundColor));
|
||||
titleTextView.setTextColor(mReadPostTitleColor);
|
||||
@ -1891,6 +1892,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class PostVideoAutoplayViewHolder extends PostBaseViewHolder implements ToroPlayer {
|
||||
@BindView(R.id.card_view_item_post_video_type_autoplay)
|
||||
@ -2933,6 +2935,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
||||
}
|
||||
|
||||
void markPostRead(Post post) {
|
||||
if (!post.isRead()) {
|
||||
post.markAsRead();
|
||||
itemView.setBackgroundColor(mReadPostCardViewBackgroundColor);
|
||||
titleTextView.setTextColor(mReadPostTitleColor);
|
||||
@ -2941,6 +2944,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class PostCompactLeftThumbnailViewHolder extends PostCompactBaseViewHolder {
|
||||
@BindView(R.id.icon_gif_image_view_item_post_compact)
|
||||
|
Loading…
Reference in New Issue
Block a user