diff options
28 files changed, 1452 insertions, 1295 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java index 680ba84a..bf1c24c9 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java @@ -51,7 +51,6 @@ import com.google.android.exoplayer2.ui.DefaultTimeBar; import com.google.android.exoplayer2.ui.PlayerView; import com.google.android.exoplayer2.ui.TimeBar; import com.google.android.material.button.MaterialButton; -import com.google.android.material.button.MaterialButtonToggleGroup; import com.google.common.collect.ImmutableList; import com.libRG.CustomTextView; @@ -696,9 +695,9 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ((PostBaseViewHolder) holder).titleTextView.setText(post.getTitle()); if (!mHideTheNumberOfVotes) { - ((PostBaseViewHolder) holder).upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + ((PostBaseViewHolder) holder).scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } else { - ((PostBaseViewHolder) holder).upvoteButton.setText(mActivity.getString(R.string.vote)); + ((PostBaseViewHolder) holder).scoreTextView.setText(mActivity.getString(R.string.vote)); } if (post.isLocked()) { @@ -734,14 +733,15 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy switch (post.getVoteType()) { case 1: //Upvoted - ((PostBaseViewHolder) holder).upvoteButton.setTextColor(mUpvotedColor); ((PostBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); ((PostBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + ((PostBaseViewHolder) holder).scoreTextView.setTextColor(mUpvotedColor); break; case -1: //Downvoted ((PostBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); ((PostBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + ((PostBaseViewHolder) holder).scoreTextView.setTextColor(mDownvotedColor); break; } @@ -753,8 +753,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (post.isArchived()) { ((PostBaseViewHolder) holder).archivedImageView.setVisibility(View.VISIBLE); - ((PostBaseViewHolder) holder).upvoteButton.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); + ((PostBaseViewHolder) holder).scoreTextView.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); } @@ -1279,9 +1279,9 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ((PostCompactBaseViewHolder) holder).titleTextView.setText(title); if (!mHideTheNumberOfVotes) { - ((PostCompactBaseViewHolder) holder).upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + ((PostCompactBaseViewHolder) holder).scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } else { - ((PostCompactBaseViewHolder) holder).upvoteButton.setText(mActivity.getString(R.string.vote)); + ((PostCompactBaseViewHolder) holder).scoreTextView.setText(mActivity.getString(R.string.vote)); } if (post.isLocked()) { @@ -1317,14 +1317,15 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy switch (post.getVoteType()) { case 1: //Upvoted - ((PostCompactBaseViewHolder) holder).upvoteButton.setTextColor(mUpvotedColor); ((PostCompactBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); ((PostCompactBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + ((PostCompactBaseViewHolder) holder).scoreTextView.setTextColor(mUpvotedColor); break; case -1: //Downvoted ((PostCompactBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); ((PostCompactBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + ((PostCompactBaseViewHolder) holder).scoreTextView.setTextColor(mDownvotedColor); break; } @@ -1349,8 +1350,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (isArchived) { ((PostCompactBaseViewHolder) holder).archivedImageView.setVisibility(View.VISIBLE); - ((PostCompactBaseViewHolder) holder).upvoteButton.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostCompactBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); + ((PostCompactBaseViewHolder) holder).scoreTextView.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostCompactBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); } @@ -1748,23 +1749,23 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ((PostMaterial3CardBaseViewHolder) holder).titleTextView.setText(post.getTitle()); if (!mHideTheNumberOfVotes) { - ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + ((PostMaterial3CardBaseViewHolder) holder).scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } else { - ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setText(mActivity.getString(R.string.vote)); + ((PostMaterial3CardBaseViewHolder) holder).scoreTextView.setText(mActivity.getString(R.string.vote)); } switch (post.getVoteType()) { case 1: //Upvoted - ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setTextColor(mUpvotedColor); ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + ((PostMaterial3CardBaseViewHolder) holder).scoreTextView.setTextColor(mUpvotedColor); break; case -1: //Downvoted - ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setTextColor(mDownvotedColor); ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + ((PostMaterial3CardBaseViewHolder) holder).scoreTextView.setTextColor(mDownvotedColor); break; } @@ -1774,8 +1775,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy } if (post.isArchived()) { - ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); + ((PostMaterial3CardBaseViewHolder) holder).scoreTextView.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); } @@ -2335,9 +2336,9 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ((PostBaseViewHolder) holder).flairTextView.setVisibility(View.GONE); ((PostBaseViewHolder) holder).awardsTextView.setText(""); ((PostBaseViewHolder) holder).awardsTextView.setVisibility(View.GONE); - ((PostBaseViewHolder) holder).upvoteButton.setTextColor(mPostIconAndInfoColor); ((PostBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); ((PostBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + ((PostBaseViewHolder) holder).scoreTextView.setTextColor(mPostIconAndInfoColor); ((PostBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); ((PostBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); } else if (holder instanceof PostCompactBaseViewHolder) { @@ -2361,9 +2362,9 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ((PostCompactBaseViewHolder) holder).imageView.setVisibility(View.GONE); ((PostCompactBaseViewHolder) holder).playButtonImageView.setVisibility(View.GONE); ((PostCompactBaseViewHolder) holder).noPreviewPostImageFrameLayout.setVisibility(View.GONE); - ((PostCompactBaseViewHolder) holder).upvoteButton.setTextColor(mPostIconAndInfoColor); ((PostCompactBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); ((PostCompactBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + ((PostCompactBaseViewHolder) holder).scoreTextView.setTextColor(mPostIconAndInfoColor); ((PostCompactBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); ((PostCompactBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); } else if (holder instanceof PostGalleryViewHolder) { @@ -2419,10 +2420,9 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy mGlide.clear(((PostMaterial3CardBaseViewHolder) holder).iconGifImageView); ((PostMaterial3CardBaseViewHolder) holder).stickiedPostImageView.setVisibility(View.GONE); - ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setTextColor(mPostIconAndInfoColor); ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); - ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setTextColor(mPostIconAndInfoColor); + ((PostMaterial3CardBaseViewHolder) holder).scoreTextView.setTextColor(mPostIconAndInfoColor); ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); } @@ -2588,6 +2588,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy CustomTextView awardsTextView; ConstraintLayout bottomConstraintLayout; MaterialButton upvoteButton; + TextView scoreTextView; MaterialButton downvoteButton; MaterialButton commentsCountButton; MaterialButton saveButton; @@ -2616,8 +2617,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy CustomTextView flairTextView, CustomTextView awardsTextView, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -2638,6 +2639,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy this.awardsTextView = awardsTextView; this.bottomConstraintLayout = bottomConstraintLayout; this.upvoteButton = upvoteButton; + this.scoreTextView = scoreTextView; this.downvoteButton = downvoteButton; this.commentsCountButton = commentsCountButton; this.saveButton = saveButton; @@ -2646,10 +2648,14 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (mVoteButtonsOnTheRight) { ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(bottomConstraintLayout); - constraintSet.clear(voteButtonToggleGroup.getId(), ConstraintSet.START); + constraintSet.clear(upvoteButton.getId(), ConstraintSet.START); + constraintSet.clear(scoreTextView.getId(), ConstraintSet.START); + constraintSet.clear(downvoteButton.getId(), ConstraintSet.START); constraintSet.clear(saveButton.getId(), ConstraintSet.END); constraintSet.clear(shareButton.getId(), ConstraintSet.END); - constraintSet.connect(voteButtonToggleGroup.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); + constraintSet.connect(upvoteButton.getId(), ConstraintSet.END, scoreTextView.getId(), ConstraintSet.START); + constraintSet.connect(scoreTextView.getId(), ConstraintSet.END, downvoteButton.getId(), ConstraintSet.START); + constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); constraintSet.connect(commentsCountButton.getId(), ConstraintSet.START, saveButton.getId(), ConstraintSet.END); constraintSet.connect(commentsCountButton.getId(), ConstraintSet.END, upvoteButton.getId(), ConstraintSet.START); constraintSet.connect(saveButton.getId(), ConstraintSet.START, shareButton.getId(), ConstraintSet.END); @@ -2673,7 +2679,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy nsfwTextView.setTypeface(mActivity.typeface); flairTextView.setTypeface(mActivity.typeface); awardsTextView.setTypeface(mActivity.typeface); - upvoteButton.setTypeface(mActivity.typeface); + scoreTextView.setTypeface(mActivity.typeface); commentsCountButton.setTypeface(mActivity.typeface); } if (mActivity.titleTypeface != null) { @@ -2704,7 +2710,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy lockedImageView.setColorFilter(mLockedIconTint, PorterDuff.Mode.SRC_IN); crosspostImageView.setColorFilter(mCrosspostIconTint, PorterDuff.Mode.SRC_IN); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); - upvoteButton.setTextColor(mPostIconAndInfoColor); + scoreTextView.setTextColor(mPostIconAndInfoColor); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); commentsCountButton.setTextColor(mPostIconAndInfoColor); commentsCountButton.setIcon(mCommentIcon); @@ -2844,6 +2850,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy int previousUpvoteButtonTextColor = upvoteButton.getCurrentTextColor(); int previousDownvoteButtonTextColor = downvoteButton.getCurrentTextColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); @@ -2857,20 +2864,20 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy //Not upvoted before post.setVoteType(1); newVoteType = APIUtils.DIR_UPVOTE; - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } else { //Upvoted before post.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() { @@ -2880,16 +2887,16 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (newVoteType.equals(APIUtils.DIR_UPVOTE)) { post.setVoteType(1); if (currentPosition == position) { - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } } else { post.setVoteType(0); if (currentPosition == position) { - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } } @@ -2897,7 +2904,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } } @@ -2910,11 +2917,11 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy post.setVoteType(previousVoteType); if (getBindingAdapterPosition() == position) { if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); } @@ -2925,6 +2932,10 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy } }); + scoreTextView.setOnClickListener(view -> { + upvoteButton.performClick(); + }); + downvoteButton.setOnClickListener(view -> { int position = getBindingAdapterPosition(); if (position < 0) { @@ -2943,6 +2954,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy } int previousUpvoteButtonTextColor = upvoteButton.getTextColors().getDefaultColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); int previousDownvoteButtonTextColor = downvoteButton.getTextColors().getDefaultColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); @@ -2950,7 +2962,6 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy int previousVoteType = post.getVoteType(); String newVoteType; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); @@ -2960,16 +2971,18 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy newVoteType = APIUtils.DIR_DOWNVOTE; downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } else { //Downvoted before post.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() { @@ -2981,21 +2994,22 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (currentPosition == position) { downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } } else { post.setVoteType(0); if (currentPosition == position) { downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } } if (currentPosition == position) { - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } } @@ -3008,11 +3022,11 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy post.setVoteType(previousVoteType); if (getBindingAdapterPosition() == position) { if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); } @@ -3127,8 +3141,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy CustomTextView flairTextView, CustomTextView awardsTextView, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -3138,7 +3152,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy setBaseView(iconGifImageView, subredditTextView, userTextView, stickiedPostImageView, postTimeTextView, titleTextView, typeTextView, archivedImageView, lockedImageView, crosspostImageView, nsfwTextView, spoilerTextView, flairTextView, awardsTextView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, downvoteButton, commentsCountButton, saveButton, shareButton); + upvoteButton, scoreTextView, downvoteButton, commentsCountButton, saveButton, shareButton); } } @@ -3186,8 +3200,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ImageView playButton, DefaultTimeBar progressBar, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -3209,8 +3223,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy flairTextView, awardsTextView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, + scoreTextView, downvoteButton, commentsCountButton, saveButton, @@ -3474,8 +3488,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.getRoot().findViewById(R.id.exo_play), binding.getRoot().findViewById(R.id.exo_progress), binding.bottomConstraintLayoutItemPostVideoTypeAutoplay, - binding.voteButtonToggleItemPostVideoTypeAutoplay, binding.upvoteButtonItemPostVideoTypeAutoplay, + binding.scoreTextViewItemPostVideoTypeAutoplay, binding.downvoteButtonItemPostVideoTypeAutoplay, binding.commentsCountButtonItemPostVideoTypeAutoplay, binding.saveButtonItemPostVideoTypeAutoplay, @@ -3510,8 +3524,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.getRoot().findViewById(R.id.exo_play), binding.getRoot().findViewById(R.id.exo_progress), binding.bottomConstraintLayoutItemPostVideoTypeAutoplay, - binding.voteButtonToggleItemPostVideoTypeAutoplay, binding.upvoteButtonItemPostVideoTypeAutoplay, + binding.scoreTextViewItemPostVideoTypeAutoplay, binding.downvoteButtonItemPostVideoTypeAutoplay, binding.commentsCountButtonItemPostVideoTypeAutoplay, binding.saveButtonItemPostVideoTypeAutoplay, @@ -3542,8 +3556,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.flairCustomTextViewItemPostWithPreview, binding.awardsTextViewItemPostWithPreview, binding.bottomConstraintLayoutItemPostWithPreview, - binding.voteButtonToggleItemPostWithPreview, binding.upvoteButtonItemPostWithPreview, + binding.scoreTextViewItemPostWithPreview, binding.downvoteButtonItemPostWithPreview, binding.commentsCountButtonItemPostWithPreview, binding.saveButtonItemPostWithPreview, @@ -3629,8 +3643,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy CustomTextView imageIndexTextView, ImageView noPreviewImageView, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -3653,8 +3667,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy flairTextView, awardsTextView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, + scoreTextView, downvoteButton, commentsCountButton, saveButton, @@ -3805,8 +3819,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.imageIndexTextViewItemPostGalleryType, binding.noPreviewImageViewItemPostGalleryType, binding.bottomConstraintLayoutItemPostGalleryType, - binding.voteButtonToggleItemPostGalleryType, binding.upvoteButtonItemPostGalleryType, + binding.scoreTextViewItemPostGalleryType, binding.downvoteButtonItemPostGalleryType, binding.commentsCountButtonItemPostGalleryType, binding.saveButtonItemPostGalleryType, @@ -3838,8 +3852,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.flairCustomTextViewItemPostTextType, binding.awardsTextViewItemPostTextType, binding.bottomConstraintLayoutItemPostTextType, - binding.voteButtonToggleItemPostTextType, binding.upvoteButtonItemPostTextType, + binding.scoreTextViewItemPostTextType, binding.downvoteButtonItemPostTextType, binding.commentsCountButtonItemPostTextType, binding.saveButtonItemPostTextType, @@ -3877,6 +3891,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy Barrier imageBarrier; ConstraintLayout bottomConstraintLayout; MaterialButton upvoteButton; + TextView scoreTextView; MaterialButton downvoteButton; MaterialButton commentsCountButton; MaterialButton saveButton; @@ -3912,8 +3927,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ImageView noPreviewLinkImageView, Barrier imageBarrier, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -3943,6 +3958,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy this.imageBarrier = imageBarrier; this.bottomConstraintLayout = bottomConstraintLayout; this.upvoteButton = upvoteButton; + this.scoreTextView = scoreTextView; this.downvoteButton = downvoteButton; this.commentsCountButton = commentsCountButton; this.saveButton = saveButton; @@ -3952,10 +3968,14 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (mVoteButtonsOnTheRight) { ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(bottomConstraintLayout); - constraintSet.clear(voteButtonToggleGroup.getId(), ConstraintSet.START); + constraintSet.clear(upvoteButton.getId(), ConstraintSet.START); + constraintSet.clear(scoreTextView.getId(), ConstraintSet.START); + constraintSet.clear(downvoteButton.getId(), ConstraintSet.START); constraintSet.clear(saveButton.getId(), ConstraintSet.END); constraintSet.clear(shareButton.getId(), ConstraintSet.END); - constraintSet.connect(voteButtonToggleGroup.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); + constraintSet.connect(upvoteButton.getId(), ConstraintSet.END, scoreTextView.getId(), ConstraintSet.START); + constraintSet.connect(scoreTextView.getId(), ConstraintSet.END, downvoteButton.getId(), ConstraintSet.START); + constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); constraintSet.connect(commentsCountButton.getId(), ConstraintSet.START, saveButton.getId(), ConstraintSet.END); constraintSet.connect(commentsCountButton.getId(), ConstraintSet.END, upvoteButton.getId(), ConstraintSet.START); constraintSet.connect(saveButton.getId(), ConstraintSet.START, shareButton.getId(), ConstraintSet.END); @@ -4013,7 +4033,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy noPreviewLinkImageView.setBackgroundColor(mNoPreviewPostTypeBackgroundColor); noPreviewLinkImageView.setColorFilter(mNoPreviewPostTypeIconTint, android.graphics.PorterDuff.Mode.SRC_IN); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); - upvoteButton.setTextColor(mPostIconAndInfoColor); + scoreTextView.setTextColor(mPostIconAndInfoColor); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); commentsCountButton.setTextColor(mPostIconAndInfoColor); commentsCountButton.setIcon(mCommentIcon); @@ -4155,6 +4175,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy int previousUpvoteButtonTextColor = upvoteButton.getCurrentTextColor(); int previousDownvoteButtonTextColor = downvoteButton.getCurrentTextColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); @@ -4168,20 +4189,20 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy //Not upvoted before post.setVoteType(1); newVoteType = APIUtils.DIR_UPVOTE; - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } else { //Upvoted before post.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() { @@ -4191,16 +4212,16 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (newVoteType.equals(APIUtils.DIR_UPVOTE)) { post.setVoteType(1); if (currentPosition == position) { - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } } else { post.setVoteType(0); if (currentPosition == position) { - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } } @@ -4208,7 +4229,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } } @@ -4221,11 +4242,11 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy post.setVoteType(previousVoteType); if (getBindingAdapterPosition() == position) { if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); } @@ -4255,13 +4276,13 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy int previousUpvoteButtonTextColor = upvoteButton.getTextColors().getDefaultColor(); int previousDownvoteButtonTextColor = downvoteButton.getTextColors().getDefaultColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); int previousVoteType = post.getVoteType(); String newVoteType; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); @@ -4271,16 +4292,18 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy newVoteType = APIUtils.DIR_DOWNVOTE; downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } else { //Downvoted before post.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() { @@ -4292,21 +4315,22 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (currentPosition == position) { downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } } else { post.setVoteType(0); if (currentPosition == position) { downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } } if (currentPosition == position) { - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } } @@ -4319,11 +4343,11 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy post.setVoteType(previousVoteType); if (getBindingAdapterPosition() == position) { if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); } @@ -4465,8 +4489,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.imageViewNoPreviewLinkItemPostCompact, binding.barrier2, binding.bottomConstraintLayoutItemPostCompact, - binding.voteButtonToggleItemPostCompact, binding.upvoteButtonItemPostCompact, + binding.scoreTextViewItemPostCompact, binding.downvoteButtonItemPostCompact, binding.commentsCountButtonItemPostCompact, binding.saveButtonItemPostCompact, @@ -4502,8 +4526,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.imageViewNoPreviewLinkItemPostCompactRightThumbnail, binding.barrier2, binding.bottomConstraintLayoutItemPostCompactRightThumbnail, - binding.voteButtonToggleItemPostCompactRightThumbnail, binding.upvoteButtonItemPostCompactRightThumbnail, + binding.scoreTextViewItemPostCompactRightThumbnail, binding.downvoteButtonItemPostCompactRightThumbnail, binding.commentsCountButtonItemPostCompactRightThumbnail, binding.saveButtonItemPostCompactRightThumbnail, @@ -4831,8 +4855,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ImageView playButton, DefaultTimeBar progressBar, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -4855,8 +4879,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy flairTextView, awardsTextView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, + scoreTextView, downvoteButton, commentsCountButton, saveButton, @@ -5121,8 +5145,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.getRoot().findViewById(R.id.exo_play), binding.getRoot().findViewById(R.id.exo_progress), binding.bottomConstraintLayoutItemPostCard2VideoAutoplay, - binding.voteButtonToggleItemPostCard2VideoAutoplay, binding.upvoteButtonItemPostCard2VideoAutoplay, + binding.scoreTextViewItemPostCard2VideoAutoplay, binding.downvoteButtonItemPostCard2VideoAutoplay, binding.commentsCountButtonItemPostCard2VideoAutoplay, binding.saveButtonItemPostCard2VideoAutoplay, @@ -5158,8 +5182,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.getRoot().findViewById(R.id.exo_play), binding.getRoot().findViewById(R.id.exo_progress), binding.bottomConstraintLayoutItemPostCard2VideoAutoplay, - binding.voteButtonToggleItemPostCard2VideoAutoplay, binding.upvoteButtonItemPostCard2VideoAutoplay, + binding.scoreTextViewItemPostCard2VideoAutoplay, binding.downvoteButtonItemPostCard2VideoAutoplay, binding.commentsCountButtonItemPostCard2VideoAutoplay, binding.saveButtonItemPostCard2VideoAutoplay, @@ -5191,8 +5215,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.flairCustomTextViewItemPostCard2WithPreview, binding.awardsTextViewItemPostCard2WithPreview, binding.bottomConstraintLayoutItemPostCard2WithPreview, - binding.voteButtonToggleItemPostCard2WithPreview, binding.upvoteButtonItemPostCard2WithPreview, + binding.scoreTextViewItemPostCard2WithPreview, binding.downvoteButtonItemPostCard2WithPreview, binding.commentsCountButtonItemPostCard2WithPreview, binding.saveButtonItemPostCard2WithPreview, @@ -5274,8 +5298,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.imageIndexTextViewItemPostCard2GalleryType, binding.noPreviewImageViewItemPostCard2GalleryType, binding.bottomConstraintLayoutItemPostCard2GalleryType, - binding.voteButtonToggleItemPostCard2GalleryType, binding.upvoteButtonItemPostCard2GalleryType, + binding.scoreTextViewItemPostCard2GalleryType, binding.downvoteButtonItemPostCard2GalleryType, binding.commentsCountButtonItemPostCard2GalleryType, binding.saveButtonItemPostCard2GalleryType, @@ -5309,8 +5333,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.flairCustomTextViewItemPostCard2Text, binding.awardsTextViewItemPostCard2Text, binding.bottomConstraintLayoutItemPostCard2Text, - binding.voteButtonToggleItemPostCard2Text, binding.upvoteButtonItemPostCard2Text, + binding.scoreTextViewItemPostCard2Text, binding.downvoteButtonItemPostCard2Text, binding.commentsCountButtonItemPostCard2Text, binding.saveButtonItemPostCard2Text, @@ -5333,8 +5357,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy TextView postTimeTextView; TextView titleTextView; ConstraintLayout bottomConstraintLayout; - MaterialButtonToggleGroup voteButtonToggleGroup; MaterialButton upvoteButton; + TextView scoreTextView; MaterialButton downvoteButton; MaterialButton commentsCountButton; MaterialButton saveButton; @@ -5353,8 +5377,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy TextView postTimeTextView, TextView titleTextView, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -5366,8 +5390,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy this.postTimeTextView = postTimeTextView; this.titleTextView = titleTextView; this.bottomConstraintLayout = bottomConstraintLayout; - this.voteButtonToggleGroup = voteButtonToggleGroup; this.upvoteButton = upvoteButton; + this.scoreTextView = scoreTextView; this.downvoteButton = downvoteButton; this.commentsCountButton = commentsCountButton; this.saveButton = saveButton; @@ -5376,14 +5400,18 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (mVoteButtonsOnTheRight) { ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(bottomConstraintLayout); - constraintSet.clear(voteButtonToggleGroup.getId(), ConstraintSet.START); - constraintSet.clear(saveButton.getId(), ConstraintSet.START); - constraintSet.clear(shareButton.getId(), ConstraintSet.START); - constraintSet.connect(voteButtonToggleGroup.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); - constraintSet.connect(commentsCountButton.getId(), ConstraintSet.START, ConstraintSet.PARENT_ID, ConstraintSet.START); - constraintSet.connect(commentsCountButton.getId(), ConstraintSet.END, shareButton.getId(), ConstraintSet.START); - constraintSet.connect(saveButton.getId(), ConstraintSet.END, voteButtonToggleGroup.getId(), ConstraintSet.START); - constraintSet.connect(shareButton.getId(), ConstraintSet.END, saveButton.getId(), ConstraintSet.START); + constraintSet.clear(upvoteButton.getId(), ConstraintSet.START); + constraintSet.clear(scoreTextView.getId(), ConstraintSet.START); + constraintSet.clear(downvoteButton.getId(), ConstraintSet.START); + constraintSet.clear(saveButton.getId(), ConstraintSet.END); + constraintSet.clear(shareButton.getId(), ConstraintSet.END); + constraintSet.connect(upvoteButton.getId(), ConstraintSet.END, scoreTextView.getId(), ConstraintSet.START); + constraintSet.connect(scoreTextView.getId(), ConstraintSet.END, downvoteButton.getId(), ConstraintSet.START); + constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); + constraintSet.connect(commentsCountButton.getId(), ConstraintSet.START, saveButton.getId(), ConstraintSet.END); + constraintSet.connect(commentsCountButton.getId(), ConstraintSet.END, upvoteButton.getId(), ConstraintSet.START); + constraintSet.connect(saveButton.getId(), ConstraintSet.START, shareButton.getId(), ConstraintSet.END); + constraintSet.connect(shareButton.getId(), ConstraintSet.START, ConstraintSet.PARENT_ID, ConstraintSet.START); constraintSet.setHorizontalBias(commentsCountButton.getId(), 0); constraintSet.applyTo(bottomConstraintLayout); } @@ -5512,13 +5540,13 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy int previousUpvoteButtonTextColor = upvoteButton.getCurrentTextColor(); int previousDownvoteButtonTextColor = downvoteButton.getCurrentTextColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); int previousVoteType = post.getVoteType(); String newVoteType; - downvoteButton.setTextColor(mPostIconAndInfoColor); downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); @@ -5526,20 +5554,20 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy //Not upvoted before post.setVoteType(1); newVoteType = APIUtils.DIR_UPVOTE; - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } else { //Upvoted before post.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() { @@ -5549,25 +5577,24 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (newVoteType.equals(APIUtils.DIR_UPVOTE)) { post.setVoteType(1); if (currentPosition == position) { - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } } else { post.setVoteType(0); if (currentPosition == position) { - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } } if (currentPosition == position) { - downvoteButton.setTextColor(mPostIconAndInfoColor); downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } } @@ -5580,12 +5607,11 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy post.setVoteType(previousVoteType); if (getBindingAdapterPosition() == position) { if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); - downvoteButton.setTextColor(previousDownvoteButtonTextColor); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); } @@ -5596,6 +5622,10 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy } }); + scoreTextView.setOnClickListener(view -> { + upvoteButton.performClick(); + }); + downvoteButton.setOnClickListener(view -> { int position = getBindingAdapterPosition(); if (position < 0) { @@ -5615,13 +5645,13 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy int previousUpvoteButtonTextColor = upvoteButton.getTextColors().getDefaultColor(); int previousDownvoteButtonTextColor = downvoteButton.getTextColors().getDefaultColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); int previousVoteType = post.getVoteType(); String newVoteType; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); @@ -5629,20 +5659,18 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy //Not downvoted before post.setVoteType(-1); newVoteType = APIUtils.DIR_DOWNVOTE; - downvoteButton.setTextColor(mDownvotedColor); downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); } else { //Downvoted before post.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; - downvoteButton.setTextColor(mPostIconAndInfoColor); downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() { @@ -5652,25 +5680,24 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy if (newVoteType.equals(APIUtils.DIR_DOWNVOTE)) { post.setVoteType(-1); if (currentPosition == position) { - downvoteButton.setTextColor(mDownvotedColor); downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } } else { post.setVoteType(0); if (currentPosition == position) { - downvoteButton.setTextColor(mPostIconAndInfoColor); downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } } if (currentPosition == position) { - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } } @@ -5683,12 +5710,11 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy post.setVoteType(previousVoteType); if (getBindingAdapterPosition() == position) { if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); - downvoteButton.setTextColor(previousDownvoteButtonTextColor); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); } @@ -5825,8 +5851,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy ImageView playButton, DefaultTimeBar progressBar, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -5840,8 +5866,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy postTimeTextView, titleTextView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, + scoreTextView, downvoteButton, commentsCountButton, saveButton, @@ -6094,8 +6120,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.getRoot().findViewById(R.id.exo_play), binding.getRoot().findViewById(R.id.exo_progress), binding.bottomConstraintLayoutItemPostCard3VideoTypeAutoplay, - binding.voteButtonToggleItemPostCard3VideoTypeAutoplay, binding.upvoteButtonItemPostCard3VideoTypeAutoplay, + binding.scoreTextViewItemPostCard3VideoTypeAutoplay, binding.downvoteButtonItemPostCard3VideoTypeAutoplay, binding.commentsCountButtonItemPostCard3VideoTypeAutoplay, binding.saveButtonItemPostCard3VideoTypeAutoplay, @@ -6122,8 +6148,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.getRoot().findViewById(R.id.exo_play), binding.getRoot().findViewById(R.id.exo_progress), binding.bottomConstraintLayoutItemPostCard3VideoTypeAutoplay, - binding.voteButtonToggleItemPostCard3VideoTypeAutoplay, binding.upvoteButtonItemPostCard3VideoTypeAutoplay, + binding.scoreTextViewItemPostCard3VideoTypeAutoplay, binding.downvoteButtonItemPostCard3VideoTypeAutoplay, binding.commentsCountButtonItemPostCard3VideoTypeAutoplay, binding.saveButtonItemPostCard3VideoTypeAutoplay, @@ -6145,8 +6171,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.postTimeTextViewItemPostCard3WithPreview, binding.titleTextViewItemPostCard3WithPreview, binding.bottomConstraintLayoutItemPostCard3WithPreview, - binding.voteButtonToggleItemPostCard3WithPreview, binding.upvoteButtonItemPostCard3WithPreview, + binding.scoreTextViewItemPostCard3WithPreview, binding.downvoteButtonItemPostCard3WithPreview, binding.commentsCountButtonItemPostCard3WithPreview, binding.saveButtonItemPostCard3WithPreview, @@ -6224,8 +6250,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy CustomTextView imageIndexTextView, ImageView noPreviewImageView, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -6239,8 +6265,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy postTimeTextView, titleTextView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, + scoreTextView, downvoteButton, commentsCountButton, saveButton, @@ -6382,8 +6408,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.imageIndexTextViewItemPostCard3GalleryType, binding.noPreviewImageViewItemPostCard3GalleryType, binding.bottomConstraintLayoutItemPostCard3GalleryType, - binding.voteButtonToggleItemPostCard3GalleryType, binding.upvoteButtonItemPostCard3GalleryType, + binding.scoreTextViewItemPostCard3GalleryType, binding.downvoteButtonItemPostCard3GalleryType, binding.commentsCountButtonItemPostCard3GalleryType, binding.saveButtonItemPostCard3GalleryType, @@ -6406,8 +6432,8 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter<Post, Recy binding.postTimeTextViewItemPostCard3TextType, binding.titleTextViewItemPostCard3TextType, binding.bottomConstraintLayoutItemPostCard3TextType, - binding.voteButtonToggleItemPostCard3TextType, binding.upvoteButtonItemPostCard3TextType, + binding.scoreTextViewItemPostCard3TextType, binding.downvoteButtonItemPostCard3TextType, binding.commentsCountButtonItemPostCard3TextType, binding.saveButtonItemPostCard3TextType, 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 b700a633..7ba89d67 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostDetailRecyclerViewAdapter.java @@ -45,7 +45,6 @@ import com.google.android.exoplayer2.ui.DefaultTimeBar; import com.google.android.exoplayer2.ui.PlayerView; import com.google.android.exoplayer2.ui.TimeBar; import com.google.android.material.button.MaterialButton; -import com.google.android.material.button.MaterialButtonToggleGroup; import com.google.common.collect.ImmutableList; import com.libRG.CustomTextView; @@ -556,27 +555,28 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler switch (mPost.getVoteType()) { case 1: //Upvoted - ((PostDetailBaseViewHolder) holder).upvoteButton.setTextColor(mUpvotedColor); ((PostDetailBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); ((PostDetailBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + ((PostDetailBaseViewHolder) holder).scoreTextView.setTextColor(mUpvotedColor); break; case -1: //Downvoted ((PostDetailBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); ((PostDetailBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + ((PostDetailBaseViewHolder) holder).scoreTextView.setTextColor(mDownvotedColor); break; case 0: - ((PostDetailBaseViewHolder) holder).upvoteButton.setTextColor(mPostIconAndInfoColor); ((PostDetailBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); ((PostDetailBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + ((PostDetailBaseViewHolder) holder).scoreTextView.setTextColor(mPostIconAndInfoColor); ((PostDetailBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); ((PostDetailBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); } if (mPost.isArchived()) { ((PostDetailBaseViewHolder) holder).archivedImageView.setVisibility(View.VISIBLE); - ((PostDetailBaseViewHolder) holder).upvoteButton.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostDetailBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); + ((PostDetailBaseViewHolder) holder).scoreTextView.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostDetailBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); } @@ -637,9 +637,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler } if (!mHideTheNumberOfVotes) { - ((PostDetailBaseViewHolder) holder).upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, mPost.getScore() + mPost.getVoteType())); + ((PostDetailBaseViewHolder) holder).scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, mPost.getScore() + mPost.getVoteType())); } else { - ((PostDetailBaseViewHolder) holder).upvoteButton.setText(mActivity.getString(R.string.vote)); + ((PostDetailBaseViewHolder) holder).scoreTextView.setText(mActivity.getString(R.string.vote)); } ((PostDetailBaseViewHolder) holder).commentsCountButton.setText(Integer.toString(mPost.getNComments())); @@ -992,9 +992,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler @Override public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) { if (holder instanceof PostDetailBaseViewHolder) { - ((PostDetailBaseViewHolder) holder).upvoteButton.setTextColor(mPostIconAndInfoColor); ((PostDetailBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); ((PostDetailBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + ((PostDetailBaseViewHolder) holder).scoreTextView.setTextColor(mPostIconAndInfoColor); ((PostDetailBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); ((PostDetailBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); ((PostDetailBaseViewHolder) holder).flairTextView.setVisibility(View.GONE); @@ -1071,6 +1071,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler RecyclerView contentMarkdownView; ConstraintLayout bottomConstraintLayout; MaterialButton upvoteButton; + TextView scoreTextView; MaterialButton downvoteButton; MaterialButton commentsCountButton; MaterialButton saveButton; @@ -1097,8 +1098,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler TextView upvoteRatioTextView, RecyclerView contentMarkdownView, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -1121,6 +1122,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler this.contentMarkdownView = contentMarkdownView; this.bottomConstraintLayout = bottomConstraintLayout; this.upvoteButton = upvoteButton; + this.scoreTextView = scoreTextView; this.downvoteButton = downvoteButton; this.commentsCountButton = commentsCountButton; this.saveButton = saveButton; @@ -1210,6 +1212,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler int previousUpvoteButtonTextColor = upvoteButton.getCurrentTextColor(); int previousDownvoteButtonTextColor = downvoteButton.getCurrentTextColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); @@ -1223,20 +1226,20 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler //Not upvoted before mPost.setVoteType(1); newVoteType = APIUtils.DIR_UPVOTE; - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } else { //Upvoted before mPost.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, mPost.getScore() + mPost.getVoteType())); } @@ -1247,20 +1250,20 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler public void onVoteThingSuccess() { if (newVoteType.equals(APIUtils.DIR_UPVOTE)) { mPost.setVoteType(1); - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } else { mPost.setVoteType(0); - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, mPost.getScore() + mPost.getVoteType())); } @@ -1272,12 +1275,12 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler Toast.makeText(mActivity, R.string.vote_failed, Toast.LENGTH_SHORT).show(); mPost.setVoteType(previousVoteType); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, mPost.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); @@ -1286,6 +1289,10 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler }, mPost.getFullName(), newVoteType); }); + scoreTextView.setOnClickListener(view -> { + upvoteButton.performClick(); + }); + downvoteButton.setOnClickListener(view -> { if (mPost.isArchived()) { Toast.makeText(mActivity, R.string.archived_post_vote_unavailable, Toast.LENGTH_SHORT).show(); @@ -1299,13 +1306,13 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler int previousUpvoteButtonTextColor = upvoteButton.getTextColors().getDefaultColor(); int previousDownvoteButtonTextColor = downvoteButton.getTextColors().getDefaultColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); int previousVoteType = mPost.getVoteType(); String newVoteType; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); @@ -1315,16 +1322,18 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler newVoteType = APIUtils.DIR_DOWNVOTE; downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } else { //Downvoted before mPost.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, mPost.getScore() + mPost.getVoteType())); } @@ -1337,17 +1346,18 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler mPost.setVoteType(-1); downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } else { mPost.setVoteType(0); downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, mPost.getScore() + mPost.getVoteType())); } @@ -1359,12 +1369,12 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler Toast.makeText(mActivity, R.string.vote_failed, Toast.LENGTH_SHORT).show(); mPost.setVoteType(previousVoteType); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, mPost.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); @@ -1482,10 +1492,14 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler if (mVoteButtonsOnTheRight) { ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(bottomConstraintLayout); - constraintSet.clear(voteButtonToggleGroup.getId(), ConstraintSet.START); + constraintSet.clear(upvoteButton.getId(), ConstraintSet.START); + constraintSet.clear(scoreTextView.getId(), ConstraintSet.START); + constraintSet.clear(downvoteButton.getId(), ConstraintSet.START); constraintSet.clear(saveButton.getId(), ConstraintSet.END); constraintSet.clear(shareButton.getId(), ConstraintSet.END); - constraintSet.connect(voteButtonToggleGroup.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); + constraintSet.connect(upvoteButton.getId(), ConstraintSet.END, scoreTextView.getId(), ConstraintSet.START); + constraintSet.connect(scoreTextView.getId(), ConstraintSet.END, downvoteButton.getId(), ConstraintSet.START); + constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); constraintSet.connect(commentsCountButton.getId(), ConstraintSet.START, saveButton.getId(), ConstraintSet.END); constraintSet.connect(commentsCountButton.getId(), ConstraintSet.END, upvoteButton.getId(), ConstraintSet.START); constraintSet.connect(saveButton.getId(), ConstraintSet.START, shareButton.getId(), ConstraintSet.END); @@ -1538,7 +1552,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler upvoteRatioDrawable, null, null, null); upvoteRatioTextView.setTextColor(mSecondaryTextColor); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); - upvoteButton.setTextColor(mPostIconAndInfoColor); + scoreTextView.setTextColor(mPostIconAndInfoColor); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); commentsCountButton.setTextColor(mPostIconAndInfoColor); commentsCountButton.setIcon(mCommentIcon); @@ -1549,21 +1563,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler class PostDetailBaseVideoAutoplayViewHolder extends PostDetailBaseViewHolder implements ToroPlayer { public Call<String> fetchGfycatOrStreamableVideoCall; - AspectRatioGifImageView mIconGifImageView; - TextView mSubredditTextView; - TextView mUserTextView; - TextView mAuthorFlairTextView; - TextView mPostTimeTextView; - TextView mTitleTextView; - CustomTextView mTypeTextView; - ImageView mCrosspostImageView; - ImageView mArchivedImageView; - ImageView mLockedImageView; - CustomTextView mNSFWTextView; - CustomTextView mSpoilerTextView; - CustomTextView mFlairTextView; - TextView mAwardsTextView; - TextView mUpvoteRatioTextView; AspectRatioFrameLayout aspectRatioFrameLayout; PlayerView playerView; GifImageView previewImageView; @@ -1573,13 +1572,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler ImageView pauseButton; ImageView playButton; DefaultTimeBar progressBar; - RecyclerView mContentMarkdownView; - ConstraintLayout mBottomConstraintLayout; - MaterialButton mUpvoteButton; - MaterialButton mDownvoteButton; - MaterialButton commentsCountButton; - MaterialButton mSaveButton; - MaterialButton mShareButton; @Nullable Container container; @Nullable @@ -1615,8 +1607,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler DefaultTimeBar progressBar, RecyclerView contentMarkdownView, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -1639,8 +1631,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler upvoteRatioTextView, contentMarkdownView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, + scoreTextView, downvoteButton, commentsCountButton, saveButton, @@ -1892,8 +1884,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler binding.getRoot().findViewById(R.id.exo_progress), binding.contentMarkdownViewItemPostDetailVideoAutoplay, binding.bottomConstraintLayoutItemPostDetailVideoAutoplay, - binding.voteButtonToggleItemPostDetailVideoAutoplay, binding.upvoteButtonItemPostDetailVideoAutoplay, + binding.scoreTextViewItemPostDetailVideoAutoplay, binding.downvoteButtonItemPostDetailVideoAutoplay, binding.commentsCountButtonItemPostDetailVideoAutoplay, binding.saveButtonItemPostDetailVideoAutoplay, @@ -1930,8 +1922,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler binding.getRoot().findViewById(R.id.exo_progress), binding.contentMarkdownViewItemPostDetailVideoAutoplay, binding.bottomConstraintLayoutItemPostDetailVideoAutoplay, - binding.voteButtonToggleItemPostDetailVideoAutoplay, binding.upvoteButtonItemPostDetailVideoAutoplay, + binding.scoreTextViewItemPostDetailVideoAutoplay, binding.downvoteButtonItemPostDetailVideoAutoplay, binding.commentsCountButtonItemPostDetailVideoAutoplay, binding.saveButtonItemPostDetailVideoAutoplay, @@ -1962,8 +1954,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler binding.upvoteRatioTextViewItemPostDetailVideoAndGifPreview, binding.contentMarkdownViewItemPostDetailVideoAndGifPreview, binding.bottomConstraintLayoutItemPostDetailVideoAndGifPreview, - binding.voteButtonToggleItemPostDetailVideoAndGifPreview, binding.upvoteButtonItemPostDetailVideoAndGifPreview, + binding.scoreTextViewItemPostDetailVideoAndGifPreview, binding.downvoteButtonItemPostDetailVideoAndGifPreview, binding.commentsCountButtonItemPostDetailVideoAndGifPreview, binding.saveButtonItemPostDetailVideoAndGifPreview, @@ -2037,8 +2029,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler binding.upvoteRatioTextViewItemPostDetailImageAndGifAutoplay, binding.contentMarkdownViewItemPostDetailImageAndGifAutoplay, binding.bottomConstraintLayoutItemPostDetailImageAndGifAutoplay, - binding.voteButtonToggleItemPostDetailImageAndGifAutoplay, binding.upvoteButtonItemPostDetailImageAndGifAutoplay, + binding.scoreTextViewItemPostDetailImageAndGifAutoplay, binding.downvoteButtonItemPostDetailImageAndGifAutoplay, binding.commentsCountButtonItemPostDetailImageAndGifAutoplay, binding.saveButtonItemPostDetailImageAndGifAutoplay, @@ -2095,8 +2087,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler binding.upvoteRatioTextViewItemPostDetailLink, binding.contentMarkdownViewItemPostDetailLink, binding.bottomConstraintLayoutItemPostDetailLink, - binding.voteButtonToggleItemPostDetailLink, binding.upvoteButtonItemPostDetailLink, + binding.scoreTextViewItemPostDetailLink, binding.downvoteButtonItemPostDetailLink, binding.commentsCountButtonItemPostDetailLink, binding.saveButtonItemPostDetailLink, @@ -2142,8 +2134,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler binding.upvoteRatioTextViewItemPostDetailNoPreview, binding.contentMarkdownViewItemPostDetailNoPreview, binding.bottomConstraintLayoutItemPostDetailNoPreview, - binding.voteButtonToggleItemPostDetailNoPreview, binding.upvoteButtonItemPostDetailNoPreview, + binding.scoreTextViewItemPostDetailNoPreview, binding.downvoteButtonItemPostDetailNoPreview, binding.commentsCountButtonItemPostDetailNoPreview, binding.saveButtonItemPostDetailNoPreview, @@ -2235,8 +2227,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler binding.upvoteRatioTextViewItemPostDetailGallery, binding.contentMarkdownViewItemPostDetailGallery, binding.bottomConstraintLayoutItemPostDetailGallery, - binding.voteButtonToggleItemPostDetailGallery, binding.upvoteButtonItemPostDetailGallery, + binding.scoreTextViewItemPostDetailGallery, binding.downvoteButtonItemPostDetailGallery, binding.commentsCountButtonItemPostDetailGallery, binding.saveButtonItemPostDetailGallery, @@ -2376,8 +2368,8 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler binding.upvoteRatioTextViewItemPostDetailText, binding.contentMarkdownViewItemPostDetailText, binding.bottomConstraintLayoutItemPostDetailText, - binding.voteButtonToggleItemPostDetailText, binding.upvoteButtonItemPostDetailText, + binding.scoreTextViewItemPostDetailText, binding.downvoteButtonItemPostDetailText, binding.commentsCountButtonItemPostDetailText, binding.saveButtonItemPostDetailText, 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 4fad7e49..d650f195 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -737,9 +737,9 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ((PostBaseViewHolder) holder).titleTextView.setText(post.getTitle()); if (!mHideTheNumberOfVotes) { - ((PostBaseViewHolder) holder).upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + ((PostBaseViewHolder) holder).scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } else { - ((PostBaseViewHolder) holder).upvoteButton.setText(mActivity.getString(R.string.vote)); + ((PostBaseViewHolder) holder).scoreTextView.setText(mActivity.getString(R.string.vote)); } if (post.isLocked()) { @@ -775,14 +775,15 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie switch (post.getVoteType()) { case 1: //Upvoted - ((PostBaseViewHolder) holder).upvoteButton.setTextColor(mUpvotedColor); ((PostBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); ((PostBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + ((PostBaseViewHolder) holder).scoreTextView.setTextColor(mUpvotedColor); break; case -1: //Downvoted ((PostBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); ((PostBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + ((PostBaseViewHolder) holder).scoreTextView.setTextColor(mDownvotedColor); break; } @@ -794,8 +795,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (post.isArchived()) { ((PostBaseViewHolder) holder).archivedImageView.setVisibility(View.VISIBLE); - ((PostBaseViewHolder) holder).upvoteButton.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); + ((PostBaseViewHolder) holder).scoreTextView.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); } @@ -1341,9 +1342,9 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ((PostCompactBaseViewHolder) holder).titleTextView.setText(title); if (!mHideTheNumberOfVotes) { - ((PostCompactBaseViewHolder) holder).upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + ((PostCompactBaseViewHolder) holder).scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } else { - ((PostCompactBaseViewHolder) holder).upvoteButton.setText(mActivity.getString(R.string.vote)); + ((PostCompactBaseViewHolder) holder).scoreTextView.setText(mActivity.getString(R.string.vote)); } if (post.isLocked()) { @@ -1379,14 +1380,15 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie switch (post.getVoteType()) { case 1: //Upvoted - ((PostCompactBaseViewHolder) holder).upvoteButton.setTextColor(mUpvotedColor); ((PostCompactBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); ((PostCompactBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + ((PostCompactBaseViewHolder) holder).scoreTextView.setTextColor(mUpvotedColor); break; case -1: //Downvoted ((PostCompactBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); ((PostCompactBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + ((PostCompactBaseViewHolder) holder).scoreTextView.setTextColor(mDownvotedColor); break; } @@ -1411,8 +1413,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (isArchived) { ((PostCompactBaseViewHolder) holder).archivedImageView.setVisibility(View.VISIBLE); - ((PostCompactBaseViewHolder) holder).upvoteButton.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostCompactBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); + ((PostCompactBaseViewHolder) holder).scoreTextView.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostCompactBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); } @@ -1831,22 +1833,23 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ((PostMaterial3CardBaseViewHolder) holder).titleTextView.setText(post.getTitle()); if (!mHideTheNumberOfVotes) { - ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + ((PostMaterial3CardBaseViewHolder) holder).scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } else { - ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setText(mActivity.getString(R.string.vote)); + ((PostMaterial3CardBaseViewHolder) holder).scoreTextView.setText(mActivity.getString(R.string.vote)); } switch (post.getVoteType()) { case 1: //Upvoted - ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setTextColor(mUpvotedColor); ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + ((PostMaterial3CardBaseViewHolder) holder).scoreTextView.setTextColor(mUpvotedColor); break; case -1: //Downvoted ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + ((PostMaterial3CardBaseViewHolder) holder).scoreTextView.setTextColor(mDownvotedColor); break; } @@ -1856,8 +1859,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie } if (post.isArchived()) { - ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); + ((PostMaterial3CardBaseViewHolder) holder).scoreTextView.setTextColor(mVoteAndReplyUnavailableVoteButtonColor); ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mVoteAndReplyUnavailableVoteButtonColor)); } @@ -2428,9 +2431,9 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ((PostBaseViewHolder) holder).flairTextView.setVisibility(View.GONE); ((PostBaseViewHolder) holder).awardsTextView.setText(""); ((PostBaseViewHolder) holder).awardsTextView.setVisibility(View.GONE); - ((PostBaseViewHolder) holder).upvoteButton.setTextColor(mPostIconAndInfoColor); ((PostBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); ((PostBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + ((PostBaseViewHolder) holder).scoreTextView.setTextColor(mPostIconAndInfoColor); ((PostBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); ((PostBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); } else if (holder instanceof PostCompactBaseViewHolder) { @@ -2461,9 +2464,9 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ((PostCompactBaseViewHolder) holder).imageView.setVisibility(View.GONE); ((PostCompactBaseViewHolder) holder).playButtonImageView.setVisibility(View.GONE); ((PostCompactBaseViewHolder) holder).noPreviewPostImageFrameLayout.setVisibility(View.GONE); - ((PostCompactBaseViewHolder) holder).upvoteButton.setTextColor(mPostIconAndInfoColor); ((PostCompactBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); ((PostCompactBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + ((PostCompactBaseViewHolder) holder).scoreTextView.setTextColor(mPostIconAndInfoColor); ((PostCompactBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); ((PostCompactBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); } else if (holder instanceof PostGalleryViewHolder) { @@ -2540,9 +2543,9 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie mGlide.clear(((PostMaterial3CardBaseViewHolder) holder).iconGifImageView); ((PostMaterial3CardBaseViewHolder) holder).stickiedPostImageView.setVisibility(View.GONE); - ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setTextColor(mPostIconAndInfoColor); ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + ((PostMaterial3CardBaseViewHolder) holder).scoreTextView.setTextColor(mPostIconAndInfoColor); ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); } @@ -2709,6 +2712,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie CustomTextView awardsTextView; ConstraintLayout bottomConstraintLayout; MaterialButton upvoteButton; + TextView scoreTextView; MaterialButton downvoteButton; MaterialButton commentsCountButton; MaterialButton saveButton; @@ -2738,8 +2742,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie CustomTextView flairTextView, CustomTextView awardsTextView, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -2760,6 +2764,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie this.awardsTextView = awardsTextView; this.bottomConstraintLayout = bottomConstraintLayout; this.upvoteButton = upvoteButton; + this.scoreTextView = scoreTextView; this.downvoteButton = downvoteButton; this.commentsCountButton = commentsCountButton; this.saveButton = saveButton; @@ -2768,10 +2773,14 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (mVoteButtonsOnTheRight) { ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(bottomConstraintLayout); - constraintSet.clear(voteButtonToggleGroup.getId(), ConstraintSet.START); + constraintSet.clear(upvoteButton.getId(), ConstraintSet.START); + constraintSet.clear(scoreTextView.getId(), ConstraintSet.START); + constraintSet.clear(downvoteButton.getId(), ConstraintSet.START); constraintSet.clear(saveButton.getId(), ConstraintSet.END); constraintSet.clear(shareButton.getId(), ConstraintSet.END); - constraintSet.connect(voteButtonToggleGroup.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); + constraintSet.connect(upvoteButton.getId(), ConstraintSet.END, scoreTextView.getId(), ConstraintSet.START); + constraintSet.connect(scoreTextView.getId(), ConstraintSet.END, downvoteButton.getId(), ConstraintSet.START); + constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); constraintSet.connect(commentsCountButton.getId(), ConstraintSet.START, saveButton.getId(), ConstraintSet.END); constraintSet.connect(commentsCountButton.getId(), ConstraintSet.END, upvoteButton.getId(), ConstraintSet.START); constraintSet.connect(saveButton.getId(), ConstraintSet.START, shareButton.getId(), ConstraintSet.END); @@ -2826,7 +2835,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie lockedImageView.setColorFilter(mLockedIconTint, PorterDuff.Mode.SRC_IN); crosspostImageView.setColorFilter(mCrosspostIconTint, PorterDuff.Mode.SRC_IN); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); - upvoteButton.setTextColor(mPostIconAndInfoColor); + scoreTextView.setTextColor(mPostIconAndInfoColor); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); commentsCountButton.setTextColor(mPostIconAndInfoColor); commentsCountButton.setIcon(mCommentIcon); @@ -2973,6 +2982,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie int previousUpvoteButtonTextColor = upvoteButton.getCurrentTextColor(); int previousDownvoteButtonTextColor = downvoteButton.getCurrentTextColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); @@ -2986,20 +2996,20 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie //Not upvoted before post.setVoteType(1); newVoteType = APIUtils.DIR_UPVOTE; - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } else { //Upvoted before post.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() { @@ -3009,16 +3019,16 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (newVoteType.equals(APIUtils.DIR_UPVOTE)) { post.setVoteType(1); if (currentPosition == position) { - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } } else { post.setVoteType(0); if (currentPosition == position) { - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } } @@ -3026,7 +3036,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } } @@ -3039,11 +3049,11 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie post.setVoteType(previousVoteType); if (getBindingAdapterPosition() == position) { if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); } @@ -3054,6 +3064,10 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie } }); + scoreTextView.setOnClickListener(view -> { + upvoteButton.performClick(); + }); + downvoteButton.setOnClickListener(view -> { int position = getBindingAdapterPosition(); if (position < 0) { @@ -3077,13 +3091,13 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie int previousUpvoteButtonTextColor = upvoteButton.getTextColors().getDefaultColor(); int previousDownvoteButtonTextColor = downvoteButton.getTextColors().getDefaultColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); int previousVoteType = post.getVoteType(); String newVoteType; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); @@ -3093,16 +3107,18 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie newVoteType = APIUtils.DIR_DOWNVOTE; downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } else { //Downvoted before post.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() { @@ -3114,21 +3130,22 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (currentPosition == position) { downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } } else { post.setVoteType(0); if (currentPosition == position) { downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } } if (currentPosition == position) { - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } } @@ -3141,11 +3158,11 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie post.setVoteType(previousVoteType); if (getBindingAdapterPosition() == position) { if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); } @@ -3262,8 +3279,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie CustomTextView flairTextView, CustomTextView awardsTextView, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -3273,7 +3290,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie setBaseView(iconGifImageView, subredditTextView, userTextView, stickiedPostImageView, postTimeTextView, titleTextView, typeTextView, archivedImageView, lockedImageView, crosspostImageView, nsfwTextView, spoilerTextView, flairTextView, awardsTextView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, downvoteButton, commentsCountButton, saveButton, shareButton); + upvoteButton, scoreTextView, downvoteButton, commentsCountButton, saveButton, shareButton); } void markPostRead(Post post, boolean changePostItemColor) { @@ -3342,8 +3359,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ImageView playButton, DefaultTimeBar progressBar, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -3365,8 +3382,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie flairTextView, awardsTextView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, + scoreTextView, downvoteButton, commentsCountButton, saveButton, @@ -3631,8 +3648,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.getRoot().findViewById(R.id.exo_play), binding.getRoot().findViewById(R.id.exo_progress), binding.bottomConstraintLayoutItemPostVideoTypeAutoplay, - binding.voteButtonToggleItemPostVideoTypeAutoplay, binding.upvoteButtonItemPostVideoTypeAutoplay, + binding.scoreTextViewItemPostVideoTypeAutoplay, binding.downvoteButtonItemPostVideoTypeAutoplay, binding.commentsCountButtonItemPostVideoTypeAutoplay, binding.saveButtonItemPostVideoTypeAutoplay, @@ -3667,8 +3684,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.getRoot().findViewById(R.id.exo_play), binding.getRoot().findViewById(R.id.exo_progress), binding.bottomConstraintLayoutItemPostVideoTypeAutoplay, - binding.voteButtonToggleItemPostVideoTypeAutoplay, binding.upvoteButtonItemPostVideoTypeAutoplay, + binding.scoreTextViewItemPostVideoTypeAutoplay, binding.downvoteButtonItemPostVideoTypeAutoplay, binding.commentsCountButtonItemPostVideoTypeAutoplay, binding.saveButtonItemPostVideoTypeAutoplay, @@ -3699,8 +3716,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.flairCustomTextViewItemPostWithPreview, binding.awardsTextViewItemPostWithPreview, binding.bottomConstraintLayoutItemPostWithPreview, - binding.voteButtonToggleItemPostWithPreview, binding.upvoteButtonItemPostWithPreview, + binding.scoreTextViewItemPostWithPreview, binding.downvoteButtonItemPostWithPreview, binding.commentsCountButtonItemPostWithPreview, binding.saveButtonItemPostWithPreview, @@ -3787,8 +3804,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie CustomTextView imageIndexTextView, ImageView noPreviewImageView, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -3811,8 +3828,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie flairTextView, awardsTextView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, + scoreTextView, downvoteButton, commentsCountButton, saveButton, @@ -3965,8 +3982,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.imageIndexTextViewItemPostGalleryType, binding.noPreviewImageViewItemPostGalleryType, binding.bottomConstraintLayoutItemPostGalleryType, - binding.voteButtonToggleItemPostGalleryType, binding.upvoteButtonItemPostGalleryType, + binding.scoreTextViewItemPostGalleryType, binding.downvoteButtonItemPostGalleryType, binding.commentsCountButtonItemPostGalleryType, binding.saveButtonItemPostGalleryType, @@ -3998,8 +4015,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.flairCustomTextViewItemPostTextType, binding.awardsTextViewItemPostTextType, binding.bottomConstraintLayoutItemPostTextType, - binding.voteButtonToggleItemPostTextType, binding.upvoteButtonItemPostTextType, + binding.scoreTextViewItemPostTextType, binding.downvoteButtonItemPostTextType, binding.commentsCountButtonItemPostTextType, binding.saveButtonItemPostTextType, @@ -4037,6 +4054,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie Barrier imageBarrier; ConstraintLayout bottomConstraintLayout; MaterialButton upvoteButton; + TextView scoreTextView; MaterialButton downvoteButton; MaterialButton commentsCountButton; MaterialButton saveButton; @@ -4074,8 +4092,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ImageView noPreviewLinkImageView, Barrier imageBarrier, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -4105,6 +4123,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie this.imageBarrier = imageBarrier; this.bottomConstraintLayout = bottomConstraintLayout; this.upvoteButton = upvoteButton; + this.scoreTextView = scoreTextView; this.downvoteButton = downvoteButton; this.commentsCountButton = commentsCountButton; this.saveButton = saveButton; @@ -4114,10 +4133,14 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (mVoteButtonsOnTheRight) { ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(bottomConstraintLayout); - constraintSet.clear(voteButtonToggleGroup.getId(), ConstraintSet.START); + constraintSet.clear(upvoteButton.getId(), ConstraintSet.START); + constraintSet.clear(scoreTextView.getId(), ConstraintSet.START); + constraintSet.clear(downvoteButton.getId(), ConstraintSet.START); constraintSet.clear(saveButton.getId(), ConstraintSet.END); constraintSet.clear(shareButton.getId(), ConstraintSet.END); - constraintSet.connect(voteButtonToggleGroup.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); + constraintSet.connect(upvoteButton.getId(), ConstraintSet.END, scoreTextView.getId(), ConstraintSet.START); + constraintSet.connect(scoreTextView.getId(), ConstraintSet.END, downvoteButton.getId(), ConstraintSet.START); + constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); constraintSet.connect(commentsCountButton.getId(), ConstraintSet.START, saveButton.getId(), ConstraintSet.END); constraintSet.connect(commentsCountButton.getId(), ConstraintSet.END, upvoteButton.getId(), ConstraintSet.START); constraintSet.connect(saveButton.getId(), ConstraintSet.START, shareButton.getId(), ConstraintSet.END); @@ -4175,7 +4198,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie noPreviewLinkImageView.setBackgroundColor(mNoPreviewPostTypeBackgroundColor); noPreviewLinkImageView.setColorFilter(mNoPreviewPostTypeIconTint, android.graphics.PorterDuff.Mode.SRC_IN); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); - upvoteButton.setTextColor(mPostIconAndInfoColor); + scoreTextView.setTextColor(mPostIconAndInfoColor); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); commentsCountButton.setTextColor(mPostIconAndInfoColor); commentsCountButton.setIcon(mCommentIcon); @@ -4323,6 +4346,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie int previousUpvoteButtonTextColor = upvoteButton.getCurrentTextColor(); int previousDownvoteButtonTextColor = downvoteButton.getCurrentTextColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); @@ -4336,20 +4360,20 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie //Not upvoted before post.setVoteType(1); newVoteType = APIUtils.DIR_UPVOTE; - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } else { //Upvoted before post.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() { @@ -4359,16 +4383,16 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (newVoteType.equals(APIUtils.DIR_UPVOTE)) { post.setVoteType(1); if (currentPosition == position) { - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } } else { post.setVoteType(0); if (currentPosition == position) { - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } } @@ -4376,7 +4400,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } } @@ -4389,11 +4413,11 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie post.setVoteType(previousVoteType); if (getBindingAdapterPosition() == position) { if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); } @@ -4427,13 +4451,13 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie int previousUpvoteButtonTextColor = upvoteButton.getTextColors().getDefaultColor(); int previousDownvoteButtonTextColor = downvoteButton.getTextColors().getDefaultColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); int previousVoteType = post.getVoteType(); String newVoteType; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); @@ -4443,16 +4467,18 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie newVoteType = APIUtils.DIR_DOWNVOTE; downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } else { //Downvoted before post.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() { @@ -4464,21 +4490,22 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (currentPosition == position) { downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } } else { post.setVoteType(0); if (currentPosition == position) { downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } } if (currentPosition == position) { - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } } @@ -4491,11 +4518,11 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie post.setVoteType(previousVoteType); if (getBindingAdapterPosition() == position) { if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); } @@ -4653,8 +4680,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.imageViewNoPreviewLinkItemPostCompact, binding.barrier2, binding.bottomConstraintLayoutItemPostCompact, - binding.voteButtonToggleItemPostCompact, binding.upvoteButtonItemPostCompact, + binding.scoreTextViewItemPostCompact, binding.downvoteButtonItemPostCompact, binding.commentsCountButtonItemPostCompact, binding.saveButtonItemPostCompact, @@ -4690,8 +4717,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.imageViewNoPreviewLinkItemPostCompactRightThumbnail, binding.barrier2, binding.bottomConstraintLayoutItemPostCompactRightThumbnail, - binding.voteButtonToggleItemPostCompactRightThumbnail, binding.upvoteButtonItemPostCompactRightThumbnail, + binding.scoreTextViewItemPostCompactRightThumbnail, binding.downvoteButtonItemPostCompactRightThumbnail, binding.commentsCountButtonItemPostCompactRightThumbnail, binding.saveButtonItemPostCompactRightThumbnail, @@ -5055,8 +5082,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ImageView playButton, DefaultTimeBar progressBar, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -5079,8 +5106,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie flairTextView, awardsTextView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, + scoreTextView, downvoteButton, commentsCountButton, saveButton, @@ -5346,8 +5373,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.getRoot().findViewById(R.id.exo_play), binding.getRoot().findViewById(R.id.exo_progress), binding.bottomConstraintLayoutItemPostCard2VideoAutoplay, - binding.voteButtonToggleItemPostCard2VideoAutoplay, binding.upvoteButtonItemPostCard2VideoAutoplay, + binding.scoreTextViewItemPostCard2VideoAutoplay, binding.downvoteButtonItemPostCard2VideoAutoplay, binding.commentsCountButtonItemPostCard2VideoAutoplay, binding.saveButtonItemPostCard2VideoAutoplay, @@ -5383,8 +5410,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.getRoot().findViewById(R.id.exo_play), binding.getRoot().findViewById(R.id.exo_progress), binding.bottomConstraintLayoutItemPostCard2VideoAutoplay, - binding.voteButtonToggleItemPostCard2VideoAutoplay, binding.upvoteButtonItemPostCard2VideoAutoplay, + binding.scoreTextViewItemPostCard2VideoAutoplay, binding.downvoteButtonItemPostCard2VideoAutoplay, binding.commentsCountButtonItemPostCard2VideoAutoplay, binding.saveButtonItemPostCard2VideoAutoplay, @@ -5416,8 +5443,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.flairCustomTextViewItemPostCard2WithPreview, binding.awardsTextViewItemPostCard2WithPreview, binding.bottomConstraintLayoutItemPostCard2WithPreview, - binding.voteButtonToggleItemPostCard2WithPreview, binding.upvoteButtonItemPostCard2WithPreview, + binding.scoreTextViewItemPostCard2WithPreview, binding.downvoteButtonItemPostCard2WithPreview, binding.commentsCountButtonItemPostCard2WithPreview, binding.saveButtonItemPostCard2WithPreview, @@ -5500,8 +5527,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.imageIndexTextViewItemPostCard2GalleryType, binding.noPreviewImageViewItemPostCard2GalleryType, binding.bottomConstraintLayoutItemPostCard2GalleryType, - binding.voteButtonToggleItemPostCard2GalleryType, binding.upvoteButtonItemPostCard2GalleryType, + binding.scoreTextViewItemPostCard2GalleryType, binding.downvoteButtonItemPostCard2GalleryType, binding.commentsCountButtonItemPostCard2GalleryType, binding.saveButtonItemPostCard2GalleryType, @@ -5535,8 +5562,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.flairCustomTextViewItemPostCard2Text, binding.awardsTextViewItemPostCard2Text, binding.bottomConstraintLayoutItemPostCard2Text, - binding.voteButtonToggleItemPostCard2Text, binding.upvoteButtonItemPostCard2Text, + binding.scoreTextViewItemPostCard2Text, binding.downvoteButtonItemPostCard2Text, binding.commentsCountButtonItemPostCard2Text, binding.saveButtonItemPostCard2Text, @@ -5559,8 +5586,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie TextView postTimeTextView; TextView titleTextView; ConstraintLayout bottomConstraintLayout; - MaterialButtonToggleGroup voteButtonToggleGroup; MaterialButton upvoteButton; + TextView scoreTextView; MaterialButton downvoteButton; MaterialButton commentsCountButton; MaterialButton saveButton; @@ -5580,8 +5607,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie TextView postTimeTextView, TextView titleTextView, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -5593,8 +5620,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie this.postTimeTextView = postTimeTextView; this.titleTextView = titleTextView; this.bottomConstraintLayout = bottomConstraintLayout; - this.voteButtonToggleGroup = voteButtonToggleGroup; this.upvoteButton = upvoteButton; + this.scoreTextView = scoreTextView; this.downvoteButton = downvoteButton; this.commentsCountButton = commentsCountButton; this.saveButton = saveButton; @@ -5603,14 +5630,18 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (mVoteButtonsOnTheRight) { ConstraintSet constraintSet = new ConstraintSet(); constraintSet.clone(bottomConstraintLayout); - constraintSet.clear(voteButtonToggleGroup.getId(), ConstraintSet.START); - constraintSet.clear(saveButton.getId(), ConstraintSet.START); - constraintSet.clear(shareButton.getId(), ConstraintSet.START); - constraintSet.connect(voteButtonToggleGroup.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); - constraintSet.connect(commentsCountButton.getId(), ConstraintSet.START, ConstraintSet.PARENT_ID, ConstraintSet.START); - constraintSet.connect(commentsCountButton.getId(), ConstraintSet.END, shareButton.getId(), ConstraintSet.START); - constraintSet.connect(saveButton.getId(), ConstraintSet.END, voteButtonToggleGroup.getId(), ConstraintSet.START); - constraintSet.connect(shareButton.getId(), ConstraintSet.END, saveButton.getId(), ConstraintSet.START); + constraintSet.clear(upvoteButton.getId(), ConstraintSet.START); + constraintSet.clear(scoreTextView.getId(), ConstraintSet.START); + constraintSet.clear(downvoteButton.getId(), ConstraintSet.START); + constraintSet.clear(saveButton.getId(), ConstraintSet.END); + constraintSet.clear(shareButton.getId(), ConstraintSet.END); + constraintSet.connect(upvoteButton.getId(), ConstraintSet.END, scoreTextView.getId(), ConstraintSet.START); + constraintSet.connect(scoreTextView.getId(), ConstraintSet.END, downvoteButton.getId(), ConstraintSet.START); + constraintSet.connect(downvoteButton.getId(), ConstraintSet.END, ConstraintSet.PARENT_ID, ConstraintSet.END); + constraintSet.connect(commentsCountButton.getId(), ConstraintSet.START, saveButton.getId(), ConstraintSet.END); + constraintSet.connect(commentsCountButton.getId(), ConstraintSet.END, upvoteButton.getId(), ConstraintSet.START); + constraintSet.connect(saveButton.getId(), ConstraintSet.START, shareButton.getId(), ConstraintSet.END); + constraintSet.connect(shareButton.getId(), ConstraintSet.START, ConstraintSet.PARENT_ID, ConstraintSet.START); constraintSet.setHorizontalBias(commentsCountButton.getId(), 0); constraintSet.applyTo(bottomConstraintLayout); } @@ -5634,6 +5665,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie titleTextView.setTextColor(mPostTitleColor); stickiedPostImageView.setColorFilter(mStickiedPostIconTint, PorterDuff.Mode.SRC_IN); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); commentsCountButton.setTextColor(mPostIconAndInfoColor); commentsCountButton.setIcon(mCommentIcon); @@ -5746,6 +5778,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie int previousUpvoteButtonTextColor = upvoteButton.getCurrentTextColor(); int previousDownvoteButtonTextColor = downvoteButton.getCurrentTextColor(); + int previousScoreTextViewColor = scoreTextView.getCurrentTextColor(); Drawable previousUpvoteButtonDrawable = upvoteButton.getIcon(); Drawable previousDownvoteButtonDrawable = downvoteButton.getIcon(); @@ -5759,20 +5792,20 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie //Not upvoted before post.setVoteType(1); newVoteType = APIUtils.DIR_UPVOTE; - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } else { //Upvoted before post.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() { @@ -5782,16 +5815,16 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (newVoteType.equals(APIUtils.DIR_UPVOTE)) { post.setVoteType(1); if (currentPosition == position) { - upvoteButton.setTextColor(mUpvotedColor); upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); + scoreTextView.setTextColor(mUpvotedColor); } } else { post.setVoteType(0); if (currentPosition == position) { - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } } @@ -5799,7 +5832,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } } @@ -5812,11 +5845,11 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie post.setVoteType(previousVoteType); if (getBindingAdapterPosition() == position) { if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); + scoreTextView.setTextColor(previousScoreTextViewColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); } @@ -5856,9 +5889,9 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie int previousVoteType = post.getVoteType(); String newVoteType; - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); if (previousVoteType != -1) { //Not downvoted before @@ -5866,16 +5899,18 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie newVoteType = APIUtils.DIR_DOWNVOTE; downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } else { //Downvoted before post.setVoteType(0); newVoteType = APIUtils.DIR_UNVOTE; downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } VoteThing.voteThing(mActivity, mOauthRetrofit, mAccessToken, new VoteThing.VoteThingListener() { @@ -5887,21 +5922,23 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie if (currentPosition == position) { downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); + scoreTextView.setTextColor(mDownvotedColor); } } else { post.setVoteType(0); if (currentPosition == position) { downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); } } if (currentPosition == position) { - upvoteButton.setTextColor(mPostIconAndInfoColor); upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + scoreTextView.setTextColor(mPostIconAndInfoColor); if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + post.getVoteType())); } } @@ -5914,11 +5951,11 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie post.setVoteType(previousVoteType); if (getBindingAdapterPosition() == position) { if (!mHideTheNumberOfVotes) { - upvoteButton.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); + scoreTextView.setText(Utils.getNVotes(mShowAbsoluteNumberOfVotes, post.getScore() + previousVoteType)); } - upvoteButton.setTextColor(previousUpvoteButtonTextColor); upvoteButton.setIcon(previousUpvoteButtonDrawable); upvoteButton.setIconTint(ColorStateList.valueOf(previousUpvoteButtonTextColor)); + scoreTextView.setTextColor(previousUpvoteButtonTextColor); downvoteButton.setIcon(previousDownvoteButtonDrawable); downvoteButton.setIconTint(ColorStateList.valueOf(previousDownvoteButtonTextColor)); } @@ -6074,8 +6111,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ImageView playButton, DefaultTimeBar progressBar, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -6089,8 +6126,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie postTimeTextView, titleTextView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, + scoreTextView, downvoteButton, commentsCountButton, saveButton, @@ -6347,8 +6384,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.getRoot().findViewById(R.id.exo_play), binding.getRoot().findViewById(R.id.exo_progress), binding.bottomConstraintLayoutItemPostCard3VideoTypeAutoplay, - binding.voteButtonToggleItemPostCard3VideoTypeAutoplay, binding.upvoteButtonItemPostCard3VideoTypeAutoplay, + binding.scoreTextViewItemPostCard3VideoTypeAutoplay, binding.downvoteButtonItemPostCard3VideoTypeAutoplay, binding.commentsCountButtonItemPostCard3VideoTypeAutoplay, binding.saveButtonItemPostCard3VideoTypeAutoplay, @@ -6375,8 +6412,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.getRoot().findViewById(R.id.exo_play), binding.getRoot().findViewById(R.id.exo_progress), binding.bottomConstraintLayoutItemPostCard3VideoTypeAutoplay, - binding.voteButtonToggleItemPostCard3VideoTypeAutoplay, binding.upvoteButtonItemPostCard3VideoTypeAutoplay, + binding.scoreTextViewItemPostCard3VideoTypeAutoplay, binding.downvoteButtonItemPostCard3VideoTypeAutoplay, binding.commentsCountButtonItemPostCard3VideoTypeAutoplay, binding.saveButtonItemPostCard3VideoTypeAutoplay, @@ -6399,8 +6436,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.postTimeTextViewItemPostCard3WithPreview, binding.titleTextViewItemPostCard3WithPreview, binding.bottomConstraintLayoutItemPostCard3WithPreview, - binding.voteButtonToggleItemPostCard3WithPreview, binding.upvoteButtonItemPostCard3WithPreview, + binding.scoreTextViewItemPostCard3WithPreview, binding.downvoteButtonItemPostCard3WithPreview, binding.commentsCountButtonItemPostCard3WithPreview, binding.saveButtonItemPostCard3WithPreview, @@ -6479,8 +6516,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie CustomTextView imageIndexTextView, ImageView noPreviewImageView, ConstraintLayout bottomConstraintLayout, - MaterialButtonToggleGroup voteButtonToggleGroup, MaterialButton upvoteButton, + TextView scoreTextView, MaterialButton downvoteButton, MaterialButton commentsCountButton, MaterialButton saveButton, @@ -6494,8 +6531,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie postTimeTextView, titleTextView, bottomConstraintLayout, - voteButtonToggleGroup, upvoteButton, + scoreTextView, downvoteButton, commentsCountButton, saveButton, @@ -6639,8 +6676,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.imageIndexTextViewItemPostCard3GalleryType, binding.noPreviewImageViewItemPostCard3GalleryType, binding.bottomConstraintLayoutItemPostCard3GalleryType, - binding.voteButtonToggleItemPostCard3GalleryType, binding.upvoteButtonItemPostCard3GalleryType, + binding.scoreTextViewItemPostCard3GalleryType, binding.downvoteButtonItemPostCard3GalleryType, binding.commentsCountButtonItemPostCard3GalleryType, binding.saveButtonItemPostCard3GalleryType, @@ -6663,8 +6700,8 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie binding.postTimeTextViewItemPostCard3TextType, binding.titleTextViewItemPostCard3TextType, binding.bottomConstraintLayoutItemPostCard3TextType, - binding.voteButtonToggleItemPostCard3TextType, binding.upvoteButtonItemPostCard3TextType, + binding.scoreTextViewItemPostCard3TextType, binding.downvoteButtonItemPostCard3TextType, binding.commentsCountButtonItemPostCard3TextType, binding.saveButtonItemPostCard3TextType, diff --git a/app/src/main/res/layout/item_post_card_2_gallery_type.xml b/app/src/main/res/layout/item_post_card_2_gallery_type.xml index e039bfff..49c293b1 100644 --- a/app/src/main/res/layout/item_post_card_2_gallery_type.xml +++ b/app/src/main/res/layout/item_post_card_2_gallery_type.xml @@ -220,45 +220,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_card_2_gallery_type" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_card_2_gallery_type" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_card_2_gallery_type" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_card_2_gallery_type" - 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" /> + <TextView + android:id="@+id/score_text_view_item_post_card_2_gallery_type" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_card_2_gallery_type" /> - </com.google.android.material.button.MaterialButtonToggleGroup> + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_card_2_gallery_type" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_2_gallery_type" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_card_2_gallery_type" @@ -277,7 +281,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_card_2_gallery_type" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_card_2_gallery_type" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_card_2_text.xml b/app/src/main/res/layout/item_post_card_2_text.xml index 28847320..45e24a76 100644 --- a/app/src/main/res/layout/item_post_card_2_text.xml +++ b/app/src/main/res/layout/item_post_card_2_text.xml @@ -180,45 +180,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_card_2_text" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_card_2_text" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_card_2_text" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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" /> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/downvote_button_item_post_card_2_text" - 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" /> + <TextView + android:id="@+id/score_text_view_item_post_card_2_text" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_card_2_text" /> - </com.google.android.material.button.MaterialButtonToggleGroup> + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_card_2_text" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_2_text" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_card_2_text" @@ -237,7 +241,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_card_2_text" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_card_2_text" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_card_2_video_autoplay.xml b/app/src/main/res/layout/item_post_card_2_video_autoplay.xml index 0bf4a764..72d758e0 100644 --- a/app/src/main/res/layout/item_post_card_2_video_autoplay.xml +++ b/app/src/main/res/layout/item_post_card_2_video_autoplay.xml @@ -221,45 +221,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_card_2_video_autoplay" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_card_2_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_card_2_video_autoplay" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_card_2_video_autoplay" - 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" /> + <TextView + android:id="@+id/score_text_view_item_post_card_2_video_autoplay" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_card_2_video_autoplay" /> - </com.google.android.material.button.MaterialButtonToggleGroup> + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_card_2_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_2_video_autoplay" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_card_2_video_autoplay" @@ -278,7 +282,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_card_2_video_autoplay" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_card_2_video_autoplay" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml b/app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml index 34798142..95124881 100644 --- a/app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml +++ b/app/src/main/res/layout/item_post_card_2_video_autoplay_legacy_controller.xml @@ -221,45 +221,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_card_2_video_autoplay" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_card_2_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_card_2_video_autoplay" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_card_2_video_autoplay" - 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" /> + <TextView + android:id="@+id/score_text_view_item_post_card_2_video_autoplay" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_card_2_video_autoplay" /> - </com.google.android.material.button.MaterialButtonToggleGroup> + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_card_2_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_2_video_autoplay" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_card_2_video_autoplay" @@ -278,7 +282,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_card_2_video_autoplay" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_card_2_video_autoplay" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_card_2_with_preview.xml b/app/src/main/res/layout/item_post_card_2_with_preview.xml index 7514fffc..63f5fde8 100644 --- a/app/src/main/res/layout/item_post_card_2_with_preview.xml +++ b/app/src/main/res/layout/item_post_card_2_with_preview.xml @@ -232,45 +232,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_card_2_with_preview" - android:layout_width="0dp" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_card_2_with_preview" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_card_2_with_preview" + android:layout_width="64dp" android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_card_2_with_preview" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_card_2_with_preview" - 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> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_card_2_with_preview" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_card_2_with_preview" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_2_with_preview" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_card_2_with_preview" @@ -289,7 +293,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_card_2_with_preview" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_card_2_with_preview" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_card_3_gallery_type.xml b/app/src/main/res/layout/item_post_card_3_gallery_type.xml index 40e23972..d8079ca3 100644 --- a/app/src/main/res/layout/item_post_card_3_gallery_type.xml +++ b/app/src/main/res/layout/item_post_card_3_gallery_type.xml @@ -143,68 +143,49 @@ android:layout_height="wrap_content" android:padding="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_card_3_gallery_type" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_card_3_gallery_type" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_card_3_gallery_type" - 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/save_button_item_post_card_3_gallery_type" + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_card_3_gallery_type" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_card_3_gallery_type" - style="?attr/materialIconButtonOutlinedStyle" /> + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_card_3_gallery_type" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_card_3_gallery_type" /> <com.google.android.material.button.MaterialButton - android:id="@+id/share_button_item_post_card_3_gallery_type" + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_card_3_gallery_type" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" app:strokeWidth="0dp" - app:icon="@drawable/ic_share_grey_24dp" + app:icon="@drawable/ic_downvote_24dp" app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/save_button_item_post_card_3_gallery_type" - style="?attr/materialIconButtonOutlinedStyle" /> + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_3_gallery_type" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_card_3_gallery_type" @@ -217,15 +198,39 @@ 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/share_button_item_post_card_3_gallery_type" - app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_card_3_gallery_type" + style="?attr/materialIconButtonOutlinedStyle" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/save_button_item_post_card_3_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:strokeWidth="0dp" + app:iconSize="24dp" app:layout_constraintHorizontal_bias="1" - style="?attr/materialButtonOutlinedStyle" /> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/comments_count_button_item_post_card_3_gallery_type" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_card_3_gallery_type" + style="?attr/materialIconButtonOutlinedStyle" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/share_button_item_post_card_3_gallery_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + 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" + style="?attr/materialIconButtonOutlinedStyle" /> </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/layout/item_post_card_3_text.xml b/app/src/main/res/layout/item_post_card_3_text.xml index dbf9ac7e..88dc22d5 100644 --- a/app/src/main/res/layout/item_post_card_3_text.xml +++ b/app/src/main/res/layout/item_post_card_3_text.xml @@ -121,68 +121,49 @@ android:layout_height="wrap_content" android:padding="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_card_3_text_type" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_card_3_text_type" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_card_3_text_type" - 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/save_button_item_post_card_3_text_type" + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_card_3_text_type" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_card_3_text_type" - style="?attr/materialIconButtonOutlinedStyle" /> + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_card_3_text_type" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_card_3_text_type" /> <com.google.android.material.button.MaterialButton - android:id="@+id/share_button_item_post_card_3_text_type" + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_card_3_text_type" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" app:strokeWidth="0dp" - app:icon="@drawable/ic_share_grey_24dp" + app:icon="@drawable/ic_downvote_24dp" app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/save_button_item_post_card_3_text_type" - style="?attr/materialIconButtonOutlinedStyle" /> + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_3_text_type" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_card_3_text_type" @@ -195,15 +176,39 @@ 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/share_button_item_post_card_3_text_type" - app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_card_3_text_type" + style="?attr/materialIconButtonOutlinedStyle" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/save_button_item_post_card_3_text_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:strokeWidth="0dp" + app:iconSize="24dp" app:layout_constraintHorizontal_bias="1" - style="?attr/materialButtonOutlinedStyle" /> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/comments_count_button_item_post_card_3_text_type" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_card_3_text_type" + style="?attr/materialIconButtonOutlinedStyle" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/share_button_item_post_card_3_text_type" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + 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" + style="?attr/materialIconButtonOutlinedStyle" /> </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/layout/item_post_card_3_video_type_autoplay.xml b/app/src/main/res/layout/item_post_card_3_video_type_autoplay.xml index 52e55726..1fc8a3c4 100644 --- a/app/src/main/res/layout/item_post_card_3_video_type_autoplay.xml +++ b/app/src/main/res/layout/item_post_card_3_video_type_autoplay.xml @@ -143,68 +143,49 @@ android:layout_height="wrap_content" android:padding="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_card_3_video_type_autoplay" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_card_3_video_type_autoplay" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_card_3_video_type_autoplay" - 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/save_button_item_post_card_3_video_type_autoplay" + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_card_3_video_type_autoplay" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_card_3_video_type_autoplay" - style="?attr/materialIconButtonOutlinedStyle" /> + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_card_3_video_type_autoplay" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_card_3_video_type_autoplay" /> <com.google.android.material.button.MaterialButton - android:id="@+id/share_button_item_post_card_3_video_type_autoplay" + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_card_3_video_type_autoplay" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" app:strokeWidth="0dp" - app:icon="@drawable/ic_share_grey_24dp" + app:icon="@drawable/ic_downvote_24dp" app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/save_button_item_post_card_3_video_type_autoplay" - style="?attr/materialIconButtonOutlinedStyle" /> + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_3_video_type_autoplay" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_card_3_video_type_autoplay" @@ -217,15 +198,39 @@ 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/share_button_item_post_card_3_video_type_autoplay" - app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_card_3_video_type_autoplay" + style="?attr/materialIconButtonOutlinedStyle" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/save_button_item_post_card_3_video_type_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:strokeWidth="0dp" + app:iconSize="24dp" app:layout_constraintHorizontal_bias="1" - style="?attr/materialButtonOutlinedStyle" /> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/comments_count_button_item_post_card_3_video_type_autoplay" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_card_3_video_type_autoplay" + style="?attr/materialIconButtonOutlinedStyle" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/share_button_item_post_card_3_video_type_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + 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" + style="?attr/materialIconButtonOutlinedStyle" /> </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/layout/item_post_card_3_video_type_autoplay_legacy_controller.xml b/app/src/main/res/layout/item_post_card_3_video_type_autoplay_legacy_controller.xml index 9964bb2b..b100b032 100644 --- a/app/src/main/res/layout/item_post_card_3_video_type_autoplay_legacy_controller.xml +++ b/app/src/main/res/layout/item_post_card_3_video_type_autoplay_legacy_controller.xml @@ -143,68 +143,49 @@ android:layout_height="wrap_content" android:padding="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_card_3_video_type_autoplay" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_card_3_video_type_autoplay" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_card_3_video_type_autoplay" - 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/save_button_item_post_card_3_video_type_autoplay" + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_card_3_video_type_autoplay" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_card_3_video_type_autoplay" - style="?attr/materialIconButtonOutlinedStyle" /> + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_card_3_video_type_autoplay" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_card_3_video_type_autoplay" /> <com.google.android.material.button.MaterialButton - android:id="@+id/share_button_item_post_card_3_video_type_autoplay" + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_card_3_video_type_autoplay" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" app:strokeWidth="0dp" - app:icon="@drawable/ic_share_grey_24dp" + app:icon="@drawable/ic_downvote_24dp" app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/save_button_item_post_card_3_video_type_autoplay" - style="?attr/materialIconButtonOutlinedStyle" /> + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_3_video_type_autoplay" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_card_3_video_type_autoplay" @@ -217,15 +198,39 @@ 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/share_button_item_post_card_3_video_type_autoplay" - app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_card_3_video_type_autoplay" + style="?attr/materialIconButtonOutlinedStyle" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/save_button_item_post_card_3_video_type_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:strokeWidth="0dp" + app:iconSize="24dp" app:layout_constraintHorizontal_bias="1" - style="?attr/materialButtonOutlinedStyle" /> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/comments_count_button_item_post_card_3_video_type_autoplay" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_card_3_video_type_autoplay" + style="?attr/materialIconButtonOutlinedStyle" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/share_button_item_post_card_3_video_type_autoplay" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + 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" + style="?attr/materialIconButtonOutlinedStyle" /> </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/layout/item_post_card_3_with_preview.xml b/app/src/main/res/layout/item_post_card_3_with_preview.xml index 7efab154..dee7356e 100644 --- a/app/src/main/res/layout/item_post_card_3_with_preview.xml +++ b/app/src/main/res/layout/item_post_card_3_with_preview.xml @@ -240,9 +240,6 @@ android:layout_height="24dp" android:src="@drawable/ic_archive_outline" android:visibility="gone" /> - - <ImageView - android:id="@+id/locked_image_view_item_post_card_3_with_preview" android:layout_width="24dp" android:layout_height="24dp" android:src="@drawable/ic_outline_lock_24dp" @@ -263,68 +260,49 @@ android:layout_height="wrap_content" android:padding="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_card_3_with_preview" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_card_3_with_preview" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_card_3_with_preview" - 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/save_button_item_post_card_3_with_preview" + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_card_3_with_preview" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_card_3_with_preview" - style="?attr/materialIconButtonOutlinedStyle" /> + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_card_3_with_preview" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_card_3_with_preview" /> <com.google.android.material.button.MaterialButton - android:id="@+id/share_button_item_post_card_3_with_preview" + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_card_3_with_preview" android:layout_width="wrap_content" - android:layout_height="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" app:strokeWidth="0dp" - app:icon="@drawable/ic_share_grey_24dp" + app:icon="@drawable/ic_downvote_24dp" app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/save_button_item_post_card_3_with_preview" - style="?attr/materialIconButtonOutlinedStyle" /> + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_3_with_preview" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_card_3_with_preview" @@ -337,15 +315,39 @@ 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/share_button_item_post_card_3_with_preview" - app:layout_constraintEnd_toEndOf="parent" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_card_3_with_preview" + style="?attr/materialIconButtonOutlinedStyle" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/save_button_item_post_card_3_with_preview" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + app:strokeWidth="0dp" + app:iconSize="24dp" app:layout_constraintHorizontal_bias="1" - style="?attr/materialButtonOutlinedStyle" /> + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/comments_count_button_item_post_card_3_with_preview" + app:layout_constraintEnd_toStartOf="@id/share_button_item_post_card_3_with_preview" + style="?attr/materialIconButtonOutlinedStyle" /> + + <com.google.android.material.button.MaterialButton + android:id="@+id/share_button_item_post_card_3_with_preview" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + 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" + style="?attr/materialIconButtonOutlinedStyle" /> </androidx.constraintlayout.widget.ConstraintLayout> diff --git a/app/src/main/res/layout/item_post_compact.xml b/app/src/main/res/layout/item_post_compact.xml index 8bc6ee26..442c589a 100644 --- a/app/src/main/res/layout/item_post_compact.xml +++ b/app/src/main/res/layout/item_post_compact.xml @@ -286,45 +286,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_compact" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_compact" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> + app:layout_constraintTop_toTopOf="parent" /> - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_compact" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_compact" - 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" /> + <TextView + android:id="@+id/score_text_view_item_post_compact" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_compact" + app:layout_constraintTop_toTopOf="parent" /> - </com.google.android.material.button.MaterialButtonToggleGroup> + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_compact" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_compact" + app:layout_constraintTop_toTopOf="parent" /> <com.google.android.material.button.MaterialButton android:id="@+id/save_button_item_post_compact" @@ -334,7 +338,7 @@ app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_compact" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_compact" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_compact_right_thumbnail.xml b/app/src/main/res/layout/item_post_compact_right_thumbnail.xml index b2db13b7..b973ffe3 100644 --- a/app/src/main/res/layout/item_post_compact_right_thumbnail.xml +++ b/app/src/main/res/layout/item_post_compact_right_thumbnail.xml @@ -283,45 +283,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_compact_right_thumbnail" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_compact_right_thumbnail" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> + app:layout_constraintTop_toTopOf="parent" /> - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_compact_right_thumbnail" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_compact_right_thumbnail" - 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" /> + <TextView + android:id="@+id/score_text_view_item_post_compact_right_thumbnail" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_compact_right_thumbnail" + app:layout_constraintTop_toTopOf="parent" /> - </com.google.android.material.button.MaterialButtonToggleGroup> + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_compact_right_thumbnail" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_compact_right_thumbnail" + app:layout_constraintTop_toTopOf="parent" /> <com.google.android.material.button.MaterialButton android:id="@+id/save_button_item_post_compact_right_thumbnail" @@ -331,7 +335,7 @@ app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_compact_right_thumbnail" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_compact_right_thumbnail" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton 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 d9016438..0148dd87 100644 --- a/app/src/main/res/layout/item_post_detail_gallery.xml +++ b/app/src/main/res/layout/item_post_detail_gallery.xml @@ -253,45 +253,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_detail_gallery" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_detail_gallery" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_detail_gallery" - 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> + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_detail_gallery" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_detail_gallery" + app:layout_constraintTop_toTopOf="parent" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_detail_gallery" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_gallery" + app:layout_constraintTop_toTopOf="parent" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_detail_gallery" @@ -310,7 +314,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_detail_gallery" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_detail_gallery" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_detail_image_and_gif_autoplay.xml b/app/src/main/res/layout/item_post_detail_image_and_gif_autoplay.xml index b71ae921..e3294db6 100644 --- a/app/src/main/res/layout/item_post_detail_image_and_gif_autoplay.xml +++ b/app/src/main/res/layout/item_post_detail_image_and_gif_autoplay.xml @@ -258,45 +258,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_detail_image_and_gif_autoplay" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_detail_image_and_gif_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> + app:layout_constraintTop_toTopOf="parent" /> - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_detail_image_and_gif_autoplay" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_detail_image_and_gif_autoplay" - 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" /> + <TextView + android:id="@+id/score_text_view_item_post_detail_image_and_gif_autoplay" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_detail_image_and_gif_autoplay" + app:layout_constraintTop_toTopOf="parent" /> - </com.google.android.material.button.MaterialButtonToggleGroup> + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_detail_image_and_gif_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_image_and_gif_autoplay" + app:layout_constraintTop_toTopOf="parent" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_detail_image_and_gif_autoplay" @@ -315,7 +319,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_detail_image_and_gif_autoplay" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_detail_image_and_gif_autoplay" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_detail_link.xml b/app/src/main/res/layout/item_post_detail_link.xml index 4074f4b4..5b0dcb03 100644 --- a/app/src/main/res/layout/item_post_detail_link.xml +++ b/app/src/main/res/layout/item_post_detail_link.xml @@ -268,45 +268,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_detail_link" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_detail_link" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> + app:layout_constraintTop_toTopOf="parent" /> - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_detail_link" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_detail_link" - 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" /> + <TextView + android:id="@+id/score_text_view_item_post_detail_link" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_detail_link" + app:layout_constraintTop_toTopOf="parent" /> - </com.google.android.material.button.MaterialButtonToggleGroup> + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_detail_link" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_link" + app:layout_constraintTop_toTopOf="parent" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_detail_link" @@ -325,7 +329,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_detail_link" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_detail_link" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_detail_no_preview.xml b/app/src/main/res/layout/item_post_detail_no_preview.xml index b460f0d7..f1d47fde 100644 --- a/app/src/main/res/layout/item_post_detail_no_preview.xml +++ b/app/src/main/res/layout/item_post_detail_no_preview.xml @@ -235,45 +235,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_detail_no_preview" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_detail_no_preview" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_detail_no_preview" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_detail_no_preview" - 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> + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_detail_no_preview" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_detail_no_preview" + app:layout_constraintTop_toTopOf="parent" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_detail_no_preview" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_no_preview" + app:layout_constraintTop_toTopOf="parent" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_detail_no_preview" @@ -292,7 +296,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_detail_no_preview" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_detail_no_preview" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_detail_text.xml b/app/src/main/res/layout/item_post_detail_text.xml index 625a598d..8ef8cf2e 100644 --- a/app/src/main/res/layout/item_post_detail_text.xml +++ b/app/src/main/res/layout/item_post_detail_text.xml @@ -219,45 +219,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_detail_text" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_detail_text" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_detail_text" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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" /> + app:layout_constraintTop_toTopOf="parent" /> - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/downvote_button_item_post_detail_text" - 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" /> + <TextView + android:id="@+id/score_text_view_item_post_detail_text" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_detail_text" + app:layout_constraintTop_toTopOf="parent" /> - </com.google.android.material.button.MaterialButtonToggleGroup> + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_detail_text" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_text" + app:layout_constraintTop_toTopOf="parent" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_detail_text" @@ -276,7 +280,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_detail_text" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_detail_text" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton 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 8a7c8044..f6caee7b 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 @@ -271,45 +271,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_detail_video_and_gif_preview" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_detail_video_and_gif_preview" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> + app:layout_constraintTop_toTopOf="parent" /> - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_detail_video_and_gif_preview" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_detail_video_and_gif_preview" - 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" /> + <TextView + android:id="@+id/score_text_view_item_post_detail_video_and_gif_preview" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_detail_video_and_gif_preview" + app:layout_constraintTop_toTopOf="parent" /> - </com.google.android.material.button.MaterialButtonToggleGroup> + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_detail_video_and_gif_preview" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_video_and_gif_preview" + app:layout_constraintTop_toTopOf="parent" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_detail_video_and_gif_preview" @@ -328,7 +332,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_detail_video_and_gif_preview" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_detail_video_and_gif_preview" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_detail_video_autoplay.xml b/app/src/main/res/layout/item_post_detail_video_autoplay.xml index 69af5ffd..c5494153 100644 --- a/app/src/main/res/layout/item_post_detail_video_autoplay.xml +++ b/app/src/main/res/layout/item_post_detail_video_autoplay.xml @@ -252,45 +252,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_detail_video_autoplay" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_detail_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_detail_video_autoplay" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_detail_video_autoplay" - 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> + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_detail_video_autoplay" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_detail_video_autoplay" + app:layout_constraintTop_toTopOf="parent" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_detail_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_video_autoplay" + app:layout_constraintTop_toTopOf="parent" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_detail_video_autoplay" @@ -309,7 +313,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_detail_video_autoplay" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_detail_video_autoplay" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml b/app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml index 36400f28..5f68e177 100644 --- a/app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml +++ b/app/src/main/res/layout/item_post_detail_video_autoplay_legacy_controller.xml @@ -253,45 +253,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_detail_video_autoplay" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_detail_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" - app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_detail_video_autoplay" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_detail_video_autoplay" - 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> + app:layout_constraintTop_toTopOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_detail_video_autoplay" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:fontFamily="?attr/font_family" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_detail_video_autoplay" + app:layout_constraintTop_toTopOf="parent" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_detail_video_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_detail_video_autoplay" + app:layout_constraintTop_toTopOf="parent" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_detail_video_autoplay" @@ -310,7 +314,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_detail_video_autoplay" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_detail_video_autoplay" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_gallery_type.xml b/app/src/main/res/layout/item_post_gallery_type.xml index 96433b2a..b1ba5d4b 100644 --- a/app/src/main/res/layout/item_post_gallery_type.xml +++ b/app/src/main/res/layout/item_post_gallery_type.xml @@ -237,45 +237,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_gallery_type" - android:layout_width="0dp" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_gallery_type" + android:layout_width="64dp" android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" + android:gravity="center" + android:textSize="?attr/font_12" + android:textStyle="bold" + android:fontFamily="?attr/font_family" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_gallery_type" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_gallery_type" - 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> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_gallery_type" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_gallery_type" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_gallery_type" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_gallery_type" @@ -294,7 +298,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_gallery_type" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_gallery_type" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_text.xml b/app/src/main/res/layout/item_post_text.xml index 04888639..acd9d288 100644 --- a/app/src/main/res/layout/item_post_text.xml +++ b/app/src/main/res/layout/item_post_text.xml @@ -216,45 +216,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_text_type" - android:layout_width="0dp" - android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_text_type" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_text_type" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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" /> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/downvote_button_item_post_text_type" - 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" /> + <TextView + android:id="@+id/score_text_view_item_post_text_type" + android:layout_width="64dp" + android:layout_height="wrap_content" + android:gravity="center" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:textStyle="bold" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_text_type" /> - </com.google.android.material.button.MaterialButtonToggleGroup> + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_text_type" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_text_type" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_text_type" @@ -273,7 +277,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_text_type" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_text_type" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_video_type_autoplay.xml b/app/src/main/res/layout/item_post_video_type_autoplay.xml index cd4c7b2d..7f0b6835 100644 --- a/app/src/main/res/layout/item_post_video_type_autoplay.xml +++ b/app/src/main/res/layout/item_post_video_type_autoplay.xml @@ -237,45 +237,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_video_type_autoplay" - android:layout_width="0dp" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_video_type_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_video_type_autoplay" + android:layout_width="64dp" android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" + android:gravity="center" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:textStyle="bold" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_video_type_autoplay" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_video_type_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_video_type_autoplay" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_video_type_autoplay" - 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> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_video_type_autoplay" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_video_type_autoplay" @@ -294,7 +298,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_video_type_autoplay" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_video_type_autoplay" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml b/app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml index 92195e89..5b11444a 100644 --- a/app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml +++ b/app/src/main/res/layout/item_post_video_type_autoplay_legacy_controller.xml @@ -237,45 +237,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_video_type_autoplay" - android:layout_width="0dp" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_video_type_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_video_type_autoplay" + android:layout_width="64dp" android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" + android:gravity="center" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:textStyle="bold" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_video_type_autoplay" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_video_type_autoplay" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_video_type_autoplay" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_video_type_autoplay" - 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> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_video_type_autoplay" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_video_type_autoplay" @@ -294,7 +298,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_video_type_autoplay" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_video_type_autoplay" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton diff --git a/app/src/main/res/layout/item_post_with_preview.xml b/app/src/main/res/layout/item_post_with_preview.xml index 468cc882..880487fd 100644 --- a/app/src/main/res/layout/item_post_with_preview.xml +++ b/app/src/main/res/layout/item_post_with_preview.xml @@ -261,45 +261,49 @@ android:paddingStart="8dp" android:paddingEnd="8dp"> - <com.google.android.material.button.MaterialButtonToggleGroup - android:id="@+id/vote_button_toggle_item_post_with_preview" - android:layout_width="0dp" + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/upvote_button_item_post_with_preview" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_upvote_24dp" + app:iconSize="24dp" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> + + <TextView + android:id="@+id/score_text_view_item_post_with_preview" + android:layout_width="64dp" android:layout_height="wrap_content" - app:singleSelection="true" - app:layout_constraintStart_toStartOf="parent" + android:gravity="center" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:textStyle="bold" + app:layout_constraintTop_toTopOf="parent" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_with_preview" /> + + <com.google.android.material.button.MaterialButton + style="?attr/materialIconButtonStyle" + android:id="@+id/downvote_button_item_post_with_preview" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:paddingStart="8dp" + android:paddingEnd="8dp" + android:minWidth="0dp" + android:backgroundTint="#00000000" + app:strokeWidth="0dp" + app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" - app:layout_constraintBottom_toBottomOf="parent"> - - <com.google.android.material.button.MaterialButton - style="?attr/materialButtonOutlinedStyle" - android:id="@+id/upvote_button_item_post_with_preview" - android:layout_width="wrap_content" - android:layout_height="match_parent" - android:paddingStart="8dp" - android:paddingEnd="8dp" - android:minWidth="0dp" - 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_item_post_with_preview" - 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> + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_with_preview" /> <com.google.android.material.button.MaterialButton android:id="@+id/comments_count_button_item_post_with_preview" @@ -318,7 +322,7 @@ app:iconPadding="12dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" - app:layout_constraintStart_toEndOf="@id/vote_button_toggle_item_post_with_preview" + app:layout_constraintStart_toEndOf="@id/downvote_button_item_post_with_preview" style="?attr/materialIconButtonOutlinedStyle" /> <com.google.android.material.button.MaterialButton |