From 7c6ee5beba83522ad49b54a3fdfdf6d03de107ba Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Mon, 23 Oct 2023 00:29:08 -0400 Subject: Center the score of a post. Switch the number of comment and the share button back. --- .../adapters/HistoryPostRecyclerViewAdapter.java | 260 +++++++++++---------- .../adapters/PostDetailRecyclerViewAdapter.java | 106 ++++----- .../adapters/PostRecyclerViewAdapter.java | 247 +++++++++++--------- .../res/layout/item_post_card_2_gallery_type.xml | 78 ++++--- app/src/main/res/layout/item_post_card_2_text.xml | 78 ++++--- .../res/layout/item_post_card_2_video_autoplay.xml | 78 ++++--- ...ost_card_2_video_autoplay_legacy_controller.xml | 78 ++++--- .../res/layout/item_post_card_2_with_preview.xml | 80 ++++--- .../res/layout/item_post_card_3_gallery_type.xml | 109 ++++----- app/src/main/res/layout/item_post_card_3_text.xml | 109 ++++----- .../item_post_card_3_video_type_autoplay.xml | 109 ++++----- ...ard_3_video_type_autoplay_legacy_controller.xml | 109 ++++----- .../res/layout/item_post_card_3_with_preview.xml | 112 ++++----- app/src/main/res/layout/item_post_compact.xml | 78 ++++--- .../layout/item_post_compact_right_thumbnail.xml | 78 ++++--- .../main/res/layout/item_post_detail_gallery.xml | 82 +++---- .../item_post_detail_image_and_gif_autoplay.xml | 78 ++++--- app/src/main/res/layout/item_post_detail_link.xml | 78 ++++--- .../res/layout/item_post_detail_no_preview.xml | 82 +++---- app/src/main/res/layout/item_post_detail_text.xml | 78 ++++--- .../item_post_detail_video_and_gif_preview.xml | 78 ++++--- .../res/layout/item_post_detail_video_autoplay.xml | 82 +++---- ...ost_detail_video_autoplay_legacy_controller.xml | 82 +++---- app/src/main/res/layout/item_post_gallery_type.xml | 80 ++++--- app/src/main/res/layout/item_post_text.xml | 78 ++++--- .../res/layout/item_post_video_type_autoplay.xml | 80 ++++--- ..._post_video_type_autoplay_legacy_controller.xml | 80 ++++--- app/src/main/res/layout/item_post_with_preview.xml | 80 ++++--- 28 files changed, 1452 insertions(+), 1295 deletions(-) (limited to 'app/src/main') 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 { + upvoteButton.performClick(); + }); + downvoteButton.setOnClickListener(view -> { int position = getBindingAdapterPosition(); if (position < 0) { @@ -2943,6 +2954,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter { + upvoteButton.performClick(); + }); + downvoteButton.setOnClickListener(view -> { int position = getBindingAdapterPosition(); if (position < 0) { @@ -5615,13 +5645,13 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter { + 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 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 { + upvoteButton.performClick(); + }); + downvoteButton.setOnClickListener(view -> { int position = getBindingAdapterPosition(); if (position < 0) { @@ -3077,13 +3091,13 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter - + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> - - - + - + - - - + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> - + - + - + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> - - - + - + - + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> - - - + - + - + + - - - - - - + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_card_2_with_preview" /> + + - - - - - - - - + app:layout_constraintStart_toStartOf="parent" /> + + + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_3_gallery_type" /> + + + 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" /> + + 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"> - - - - - - - - + app:layout_constraintStart_toStartOf="parent" /> + + + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_3_text_type" /> + + + 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" /> + + 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"> - - - - - - - - + app:layout_constraintStart_toStartOf="parent" /> + + + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_3_video_type_autoplay" /> + + + 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" /> + + 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"> - - - - - - - - + app:layout_constraintStart_toStartOf="parent" /> + + + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_3_video_type_autoplay" /> + + + 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" /> + + 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" /> - - - - - - - - - - + app:layout_constraintStart_toStartOf="parent" /> + + + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_card_3_with_preview" /> + + + 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" /> + + 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"> - + app:layout_constraintTop_toTopOf="parent" /> - - - + - + - + app:layout_constraintTop_toTopOf="parent" /> - - - + - + - - - - - - - + app:layout_constraintTop_toTopOf="parent" /> + + + + - + app:layout_constraintTop_toTopOf="parent" /> - - - + - + - + app:layout_constraintTop_toTopOf="parent" /> - - - + - + - - - - - - - + app:layout_constraintTop_toTopOf="parent" /> + + + + - - - + app:layout_constraintTop_toTopOf="parent" /> - + - + - + app:layout_constraintTop_toTopOf="parent" /> - - - + - + - - - - - - - + app:layout_constraintTop_toTopOf="parent" /> + + + + - - - - - - - + app:layout_constraintTop_toTopOf="parent" /> + + + + - + + - - - - - - + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/upvote_button_item_post_gallery_type" /> + + - - - + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" /> - + - + - + + + + - - - - - - + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_video_type_autoplay" /> - + + + + - - - - - - + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_video_type_autoplay" /> - + + + + - - - - - - + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toEndOf="@id/score_text_view_item_post_with_preview" />