diff options
author | Alex Ning <chineseperson5@gmail.com> | 2021-10-15 01:04:44 +0000 |
---|---|---|
committer | Alex Ning <chineseperson5@gmail.com> | 2021-10-15 01:04:44 +0000 |
commit | 2fd0e2e0e5af5f61cc8af54f0f96a12affda0d6d (patch) | |
tree | 5ac5ac6e52a662c8648dd695f66d8ce26394b0dc /app/src/main | |
parent | a129c918a0f47ee5fa23f1bdd0578203c431318c (diff) | |
download | infinity-for-reddit-2fd0e2e0e5af5f61cc8af54f0f96a12affda0d6d.tar infinity-for-reddit-2fd0e2e0e5af5f61cc8af54f0f96a12affda0d6d.tar.gz infinity-for-reddit-2fd0e2e0e5af5f61cc8af54f0f96a12affda0d6d.tar.bz2 infinity-for-reddit-2fd0e2e0e5af5f61cc8af54f0f96a12affda0d6d.tar.lz infinity-for-reddit-2fd0e2e0e5af5f61cc8af54f0f96a12affda0d6d.tar.xz infinity-for-reddit-2fd0e2e0e5af5f61cc8af54f0f96a12affda0d6d.tar.zst infinity-for-reddit-2fd0e2e0e5af5f61cc8af54f0f96a12affda0d6d.zip |
Apply custom colors to media indicator.
Diffstat (limited to 'app/src/main')
4 files changed, 24 insertions, 0 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java index 93386ec5..064ede1d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java @@ -186,6 +186,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler private int mArchivedTintColor; private int mLockedTintColor; private int mCrosspostTintColor; + private int mMediaIndicatorIconTint; + private int mMediaIndicatorBackgroundColor; private int mUpvoteRatioTintColor; private int mNoPreviewPostTypeBackgroundColor; private int mNoPreviewPostTypeIconTint; @@ -402,6 +404,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler mArchivedTintColor = customThemeWrapper.getArchivedIconTint(); mLockedTintColor = customThemeWrapper.getLockedIconTint(); mCrosspostTintColor = customThemeWrapper.getCrosspostIconTint(); + mMediaIndicatorIconTint = customThemeWrapper.getMediaIndicatorIconColor(); + mMediaIndicatorBackgroundColor = customThemeWrapper.getMediaIndicatorBackgroundColor(); mUpvoteRatioTintColor = customThemeWrapper.getUpvoteRatioIconTint(); mNoPreviewPostTypeBackgroundColor = customThemeWrapper.getNoPreviewPostTypeBackgroundColor(); mNoPreviewPostTypeIconTint = customThemeWrapper.getNoPreviewPostTypeIconTint(); @@ -1829,6 +1833,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler ProgressBar mLoadImageProgressBar; @BindView(R.id.load_image_error_text_view_item_post_detail_video_and_gif_preview) TextView mLoadImageErrorTextView; + @BindView(R.id.video_or_gif_indicator_image_view_item_post_detail) + ImageView videoOrGifIndicatorImageView; @BindView(R.id.image_view_item_post_detail_video_and_gif_preview) AspectRatioGifImageView mImageView; @BindView(R.id.bottom_constraint_layout_item_post_detail_video_and_gif_preview) @@ -1872,6 +1878,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler mSaveButton, mShareButton); + videoOrGifIndicatorImageView.setColorFilter(mMediaIndicatorIconTint, PorterDuff.Mode.SRC_IN); + videoOrGifIndicatorImageView.setBackgroundTintList(ColorStateList.valueOf(mMediaIndicatorBackgroundColor)); mLoadImageProgressBar.setIndeterminateTintList(ColorStateList.valueOf(mColorAccent)); mLoadImageErrorTextView.setTextColor(mPrimaryTextColor); @@ -2284,6 +2292,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler ProgressBar mLoadImageProgressBar; @BindView(R.id.load_image_error_text_view_item_post_detail_gallery) TextView mLoadImageErrorTextView; + @BindView(R.id.video_or_gif_indicator_image_view_item_post_detail) + ImageView videoOrGifIndicatorImageView; @BindView(R.id.image_view_item_post_detail_gallery) AspectRatioGifImageView mImageView; @BindView(R.id.image_view_no_preview_link_item_post_detail_gallery) @@ -2329,6 +2339,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler mSaveButton, mShareButton); + videoOrGifIndicatorImageView.setColorFilter(mMediaIndicatorIconTint, PorterDuff.Mode.SRC_IN); + videoOrGifIndicatorImageView.setBackgroundTintList(ColorStateList.valueOf(mMediaIndicatorBackgroundColor)); mLoadImageProgressBar.setIndeterminateTintList(ColorStateList.valueOf(mColorAccent)); mLoadImageErrorTextView.setTextColor(mPrimaryTextColor); mNoPreviewPostTypeImageView.setBackgroundColor(mNoPreviewPostTypeBackgroundColor); 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 8ba3c52d..b35eadaf 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -163,6 +163,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie private int mArchivedIconTint; private int mLockedIconTint; private int mCrosspostIconTint; + private int mMediaIndicatorIconTint; + private int mMediaIndicatorBackgroundColor; private int mNoPreviewPostTypeBackgroundColor; private int mNoPreviewPostTypeIconTint; private int mUpvotedColor; @@ -306,6 +308,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie mArchivedIconTint = customThemeWrapper.getArchivedIconTint(); mLockedIconTint = customThemeWrapper.getLockedIconTint(); mCrosspostIconTint = customThemeWrapper.getCrosspostIconTint(); + mMediaIndicatorIconTint = customThemeWrapper.getMediaIndicatorIconColor(); + mMediaIndicatorBackgroundColor = customThemeWrapper.getMediaIndicatorBackgroundColor(); mNoPreviewPostTypeBackgroundColor = customThemeWrapper.getNoPreviewPostTypeBackgroundColor(); mNoPreviewPostTypeIconTint = customThemeWrapper.getNoPreviewPostTypeIconTint(); mUpvotedColor = customThemeWrapper.getUpvoted(); @@ -2924,6 +2928,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie noPreviewLinkImageView.setBackgroundColor(mNoPreviewPostTypeBackgroundColor); noPreviewLinkImageView.setColorFilter(mNoPreviewPostTypeIconTint, android.graphics.PorterDuff.Mode.SRC_IN); progressBar.setIndeterminateTintList(ColorStateList.valueOf(mColorAccent)); + videoOrGifIndicatorImageView.setColorFilter(mMediaIndicatorIconTint, PorterDuff.Mode.SRC_IN); + videoOrGifIndicatorImageView.setBackgroundTintList(ColorStateList.valueOf(mMediaIndicatorBackgroundColor)); errorTextView.setTextColor(mPrimaryTextColor); imageView.setOnClickListener(view -> { @@ -3741,6 +3747,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie progressBar.setIndeterminateTintList(ColorStateList.valueOf(mColorAccent)); noPreviewImageView.setBackgroundColor(mNoPreviewPostTypeBackgroundColor); noPreviewImageView.setColorFilter(mNoPreviewPostTypeIconTint, android.graphics.PorterDuff.Mode.SRC_IN); + videoOrGifIndicatorImageView.setColorFilter(mMediaIndicatorIconTint, PorterDuff.Mode.SRC_IN); + videoOrGifIndicatorImageView.setBackgroundTintList(ColorStateList.valueOf(mMediaIndicatorBackgroundColor)); errorTextView.setTextColor(mPrimaryTextColor); itemView.setOnClickListener(view -> { @@ -4144,6 +4152,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie noPreviewImageView.setBackgroundColor(mNoPreviewPostTypeBackgroundColor); noPreviewImageView.setColorFilter(mNoPreviewPostTypeIconTint, android.graphics.PorterDuff.Mode.SRC_IN); progressBar.setIndeterminateTintList(ColorStateList.valueOf(mColorAccent)); + videoOrGifIndicatorImageView.setColorFilter(mMediaIndicatorIconTint, PorterDuff.Mode.SRC_IN); + videoOrGifIndicatorImageView.setBackgroundTintList(ColorStateList.valueOf(mMediaIndicatorBackgroundColor)); errorTextView.setTextColor(mPrimaryTextColor); divider.setBackgroundColor(mDividerColor); diff --git a/app/src/main/res/layout/item_post_detail_gallery.xml b/app/src/main/res/layout/item_post_detail_gallery.xml index 712a7725..1a345dab 100644 --- a/app/src/main/res/layout/item_post_detail_gallery.xml +++ b/app/src/main/res/layout/item_post_detail_gallery.xml @@ -220,6 +220,7 @@ android:scaleType="fitStart" /> <ImageView + android:id="@+id/video_or_gif_indicator_image_view_item_post_detail" android:layout_width="36dp" android:layout_height="36dp" android:layout_margin="16dp" diff --git a/app/src/main/res/layout/item_post_detail_video_and_gif_preview.xml b/app/src/main/res/layout/item_post_detail_video_and_gif_preview.xml index c2930a41..9ebfe960 100644 --- a/app/src/main/res/layout/item_post_detail_video_and_gif_preview.xml +++ b/app/src/main/res/layout/item_post_detail_video_and_gif_preview.xml @@ -217,6 +217,7 @@ android:scaleType="fitStart" /> <ImageView + android:id="@+id/video_or_gif_indicator_image_view_item_post_detail" android:layout_width="36dp" android:layout_height="36dp" android:layout_margin="16dp" |