mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-02 14:27:10 +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) {
|
void markPostRead(Post post) {
|
||||||
|
if (!post.isRead()) {
|
||||||
post.markAsRead();
|
post.markAsRead();
|
||||||
cardView.setBackgroundTintList(ColorStateList.valueOf(mReadPostCardViewBackgroundColor));
|
cardView.setBackgroundTintList(ColorStateList.valueOf(mReadPostCardViewBackgroundColor));
|
||||||
titleTextView.setTextColor(mReadPostTitleColor);
|
titleTextView.setTextColor(mReadPostTitleColor);
|
||||||
@ -1891,6 +1892,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class PostVideoAutoplayViewHolder extends PostBaseViewHolder implements ToroPlayer {
|
class PostVideoAutoplayViewHolder extends PostBaseViewHolder implements ToroPlayer {
|
||||||
@BindView(R.id.card_view_item_post_video_type_autoplay)
|
@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) {
|
void markPostRead(Post post) {
|
||||||
|
if (!post.isRead()) {
|
||||||
post.markAsRead();
|
post.markAsRead();
|
||||||
itemView.setBackgroundColor(mReadPostCardViewBackgroundColor);
|
itemView.setBackgroundColor(mReadPostCardViewBackgroundColor);
|
||||||
titleTextView.setTextColor(mReadPostTitleColor);
|
titleTextView.setTextColor(mReadPostTitleColor);
|
||||||
@ -2941,6 +2944,7 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class PostCompactLeftThumbnailViewHolder extends PostCompactBaseViewHolder {
|
class PostCompactLeftThumbnailViewHolder extends PostCompactBaseViewHolder {
|
||||||
@BindView(R.id.icon_gif_image_view_item_post_compact)
|
@BindView(R.id.icon_gif_image_view_item_post_compact)
|
||||||
|
Loading…
Reference in New Issue
Block a user