aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java30
1 files changed, 17 insertions, 13 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
index dfed1b2d..76df281b 100644
--- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
+++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java
@@ -1880,14 +1880,16 @@ public class PostRecyclerViewAdapter extends PagedListAdapter<Post, RecyclerView
}
void markPostRead(Post post) {
- post.markAsRead();
- cardView.setBackgroundTintList(ColorStateList.valueOf(mReadPostCardViewBackgroundColor));
- titleTextView.setTextColor(mReadPostTitleColor);
- if (this instanceof PostTextTypeViewHolder) {
- ((PostTextTypeViewHolder) this).contentTextView.setTextColor(mReadPostContentColor);
- }
- if (mActivity != null && mActivity instanceof MarkPostAsReadInterface) {
- ((MarkPostAsReadInterface) mActivity).markPostAsRead(post);
+ if (!post.isRead()) {
+ post.markAsRead();
+ cardView.setBackgroundTintList(ColorStateList.valueOf(mReadPostCardViewBackgroundColor));
+ titleTextView.setTextColor(mReadPostTitleColor);
+ if (this instanceof PostTextTypeViewHolder) {
+ ((PostTextTypeViewHolder) this).contentTextView.setTextColor(mReadPostContentColor);
+ }
+ 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) {
- post.markAsRead();
- itemView.setBackgroundColor(mReadPostCardViewBackgroundColor);
- titleTextView.setTextColor(mReadPostTitleColor);
- if (mActivity != null && mActivity instanceof MarkPostAsReadInterface) {
- ((MarkPostAsReadInterface) mActivity).markPostAsRead(post);
+ if (!post.isRead()) {
+ post.markAsRead();
+ itemView.setBackgroundColor(mReadPostCardViewBackgroundColor);
+ titleTextView.setTextColor(mReadPostTitleColor);
+ if (mActivity != null && mActivity instanceof MarkPostAsReadInterface) {
+ ((MarkPostAsReadInterface) mActivity).markPostAsRead(post);
+ }
}
}
}
mit to ViewPager2.OFFSCREEN_PAGE_LIMIT_DEFAULT in some ...Docile-Alligator5-6/+5 2023-10-04Load more items in a single call.Docile-Alligator3-31/+33 2023-10-04Initialize LiveData data by using the constructor, not the postValue method.Docile-Alligator9-37/+21 2023-10-04Set filled card view background color in MaterialYouUtils.Docile-Alligator1-0/+3 2023-10-04Sync subscriptions once every 24 hours.Docile-Alligator2-1/+9 2023-10-01Version 6.3.0-beta2.Docile-Alligator1-2/+2 2023-10-01Fix changing playback speed not working in ViewImgurVideoFragment and ViewRed...Docile-Alligator3-22/+41 2023-10-01Fix video controller ui issues in ViewImgurVideoFragment, ViewRedditGalleryVi...Docile-Alligator3-16/+14 2023-10-01Fix video controller ui issues in ViewImgurVideoFragment, ViewRedditGalleryVi...Docile-Alligator3-22/+30 2023-09-25Version 6.3.0-beta1.Docile-Alligator1-2/+2 2023-09-25Version 6.3.0-beta1. Rename RedditAPIInfoBottomSheetFragment to ImportantInfo...Docile-Alligator3-9/+9 2023-09-23Changed video control UI.Docile-Alligator1-3/+3 2023-09-23Changed video control UI.Docile-Alligator5-48/+69 2023-09-22Start changing video control UI.Docile-Alligator16-108/+193