diff options
author | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-09-11 23:25:30 +0000 |
---|---|---|
committer | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-09-11 23:25:30 +0000 |
commit | 3c36eff6f57783eb1d57496bb78501f074cbde3c (patch) | |
tree | 29e6b1f4fcd9960f0fd8dd5645f412c980b6f1bc /app/src/main/java/ml | |
parent | e01574d0785e0376f83d588e45d38cb02e71d5a9 (diff) | |
download | infinity-for-reddit-3c36eff6f57783eb1d57496bb78501f074cbde3c.tar infinity-for-reddit-3c36eff6f57783eb1d57496bb78501f074cbde3c.tar.gz infinity-for-reddit-3c36eff6f57783eb1d57496bb78501f074cbde3c.tar.bz2 infinity-for-reddit-3c36eff6f57783eb1d57496bb78501f074cbde3c.tar.lz infinity-for-reddit-3c36eff6f57783eb1d57496bb78501f074cbde3c.tar.xz infinity-for-reddit-3c36eff6f57783eb1d57496bb78501f074cbde3c.tar.zst infinity-for-reddit-3c36eff6f57783eb1d57496bb78501f074cbde3c.zip |
Continue adding Card Layout 3.
Diffstat (limited to 'app/src/main/java/ml')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java | 33 |
1 files changed, 32 insertions, 1 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 bce379ef..26a12c88 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -93,6 +93,7 @@ import ml.docilealligator.infinityforreddit.customtheme.CustomThemeWrapper; import ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView; import ml.docilealligator.infinityforreddit.customviews.LinearLayoutManagerBugFixed; import ml.docilealligator.infinityforreddit.databinding.ItemPostCard2GalleryTypeBinding; +import ml.docilealligator.infinityforreddit.databinding.ItemPostCard3TextBinding; import ml.docilealligator.infinityforreddit.databinding.ItemPostCard3WithPreviewBinding; import ml.docilealligator.infinityforreddit.databinding.ItemPostGalleryGalleryTypeBinding; import ml.docilealligator.infinityforreddit.databinding.ItemPostGalleryTypeBinding; @@ -487,7 +488,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie } else if (viewType == VIEW_TYPE_POST_CARD_GALLERY_TYPE) { return new PostGalleryTypeViewHolder(ItemPostGalleryTypeBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); } else if (viewType == VIEW_TYPE_POST_CARD_TEXT_TYPE) { - return new PostTextTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_text, parent, false)); + //return new PostTextTypeViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_text, parent, false)); + return new PostMaterial3CardTextTypeViewHolder(ItemPostCard3TextBinding.inflate(LayoutInflater.from(parent.getContext()), parent, false)); } else if (viewType == VIEW_TYPE_POST_COMPACT) { if (mShowThumbnailOnTheRightInCompactLayout) { return new PostCompactRightThumbnailViewHolder(LayoutInflater.from(parent.getContext()).inflate(R.layout.item_post_compact_right_thumbnail, parent, false)); @@ -6350,4 +6352,33 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie }; } } + + class PostMaterial3CardTextTypeViewHolder extends PostMaterial3CardBaseViewHolder { + + ItemPostCard3TextBinding binding; + + PostMaterial3CardTextTypeViewHolder(@NonNull ItemPostCard3TextBinding binding) { + super(binding.getRoot()); + this.binding = binding; + setBaseView( + binding.iconGifImageViewItemPostCard3TextType, + binding.subredditNameTextViewItemPostCard3TextType, + binding.userTextViewItemPostCard3TextType, + binding.stickiedPostImageViewItemPostCard3TextType, + binding.postTimeTextViewItemPostCard3TextType, + binding.titleTextViewItemPostCard3TextType, + binding.bottomConstraintLayoutItemPostCard3TextType, + binding.voteButtonToggleItemPostCard3TextType, + binding.upvoteButtonItemPostCard3TextType, + binding.downvoteButtonItemPostCard3TextType, + binding.commentsCountButtonItemPostCard3TextType, + binding.saveButtonItemPostCard3TextType, + binding.shareButtonItemPostCard3TextType); + + if (mActivity.contentTypeface != null) { + binding.contentTextViewItemPostCard3TextType.setTypeface(mActivity.titleTypeface); + } + binding.contentTextViewItemPostCard3TextType.setTextColor(mPostContentColor); + } + } } |