diff options
author | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-10-09 13:23:14 +0000 |
---|---|---|
committer | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-10-09 13:23:14 +0000 |
commit | 29237575d7628e5a91c169a76baa6ec45135554b (patch) | |
tree | a46cb1c0096d4d6d8f23b216cc5f91001ef1b8fd /app/src/main | |
parent | 542c1e3c0c7a0a1ebf162d18ea6277d27f596d6c (diff) | |
download | infinity-for-reddit-29237575d7628e5a91c169a76baa6ec45135554b.tar infinity-for-reddit-29237575d7628e5a91c169a76baa6ec45135554b.tar.gz infinity-for-reddit-29237575d7628e5a91c169a76baa6ec45135554b.tar.bz2 infinity-for-reddit-29237575d7628e5a91c169a76baa6ec45135554b.tar.lz infinity-for-reddit-29237575d7628e5a91c169a76baa6ec45135554b.tar.xz infinity-for-reddit-29237575d7628e5a91c169a76baa6ec45135554b.tar.zst infinity-for-reddit-29237575d7628e5a91c169a76baa6ec45135554b.zip |
Update theme preview.
Diffstat (limited to 'app/src/main')
4 files changed, 353 insertions, 439 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ThemePreviewCommentsFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ThemePreviewCommentsFragment.java index 4a6a2780..02e81ac2 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ThemePreviewCommentsFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ThemePreviewCommentsFragment.java @@ -1,100 +1,28 @@ package ml.docilealligator.infinityforreddit.fragments; import android.content.Context; +import android.content.res.ColorStateList; +import android.graphics.drawable.Drawable; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ImageView; -import android.widget.LinearLayout; -import android.widget.TextView; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; -import butterknife.BindView; -import butterknife.ButterKnife; +import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.activities.CustomThemePreviewActivity; import ml.docilealligator.infinityforreddit.customtheme.CustomTheme; -import ml.docilealligator.infinityforreddit.R; +import ml.docilealligator.infinityforreddit.databinding.FragmentThemePreviewCommentsBinding; +import ml.docilealligator.infinityforreddit.utils.Utils; /** * A simple {@link Fragment} subclass. */ public class ThemePreviewCommentsFragment extends Fragment { - @BindView(R.id.linear_layout_theme_preview_comments_fragment) - LinearLayout linearLayout; - @BindView(R.id.vertical_block_theme_preview_comments_fragment) - View verticalBlock; - @BindView(R.id.author_type_image_view_theme_preview_comments_fragment) - ImageView authorTypeImageView; - @BindView(R.id.author_text_view_theme_preview_comments_fragment) - TextView authorTextView; - @BindView(R.id.author_flair_text_view_theme_preview_comments_fragment) - TextView flairTextView; - @BindView(R.id.comment_time_text_view_theme_preview_comments_fragment) - TextView commentTimeTextView; - @BindView(R.id.comment_markdown_view_theme_preview_comments_fragment) - TextView contentTextView; - @BindView(R.id.up_vote_button_theme_preview_comments_fragment) - ImageView upvoteButton; - @BindView(R.id.score_text_view_theme_preview_comments_fragment) - TextView scoreTextView; - @BindView(R.id.down_vote_button_theme_preview_comments_fragment) - ImageView downvoteButton; - @BindView(R.id.more_button_theme_preview_comments_fragment) - ImageView moreButton; - @BindView(R.id.expand_button_theme_preview_comments_fragment) - ImageView expandButton; - @BindView(R.id.save_button_theme_preview_comments_fragment) - ImageView saveButton; - @BindView(R.id.reply_button_theme_preview_comments_fragment) - ImageView replyButton; - @BindView(R.id.divider_theme_preview_comments_fragment) - View divider; - - @BindView(R.id.linear_layout_award_background_theme_preview_comments_fragment) - LinearLayout linearLayoutAwardBackground; - @BindView(R.id.vertical_block_award_background_theme_preview_comments_fragment) - View verticalBlockAwardBackground; - @BindView(R.id.author_type_image_view_award_background_theme_preview_comments_fragment) - ImageView authorTypeImageViewAwardBackground; - @BindView(R.id.author_text_view_award_background_theme_preview_comments_fragment) - TextView authorTextViewAwardBackground; - @BindView(R.id.author_flair_text_view_award_background_theme_preview_comments_fragment) - TextView flairTextViewAwardBackground; - @BindView(R.id.comment_time_text_view_award_background_theme_preview_comments_fragment) - TextView commentTimeTextViewAwardBackground; - @BindView(R.id.comment_markdown_view_award_background_theme_preview_comments_fragment) - TextView contentTextViewAwardBackground; - @BindView(R.id.up_vote_button_award_background_theme_preview_comments_fragment) - ImageView upvoteButtonAwardBackground; - @BindView(R.id.score_text_view_award_background_theme_preview_comments_fragment) - TextView scoreTextViewAwardBackground; - @BindView(R.id.down_vote_button_award_background_theme_preview_comments_fragment) - ImageView downvoteButtonAwardBackground; - @BindView(R.id.more_button_award_background_theme_preview_comments_fragment) - ImageView moreButtonAwardBackground; - @BindView(R.id.expand_button_award_background_theme_preview_comments_fragment) - ImageView expandButtonAwardBackground; - @BindView(R.id.save_button_award_background_theme_preview_comments_fragment) - ImageView saveButtonAwardBackground; - @BindView(R.id.reply_button_award_background_theme_preview_comments_fragment) - ImageView replyButtonAwardBackground; - @BindView(R.id.divider_award_background_theme_preview_comments_fragment) - View dividerAwardBackground; - - @BindView(R.id.linear_layout_fully_collapsed_theme_preview_comments_fragment) - LinearLayout linearLayoutFullyCollapsed; - @BindView(R.id.vertical_block_fully_collapsed_theme_preview_comments_fragment) - View verticalBlockFullyCollapsed; - @BindView(R.id.author_text_view_fully_collapsed_theme_preview_comments_fragment) - TextView authorTextViewFullyCollapsed; - @BindView(R.id.score_text_view_fully_collapsed_theme_preview_comments_fragment) - TextView scoreTextViewFullyCollapsed; - @BindView(R.id.time_text_view_fully_collapsed_theme_preview_comments_fragment) - TextView timeTextViewFullyCollapsed; + private FragmentThemePreviewCommentsBinding binding; private CustomThemePreviewActivity activity; public ThemePreviewCommentsFragment() { @@ -103,65 +31,69 @@ public class ThemePreviewCommentsFragment extends Fragment { @Override - public View onCreateView(LayoutInflater inflater, ViewGroup container, + public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { - View rootView = inflater.inflate(R.layout.fragment_theme_preview_comments, container, false); - ButterKnife.bind(this, rootView); + binding = FragmentThemePreviewCommentsBinding.inflate(inflater, container, false); CustomTheme customTheme = activity.getCustomTheme(); - linearLayout.setBackgroundColor(customTheme.commentBackgroundColor); - authorTypeImageView.setColorFilter(customTheme.moderator, android.graphics.PorterDuff.Mode.SRC_IN); - authorTextView.setTextColor(customTheme.moderator); - commentTimeTextView.setTextColor(customTheme.secondaryTextColor); - contentTextView.setTextColor(customTheme.commentColor); - flairTextView.setTextColor(customTheme.authorFlairTextColor); - divider.setBackgroundColor(customTheme.dividerColor); - upvoteButton.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - scoreTextView.setTextColor(customTheme.commentIconAndInfoColor); - downvoteButton.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - moreButton.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - expandButton.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - saveButton.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - replyButton.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - - linearLayoutAwardBackground.setBackgroundColor(customTheme.awardedCommentBackgroundColor); - authorTypeImageViewAwardBackground.setColorFilter(customTheme.moderator, android.graphics.PorterDuff.Mode.SRC_IN); - authorTextViewAwardBackground.setTextColor(customTheme.moderator); - commentTimeTextViewAwardBackground.setTextColor(customTheme.secondaryTextColor); - contentTextViewAwardBackground.setTextColor(customTheme.commentColor); - flairTextViewAwardBackground.setTextColor(customTheme.authorFlairTextColor); - dividerAwardBackground.setBackgroundColor(customTheme.dividerColor); - upvoteButtonAwardBackground.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - scoreTextViewAwardBackground.setTextColor(customTheme.commentIconAndInfoColor); - downvoteButtonAwardBackground.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - moreButtonAwardBackground.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - expandButtonAwardBackground.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - saveButtonAwardBackground.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - replyButtonAwardBackground.setColorFilter(customTheme.commentIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - - linearLayoutFullyCollapsed.setBackgroundColor(customTheme.fullyCollapsedCommentBackgroundColor); - authorTextViewFullyCollapsed.setTextColor(customTheme.username); - scoreTextViewFullyCollapsed.setTextColor(customTheme.secondaryTextColor); - timeTextViewFullyCollapsed.setTextColor(customTheme.secondaryTextColor); + + Drawable expandDrawable = Utils.getTintedDrawable(activity, R.drawable.ic_expand_more_grey_24dp, customTheme.commentIconAndInfoColor); + + binding.linearLayoutThemePreviewCommentsFragment.setBackgroundColor(customTheme.commentBackgroundColor); + binding.authorTypeImageViewThemePreviewCommentsFragment.setColorFilter(customTheme.moderator, android.graphics.PorterDuff.Mode.SRC_IN); + binding.authorTextViewThemePreviewCommentsFragment.setTextColor(customTheme.moderator); + binding.commentTimeTextViewThemePreviewCommentsFragment.setTextColor(customTheme.secondaryTextColor); + binding.commentMarkdownViewThemePreviewCommentsFragment.setTextColor(customTheme.commentColor); + binding.authorFlairTextViewThemePreviewCommentsFragment.setTextColor(customTheme.authorFlairTextColor); + binding.dividerThemePreviewCommentsFragment.setBackgroundColor(customTheme.dividerColor); + binding.upvoteButtonThemePreviewCommentsFragment.setIconTint(ColorStateList.valueOf(customTheme.commentIconAndInfoColor)); + binding.upvoteButtonThemePreviewCommentsFragment.setTextColor(customTheme.commentIconAndInfoColor); + binding.downvoteButtonThemePreviewCommentsFragment.setIconTint(ColorStateList.valueOf(customTheme.commentIconAndInfoColor)); + binding.moreButtonThemePreviewCommentsFragment.setIconTint(ColorStateList.valueOf(customTheme.commentIconAndInfoColor)); + binding.expandButtonThemePreviewCommentsFragment.setCompoundDrawablesWithIntrinsicBounds(expandDrawable, null, null, null); + binding.saveButtonThemePreviewCommentsFragment.setIconTint(ColorStateList.valueOf(customTheme.commentIconAndInfoColor)); + binding.replyButtonThemePreviewCommentsFragment.setIconTint(ColorStateList.valueOf(customTheme.commentIconAndInfoColor)); + + binding.linearLayoutAwardBackgroundThemePreviewCommentsFragment.setBackgroundColor(customTheme.awardedCommentBackgroundColor); + binding.authorTypeImageViewAwardBackgroundThemePreviewCommentsFragment.setColorFilter(customTheme.moderator, android.graphics.PorterDuff.Mode.SRC_IN); + binding.authorTextViewAwardBackgroundThemePreviewCommentsFragment.setTextColor(customTheme.moderator); + binding.commentTimeTextViewAwardBackgroundThemePreviewCommentsFragment.setTextColor(customTheme.secondaryTextColor); + binding.commentMarkdownViewAwardBackgroundThemePreviewCommentsFragment.setTextColor(customTheme.commentColor); + binding.authorFlairTextViewAwardBackgroundThemePreviewCommentsFragment.setTextColor(customTheme.authorFlairTextColor); + binding.dividerAwardBackgroundThemePreviewCommentsFragment.setBackgroundColor(customTheme.dividerColor); + binding.upvoteButtonAwardBackgroundThemePreviewCommentsFragment.setIconTint(ColorStateList.valueOf(customTheme.commentIconAndInfoColor)); + binding.upvoteButtonAwardBackgroundThemePreviewCommentsFragment.setTextColor(customTheme.commentIconAndInfoColor); + binding.downvoteButtonAwardBackgroundThemePreviewCommentsFragment.setIconTint(ColorStateList.valueOf(customTheme.commentIconAndInfoColor)); + binding.moreButtonAwardBackgroundThemePreviewCommentsFragment.setIconTint(ColorStateList.valueOf(customTheme.commentIconAndInfoColor)); + binding.expandButtonAwardBackgroundThemePreviewCommentsFragment.setCompoundDrawablesWithIntrinsicBounds(expandDrawable, null, null, null); + binding.saveButtonAwardBackgroundThemePreviewCommentsFragment.setIconTint(ColorStateList.valueOf(customTheme.commentIconAndInfoColor)); + binding.replyButtonAwardBackgroundThemePreviewCommentsFragment.setIconTint(ColorStateList.valueOf(customTheme.commentIconAndInfoColor)); + + binding.linearLayoutFullyCollapsedThemePreviewCommentsFragment.setBackgroundColor(customTheme.fullyCollapsedCommentBackgroundColor); + binding.authorTextViewFullyCollapsedThemePreviewCommentsFragment.setTextColor(customTheme.username); + binding.scoreTextViewFullyCollapsedThemePreviewCommentsFragment.setTextColor(customTheme.secondaryTextColor); + binding.timeTextViewFullyCollapsedThemePreviewCommentsFragment.setTextColor(customTheme.secondaryTextColor); if (activity.typeface != null) { - authorTextView.setTypeface(activity.typeface); - commentTimeTextView.setTypeface(activity.typeface); - flairTextView.setTypeface(activity.typeface); - scoreTextView.setTypeface(activity.typeface); - authorTextViewAwardBackground.setTypeface(activity.typeface); - commentTimeTextViewAwardBackground.setTypeface(activity.typeface); - flairTextViewAwardBackground.setTypeface(activity.typeface); - scoreTextViewAwardBackground.setTypeface(activity.typeface); - authorTextViewFullyCollapsed.setTypeface(activity.typeface); - scoreTextViewFullyCollapsed.setTypeface(activity.typeface); - timeTextViewFullyCollapsed.setTypeface(activity.typeface); + binding.authorTextViewThemePreviewCommentsFragment.setTypeface(activity.typeface); + binding.commentTimeTextViewThemePreviewCommentsFragment.setTypeface(activity.typeface); + binding.authorFlairTextViewThemePreviewCommentsFragment.setTypeface(activity.typeface); + binding.upvoteButtonThemePreviewCommentsFragment.setTypeface(activity.typeface); + + binding.authorTextViewAwardBackgroundThemePreviewCommentsFragment.setTypeface(activity.typeface); + binding.commentTimeTextViewAwardBackgroundThemePreviewCommentsFragment.setTypeface(activity.typeface); + binding.authorFlairTextViewAwardBackgroundThemePreviewCommentsFragment.setTypeface(activity.typeface); + binding.upvoteButtonAwardBackgroundThemePreviewCommentsFragment.setTypeface(activity.typeface); + + binding.authorTextViewFullyCollapsedThemePreviewCommentsFragment.setTypeface(activity.typeface); + binding.scoreTextViewFullyCollapsedThemePreviewCommentsFragment.setTypeface(activity.typeface); + binding.timeTextViewFullyCollapsedThemePreviewCommentsFragment.setTypeface(activity.typeface); } if (activity.contentTypeface != null) { - contentTextView.setTypeface(activity.contentTypeface); - contentTextViewAwardBackground.setTypeface(activity.contentTypeface); + binding.commentMarkdownViewThemePreviewCommentsFragment.setTypeface(activity.contentTypeface); + binding.commentMarkdownViewAwardBackgroundThemePreviewCommentsFragment.setTypeface(activity.contentTypeface); } - return rootView; + return binding.getRoot(); } @Override diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ThemePreviewPostsFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ThemePreviewPostsFragment.java index 5b0d9de7..890f38c1 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ThemePreviewPostsFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ThemePreviewPostsFragment.java @@ -8,82 +8,26 @@ import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; -import android.widget.ImageView; -import android.widget.ProgressBar; -import android.widget.TextView; import androidx.annotation.NonNull; import androidx.appcompat.content.res.AppCompatResources; -import androidx.cardview.widget.CardView; import androidx.fragment.app.Fragment; import com.bumptech.glide.Glide; import com.bumptech.glide.request.RequestOptions; -import com.libRG.CustomTextView; -import butterknife.BindView; -import butterknife.ButterKnife; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.activities.CustomThemePreviewActivity; import ml.docilealligator.infinityforreddit.customtheme.CustomTheme; -import ml.docilealligator.infinityforreddit.customviews.AspectRatioGifImageView; +import ml.docilealligator.infinityforreddit.databinding.FragmentThemePreviewPostsBinding; /** * A simple {@link Fragment} subclass. */ public class ThemePreviewPostsFragment extends Fragment { - @BindView(R.id.card_view_theme_preview_posts_fragment) - CardView cardView; - @BindView(R.id.icon_gif_image_view_theme_preview_posts_fragment) - AspectRatioGifImageView iconImageView; - @BindView(R.id.subreddit_name_text_view_theme_preview_posts_fragment) - TextView subredditNameTextView; - @BindView(R.id.user_text_view_theme_preview_posts_fragment) - TextView usernameTextView; - @BindView(R.id.stickied_post_image_view_theme_preview_posts_fragment) - ImageView stickiedPostImageView; - @BindView(R.id.post_time_text_view_best_theme_preview_posts_fragment) - TextView postTimeTextView; - @BindView(R.id.title_text_view_best_theme_preview_posts_fragment) - TextView titleTextView; - @BindView(R.id.content_text_view_theme_preview_posts_fragment) - TextView contentTextView; - @BindView(R.id.type_text_view_theme_preview_posts_fragment) - CustomTextView typeTextView; - @BindView(R.id.spoiler_custom_text_view_theme_preview_posts_fragment) - CustomTextView spoilerTextView; - @BindView(R.id.nsfw_text_view_theme_preview_posts_fragment) - CustomTextView nsfwTextView; - @BindView(R.id.flair_custom_text_view_theme_preview_posts_fragment) - CustomTextView flairTextView; - @BindView(R.id.awards_text_view_theme_preview_posts_fragment) - CustomTextView awardsTextView; - @BindView(R.id.archived_image_view_theme_preview_posts_fragment) - ImageView archivedImageView; - @BindView(R.id.locked_image_view_theme_preview_posts_fragment) - ImageView lockedImageView; - @BindView(R.id.crosspost_image_view_theme_preview_posts_fragment) - ImageView crosspostImageView; - @BindView(R.id.link_text_view_theme_preview_posts_fragment) - TextView linkTextView; - @BindView(R.id.progress_bar_theme_preview_posts_fragment) - ProgressBar progressBar; - @BindView(R.id.image_view_no_preview_link_theme_preview_posts_fragment) - ImageView noPreviewLinkImageView; - @BindView(R.id.plus_button_theme_preview_posts_fragment) - ImageView upvoteButton; - @BindView(R.id.score_text_view_theme_preview_posts_fragment) - TextView scoreTextView; - @BindView(R.id.minus_button_theme_preview_posts_fragment) - ImageView downvoteButton; - @BindView(R.id.comments_count_theme_preview_posts_fragment) - TextView commentsCountTextView; - @BindView(R.id.save_button_theme_preview_posts_fragment) - ImageView saveButton; - @BindView(R.id.share_button_theme_preview_posts_fragment) - ImageView shareButton; + private FragmentThemePreviewPostsBinding binding; private CustomThemePreviewActivity activity; public ThemePreviewPostsFragment() { @@ -94,74 +38,74 @@ public class ThemePreviewPostsFragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { // Inflate the layout for this fragment - View rootView = inflater.inflate(R.layout.fragment_theme_preview_posts, container, false); - ButterKnife.bind(this, rootView); + binding = FragmentThemePreviewPostsBinding.inflate(inflater, container, false); CustomTheme customTheme = activity.getCustomTheme(); - cardView.setBackgroundTintList(ColorStateList.valueOf(customTheme.cardViewBackgroundColor)); + binding.cardViewThemePreviewPostsFragment.setBackgroundTintList(ColorStateList.valueOf(customTheme.cardViewBackgroundColor)); Glide.with(this).load(R.drawable.subreddit_default_icon) .apply(RequestOptions.bitmapTransform(new RoundedCornersTransformation(72, 0))) - .into(iconImageView); - subredditNameTextView.setTextColor(customTheme.subreddit); - usernameTextView.setTextColor(customTheme.username); - postTimeTextView.setTextColor(customTheme.secondaryTextColor); - titleTextView.setTextColor(customTheme.postTitleColor); - contentTextView.setTextColor(customTheme.postContentColor); - stickiedPostImageView.setColorFilter(customTheme.stickiedPostIconTint, PorterDuff.Mode.SRC_IN); - typeTextView.setBackgroundColor(customTheme.postTypeBackgroundColor); - typeTextView.setBorderColor(customTheme.postTypeBackgroundColor); - typeTextView.setTextColor(customTheme.postTypeTextColor); - spoilerTextView.setBackgroundColor(customTheme.spoilerBackgroundColor); - spoilerTextView.setBorderColor(customTheme.spoilerBackgroundColor); - spoilerTextView.setTextColor(customTheme.spoilerTextColor); - nsfwTextView.setBackgroundColor(customTheme.nsfwBackgroundColor); - nsfwTextView.setBorderColor(customTheme.nsfwBackgroundColor); - nsfwTextView.setTextColor(customTheme.nsfwTextColor); - flairTextView.setBackgroundColor(customTheme.flairBackgroundColor); - flairTextView.setBorderColor(customTheme.flairBackgroundColor); - flairTextView.setTextColor(customTheme.flairTextColor); - awardsTextView.setBackgroundColor(customTheme.awardsBackgroundColor); - awardsTextView.setBorderColor(customTheme.awardsBackgroundColor); - awardsTextView.setTextColor(customTheme.awardsTextColor); - archivedImageView.setColorFilter(customTheme.archivedTint, PorterDuff.Mode.SRC_IN); - lockedImageView.setColorFilter(customTheme.lockedIconTint, PorterDuff.Mode.SRC_IN); - crosspostImageView.setColorFilter(customTheme.crosspostIconTint, PorterDuff.Mode.SRC_IN); - linkTextView.setTextColor(customTheme.secondaryTextColor); - progressBar.setIndeterminateTintList(ColorStateList.valueOf(customTheme.colorAccent)); - noPreviewLinkImageView.setBackgroundColor(customTheme.noPreviewPostTypeBackgroundColor); - upvoteButton.setColorFilter(customTheme.postIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - scoreTextView.setTextColor(customTheme.postIconAndInfoColor); - downvoteButton.setColorFilter(customTheme.postIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - commentsCountTextView.setTextColor(customTheme.postIconAndInfoColor); + .into(binding.iconGifImageViewThemePreviewPostsFragment); + binding.subredditNameTextViewThemePreviewPostsFragment.setTextColor(customTheme.subreddit); + binding.userTextViewThemePreviewPostsFragment.setTextColor(customTheme.username); + binding.postTimeTextViewBestThemePreviewPostsFragment.setTextColor(customTheme.secondaryTextColor); + binding.titleTextViewBestThemePreviewPostsFragment.setTextColor(customTheme.postTitleColor); + binding.contentTextViewThemePreviewPostsFragment.setTextColor(customTheme.postContentColor); + binding.stickiedPostImageViewThemePreviewPostsFragment.setColorFilter(customTheme.stickiedPostIconTint, PorterDuff.Mode.SRC_IN); + binding.typeTextViewThemePreviewPostsFragment.setBackgroundColor(customTheme.postTypeBackgroundColor); + binding.typeTextViewThemePreviewPostsFragment.setBorderColor(customTheme.postTypeBackgroundColor); + binding.typeTextViewThemePreviewPostsFragment.setTextColor(customTheme.postTypeTextColor); + binding.spoilerCustomTextViewThemePreviewPostsFragment.setBackgroundColor(customTheme.spoilerBackgroundColor); + binding.spoilerCustomTextViewThemePreviewPostsFragment.setBorderColor(customTheme.spoilerBackgroundColor); + binding.spoilerCustomTextViewThemePreviewPostsFragment.setTextColor(customTheme.spoilerTextColor); + binding.nsfwTextViewThemePreviewPostsFragment.setBackgroundColor(customTheme.nsfwBackgroundColor); + binding.nsfwTextViewThemePreviewPostsFragment.setBorderColor(customTheme.nsfwBackgroundColor); + binding.nsfwTextViewThemePreviewPostsFragment.setTextColor(customTheme.nsfwTextColor); + binding.flairCustomTextViewThemePreviewPostsFragment.setBackgroundColor(customTheme.flairBackgroundColor); + binding.flairCustomTextViewThemePreviewPostsFragment.setBorderColor(customTheme.flairBackgroundColor); + binding.flairCustomTextViewThemePreviewPostsFragment.setTextColor(customTheme.flairTextColor); + binding.awardsTextViewThemePreviewPostsFragment.setBackgroundColor(customTheme.awardsBackgroundColor); + binding.awardsTextViewThemePreviewPostsFragment.setBorderColor(customTheme.awardsBackgroundColor); + binding.awardsTextViewThemePreviewPostsFragment.setTextColor(customTheme.awardsTextColor); + binding.archivedImageViewThemePreviewPostsFragment.setColorFilter(customTheme.archivedTint, PorterDuff.Mode.SRC_IN); + binding.lockedImageViewThemePreviewPostsFragment.setColorFilter(customTheme.lockedIconTint, PorterDuff.Mode.SRC_IN); + binding.crosspostImageViewThemePreviewPostsFragment.setColorFilter(customTheme.crosspostIconTint, PorterDuff.Mode.SRC_IN); + binding.linkTextViewThemePreviewPostsFragment.setTextColor(customTheme.secondaryTextColor); + binding.progressBarThemePreviewPostsFragment.setIndeterminateTintList(ColorStateList.valueOf(customTheme.colorAccent)); + binding.imageViewNoPreviewLinkThemePreviewPostsFragment.setBackgroundColor(customTheme.noPreviewPostTypeBackgroundColor); + binding.upvoteButtonThemePreviewPostsFragment.setIconTint(ColorStateList.valueOf(customTheme.postIconAndInfoColor)); + binding.upvoteButtonThemePreviewPostsFragment.setTextColor(customTheme.postIconAndInfoColor); + binding.downvoteButtonThemePreviewPostsFragment.setIconTint(ColorStateList.valueOf(customTheme.postIconAndInfoColor)); + binding.commentsCountButtonThemePreviewPostsFragment.setTextColor(customTheme.postIconAndInfoColor); Drawable commentIcon = AppCompatResources.getDrawable(activity, R.drawable.ic_comment_grey_24dp); if (commentIcon != null) { commentIcon.setTint(customTheme.postIconAndInfoColor); } - commentsCountTextView.setCompoundDrawablesWithIntrinsicBounds(commentIcon, null, null, null); - saveButton.setColorFilter(customTheme.postIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); - shareButton.setColorFilter(customTheme.postIconAndInfoColor, android.graphics.PorterDuff.Mode.SRC_IN); + binding.commentsCountButtonThemePreviewPostsFragment.setCompoundDrawablesWithIntrinsicBounds(commentIcon, null, null, null); + binding.saveButtonThemePreviewPostsFragment.setIconTint(ColorStateList.valueOf(customTheme.postIconAndInfoColor)); + binding.shareButtonThemePreviewPostsFragment.setIconTint(ColorStateList.valueOf(customTheme.postIconAndInfoColor)); if (activity.typeface != null) { - subredditNameTextView.setTypeface(activity.typeface); - usernameTextView.setTypeface(activity.typeface); - postTimeTextView.setTypeface(activity.typeface); - typeTextView.setTypeface(activity.typeface); - spoilerTextView.setTypeface(activity.typeface); - nsfwTextView.setTypeface(activity.typeface); - flairTextView.setTypeface(activity.typeface); - awardsTextView.setTypeface(activity.typeface); - linkTextView.setTypeface(activity.typeface); - scoreTextView.setTypeface(activity.typeface); - commentsCountTextView.setTypeface(activity.typeface); + binding.subredditNameTextViewThemePreviewPostsFragment.setTypeface(activity.typeface); + binding.userTextViewThemePreviewPostsFragment.setTypeface(activity.typeface); + binding.postTimeTextViewBestThemePreviewPostsFragment.setTypeface(activity.typeface); + binding.typeTextViewThemePreviewPostsFragment.setTypeface(activity.typeface); + binding.spoilerCustomTextViewThemePreviewPostsFragment.setTypeface(activity.typeface); + binding.nsfwTextViewThemePreviewPostsFragment.setTypeface(activity.typeface); + binding.flairCustomTextViewThemePreviewPostsFragment.setTypeface(activity.typeface); + binding.awardsTextViewThemePreviewPostsFragment.setTypeface(activity.typeface); + binding.linkTextViewThemePreviewPostsFragment.setTypeface(activity.typeface); + binding.upvoteButtonThemePreviewPostsFragment.setTypeface(activity.typeface); + binding.commentsCountButtonThemePreviewPostsFragment.setTypeface(activity.typeface); } if (activity.titleTypeface != null) { - titleTextView.setTypeface(activity.titleTypeface); + binding.titleTextViewBestThemePreviewPostsFragment.setTypeface(activity.titleTypeface); } if (activity.contentTypeface != null) { - contentTextView.setTypeface(activity.contentTypeface); + binding.contentTextViewThemePreviewPostsFragment.setTypeface(activity.contentTypeface); } - return rootView; + + return binding.getRoot(); } @Override diff --git a/app/src/main/res/layout/fragment_theme_preview_comments.xml b/app/src/main/res/layout/fragment_theme_preview_comments.xml index 08e24fc1..76c33ecf 100644 --- a/app/src/main/res/layout/fragment_theme_preview_comments.xml +++ b/app/src/main/res/layout/fragment_theme_preview_comments.xml @@ -104,108 +104,123 @@ android:id="@+id/bottom_constraint_layout_theme_preview_comments_fragment" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingBottom="12dp" android:paddingStart="4dp" android:paddingEnd="4dp"> - <ImageView - android:id="@+id/up_vote_button_theme_preview_comments_fragment" - android:layout_width="wrap_content" + <com.google.android.material.button.MaterialButtonToggleGroup + android:id="@+id/vote_button_toggle_theme_preview_comments_fragment" + android:layout_width="0dp" android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_arrow_upward_grey_24dp" + app:singleSelection="true" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent" /> - - <TextView - android:id="@+id/score_text_view_theme_preview_comments_fragment" - android:layout_width="64dp" - android:layout_height="wrap_content" - android:gravity="center" - android:text="1234" - android:textSize="?attr/font_12" - android:textStyle="bold" - android:fontFamily="?attr/font_family" - app:layout_constraintStart_toEndOf="@+id/up_vote_button_theme_preview_comments_fragment" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> - - <ImageView - android:id="@+id/down_vote_button_theme_preview_comments_fragment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_arrow_downward_grey_24dp" - app:layout_constraintStart_toEndOf="@+id/score_text_view_theme_preview_comments_fragment" - app:layout_constraintEnd_toStartOf="@id/more_button_theme_preview_comments_fragment" - app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"> + + <com.google.android.material.button.MaterialButton + style="?attr/materialButtonOutlinedStyle" + android:id="@+id/upvote_button_theme_preview_comments_fragment" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:text="1234" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + android:backgroundTint="#00000000" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialButtonOutlinedStyle" + android:id="@+id/downvote_button_theme_preview_comments_fragment" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + android:backgroundTint="#00000000" /> + + </com.google.android.material.button.MaterialButtonToggleGroup> + + <View + android:id="@+id/placeholder_theme_preview_comments_fragment" + android:layout_width="0dp" + android:layout_height="0dp" + app:layout_constraintWidth_min="1dp" + app:layout_constrainedWidth="true" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintHorizontal_bias="0" /> + app:layout_constraintEnd_toStartOf="@+id/more_button_theme_preview_comments_fragment" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/vote_button_toggle_theme_preview_comments_fragment" + app:layout_constraintTop_toTopOf="parent" /> - <ImageView + <com.google.android.material.button.MaterialButton android:id="@+id/more_button_theme_preview_comments_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_more_vert_grey_24dp" + app:strokeWidth="0dp" + app:icon="@drawable/ic_more_vert_grey_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/expand_button_theme_preview_comments_fragment" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/placeholder_theme_preview_comments_fragment" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> + style="?attr/materialIconButtonOutlinedStyle" /> - <ImageView + <TextView android:id="@+id/expand_button_theme_preview_comments_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" android:background="?actionBarItemBackground" android:clickable="true" android:focusable="true" - android:src="@drawable/ic_expand_less_grey_24dp" + android:fontFamily="?attr/font_family" + android:gravity="center" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:text="890" + android:textSize="?attr/font_default" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/save_button_theme_preview_comments_fragment" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/more_button_theme_preview_comments_fragment" + app:layout_constraintTop_toTopOf="parent" /> - <ImageView + <com.google.android.material.button.MaterialButton android:id="@+id/save_button_theme_preview_comments_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_bookmark_border_grey_24dp" + app:strokeWidth="0dp" + app:icon="@drawable/ic_bookmark_border_grey_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/reply_button_theme_preview_comments_fragment" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/expand_button_theme_preview_comments_fragment" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> + style="?attr/materialIconButtonOutlinedStyle" /> - <ImageView + <com.google.android.material.button.MaterialButton android:id="@+id/reply_button_theme_preview_comments_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_reply_grey_24dp" + app:strokeWidth="0dp" + app:icon="@drawable/ic_reply_grey_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/save_button_theme_preview_comments_fragment" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> + style="?attr/materialIconButtonOutlinedStyle" /> </androidx.constraintlayout.widget.ConstraintLayout> @@ -311,108 +326,123 @@ android:id="@+id/bottom_constraint_layout_award_background_theme_preview_comments_fragment" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingBottom="12dp" android:paddingStart="4dp" android:paddingEnd="4dp"> - <ImageView - android:id="@+id/up_vote_button_award_background_theme_preview_comments_fragment" - android:layout_width="wrap_content" + <com.google.android.material.button.MaterialButtonToggleGroup + android:id="@+id/vote_button_toggle_award_background_theme_preview_comments_fragment" + android:layout_width="0dp" android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_arrow_upward_grey_24dp" + app:singleSelection="true" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent" /> - - <TextView - android:id="@+id/score_text_view_award_background_theme_preview_comments_fragment" - android:layout_width="64dp" - android:layout_height="wrap_content" - android:gravity="center" - android:text="1234" - android:textSize="?attr/font_12" - android:textStyle="bold" - android:fontFamily="?attr/font_family" - app:layout_constraintStart_toEndOf="@+id/up_vote_button_award_background_theme_preview_comments_fragment" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> - - <ImageView - android:id="@+id/down_vote_button_award_background_theme_preview_comments_fragment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_arrow_downward_grey_24dp" - app:layout_constraintStart_toEndOf="@+id/score_text_view_award_background_theme_preview_comments_fragment" - app:layout_constraintEnd_toStartOf="@id/more_button_award_background_theme_preview_comments_fragment" - app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"> + + <com.google.android.material.button.MaterialButton + style="?attr/materialButtonOutlinedStyle" + android:id="@+id/upvote_button_award_background_theme_preview_comments_fragment" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:text="1234" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + android:backgroundTint="#00000000" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialButtonOutlinedStyle" + android:id="@+id/downvote_button_award_background_theme_preview_comments_fragment" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + android:backgroundTint="#00000000" /> + + </com.google.android.material.button.MaterialButtonToggleGroup> + + <View + android:id="@+id/placeholder_award_background_theme_preview_comments_fragment" + android:layout_width="0dp" + android:layout_height="0dp" + app:layout_constraintWidth_min="1dp" + app:layout_constrainedWidth="true" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintHorizontal_bias="0" /> + app:layout_constraintEnd_toStartOf="@+id/more_button_award_background_theme_preview_comments_fragment" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/vote_button_toggle_award_background_theme_preview_comments_fragment" + app:layout_constraintTop_toTopOf="parent" /> - <ImageView + <com.google.android.material.button.MaterialButton android:id="@+id/more_button_award_background_theme_preview_comments_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_more_vert_grey_24dp" + app:strokeWidth="0dp" + app:icon="@drawable/ic_more_vert_grey_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/expand_button_award_background_theme_preview_comments_fragment" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/placeholder_award_background_theme_preview_comments_fragment" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> + style="?attr/materialIconButtonOutlinedStyle" /> - <ImageView + <TextView android:id="@+id/expand_button_award_background_theme_preview_comments_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" android:background="?actionBarItemBackground" android:clickable="true" android:focusable="true" - android:src="@drawable/ic_expand_less_grey_24dp" + android:fontFamily="?attr/font_family" + android:gravity="center" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:text="890" + android:textSize="?attr/font_default" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/save_button_award_background_theme_preview_comments_fragment" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/more_button_award_background_theme_preview_comments_fragment" + app:layout_constraintTop_toTopOf="parent" /> - <ImageView + <com.google.android.material.button.MaterialButton android:id="@+id/save_button_award_background_theme_preview_comments_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_bookmark_border_grey_24dp" + app:strokeWidth="0dp" + app:icon="@drawable/ic_bookmark_border_grey_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toStartOf="@+id/reply_button_award_background_theme_preview_comments_fragment" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/expand_button_award_background_theme_preview_comments_fragment" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> + style="?attr/materialIconButtonOutlinedStyle" /> - <ImageView + <com.google.android.material.button.MaterialButton android:id="@+id/reply_button_award_background_theme_preview_comments_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:src="@drawable/ic_reply_grey_24dp" + app:strokeWidth="0dp" + app:icon="@drawable/ic_reply_grey_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintHorizontal_bias="0.5" + app:layout_constraintStart_toEndOf="@+id/save_button_award_background_theme_preview_comments_fragment" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"/> + style="?attr/materialIconButtonOutlinedStyle" /> </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/layout/fragment_theme_preview_posts.xml b/app/src/main/res/layout/fragment_theme_preview_posts.xml index 9ed975e3..081c22f5 100644 --- a/app/src/main/res/layout/fragment_theme_preview_posts.xml +++ b/app/src/main/res/layout/fragment_theme_preview_posts.xml @@ -237,91 +237,99 @@ app:tint="@android:color/tab_indicator_text" /> <androidx.constraintlayout.widget.ConstraintLayout + android:id="@+id/bottom_constraint_layout_theme_preview_posts_fragment" android:layout_width="match_parent" - android:layout_height="wrap_content"> + android:layout_height="wrap_content" + android:paddingStart="8dp" + android:paddingEnd="8dp"> - <ImageView - android:id="@+id/plus_button_theme_preview_posts_fragment" - android:layout_width="wrap_content" + <com.google.android.material.button.MaterialButtonToggleGroup + android:id="@+id/vote_button_toggle_theme_preview_posts_fragment" + android:layout_width="0dp" android:layout_height="wrap_content" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:padding="12dp" - android:src="@drawable/ic_arrow_upward_grey_24dp" - app:layout_constraintBottom_toBottomOf="parent" + app:singleSelection="true" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" /> - - <TextView - android:id="@+id/score_text_view_theme_preview_posts_fragment" - android:layout_width="64dp" - android:layout_height="wrap_content" - android:gravity="center" - android:text="1234" - android:textSize="?attr/font_12" - android:textStyle="bold" - android:fontFamily="?attr/font_family" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/plus_button_theme_preview_posts_fragment" - app:layout_constraintTop_toTopOf="parent" /> - - <ImageView - android:id="@+id/minus_button_theme_preview_posts_fragment" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:padding="12dp" - android:src="@drawable/ic_arrow_downward_grey_24dp" - app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/score_text_view_theme_preview_posts_fragment" - app:layout_constraintTop_toTopOf="parent" /> - - <TextView - android:id="@+id/comments_count_theme_preview_posts_fragment" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent"> + + <com.google.android.material.button.MaterialButton + style="?attr/materialButtonOutlinedStyle" + android:id="@+id/upvote_button_theme_preview_posts_fragment" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:text="1234" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + android:backgroundTint="#00000000" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialButtonOutlinedStyle" + android:id="@+id/downvote_button_theme_preview_posts_fragment" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + android:backgroundTint="#00000000" /> + + </com.google.android.material.button.MaterialButtonToggleGroup> + + <com.google.android.material.button.MaterialButton + android:id="@+id/comments_count_button_theme_preview_posts_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:drawableStart="@drawable/ic_comment_grey_24dp" - android:drawablePadding="12dp" - android:gravity="center_vertical" - android:padding="12dp" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" android:text="567" android:textSize="?attr/font_12" android:textStyle="bold" android:fontFamily="?attr/font_family" + app:strokeWidth="0dp" + app:icon="@drawable/ic_comment_grey_24dp" + app:iconTint="@null" + app:iconSize="24dp" + app:iconPadding="12dp" + app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/minus_button_theme_preview_posts_fragment" - app:layout_constraintTop_toTopOf="parent" /> + app:layout_constraintStart_toEndOf="@id/vote_button_toggle_theme_preview_posts_fragment" + style="?attr/materialIconButtonOutlinedStyle" /> - <ImageView + <com.google.android.material.button.MaterialButton android:id="@+id/save_button_theme_preview_posts_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:padding="12dp" - android:src="@drawable/ic_bookmark_border_grey_24dp" + app:strokeWidth="0dp" + app:icon="@drawable/ic_bookmark_border_grey_24dp" + app:iconSize="24dp" + app:layout_constraintHorizontal_bias="1" + app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/comments_count_button_theme_preview_posts_fragment" app:layout_constraintEnd_toStartOf="@id/share_button_theme_preview_posts_fragment" - app:layout_constraintHorizontal_bias="1" - app:layout_constraintStart_toEndOf="@id/comments_count_theme_preview_posts_fragment" - app:layout_constraintTop_toTopOf="parent" /> + style="?attr/materialIconButtonOutlinedStyle" /> - <ImageView + <com.google.android.material.button.MaterialButton android:id="@+id/share_button_theme_preview_posts_fragment" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:background="?actionBarItemBackground" - android:clickable="true" - android:focusable="true" - android:padding="12dp" - android:src="@drawable/ic_share_grey_24dp" + app:strokeWidth="0dp" + app:icon="@drawable/ic_share_grey_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" - app:layout_constraintTop_toTopOf="parent" /> + style="?attr/materialIconButtonOutlinedStyle" /> </androidx.constraintlayout.widget.ConstraintLayout> |