diff options
author | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-09-11 20:26:19 +0000 |
---|---|---|
committer | Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> | 2023-09-11 20:26:19 +0000 |
commit | 5e81ac03816846d44f376fc50a04dadd59c7e996 (patch) | |
tree | c4e5fdcee73bf66e076a7edf0ff0f516c7e32235 /app/src/main | |
parent | 1eb00f2a675599e213fd2579e1446a2c222063b8 (diff) | |
download | infinity-for-reddit-5e81ac03816846d44f376fc50a04dadd59c7e996.tar infinity-for-reddit-5e81ac03816846d44f376fc50a04dadd59c7e996.tar.gz infinity-for-reddit-5e81ac03816846d44f376fc50a04dadd59c7e996.tar.bz2 infinity-for-reddit-5e81ac03816846d44f376fc50a04dadd59c7e996.tar.lz infinity-for-reddit-5e81ac03816846d44f376fc50a04dadd59c7e996.tar.xz infinity-for-reddit-5e81ac03816846d44f376fc50a04dadd59c7e996.tar.zst infinity-for-reddit-5e81ac03816846d44f376fc50a04dadd59c7e996.zip |
Continue adding Card Layout 3.
Diffstat (limited to '')
-rw-r--r-- | app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java | 15 | ||||
-rw-r--r-- | app/src/main/res/layout/item_post_card_3_with_preview.xml | 27 |
2 files changed, 27 insertions, 15 deletions
diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java index c9d96cef..17d3e930 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/PostRecyclerViewAdapter.java @@ -1784,11 +1784,15 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie switch (post.getVoteType()) { case 1: //Upvoted - ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setBackgroundTintList(ColorStateList.valueOf(mUpvotedColor)); + ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setTextColor(mUpvotedColor); + ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_filled_24dp); + ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mUpvotedColor)); break; case -1: //Downvoted - ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setBackgroundTintList(ColorStateList.valueOf(mDownvotedColor)); + ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setTextColor(mDownvotedColor); + ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_filled_24dp); + ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mDownvotedColor)); break; } @@ -2697,9 +2701,12 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie ((PostMaterial3CardBaseViewHolder) holder).flairTextView.setVisibility(View.GONE); ((PostMaterial3CardBaseViewHolder) holder).awardsTextView.setText(""); ((PostMaterial3CardBaseViewHolder) holder).awardsTextView.setVisibility(View.GONE); - ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setBackgroundTintList(ColorStateList.valueOf(mPostIconAndInfoColor)); ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setTextColor(mPostIconAndInfoColor); - ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setBackgroundTintList(ColorStateList.valueOf(mPostIconAndInfoColor)); + ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconResource(R.drawable.ic_upvote_24dp); + ((PostMaterial3CardBaseViewHolder) holder).upvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); + ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setTextColor(mPostIconAndInfoColor); + ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconResource(R.drawable.ic_downvote_24dp); + ((PostMaterial3CardBaseViewHolder) holder).downvoteButton.setIconTint(ColorStateList.valueOf(mPostIconAndInfoColor)); } } 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 ca3492da..84b61f89 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 @@ -65,6 +65,17 @@ android:scaleType="center" android:visibility="gone" /> + <TextView + android:id="@+id/link_text_view_item_post_with_preview" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:paddingStart="16dp" + android:paddingEnd="16dp" + android:textSize="?attr/font_12" + android:fontFamily="?attr/font_family" + android:visibility="gone" /> + <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="wrap_content" @@ -143,16 +154,6 @@ </androidx.constraintlayout.widget.ConstraintLayout> <TextView - android:id="@+id/link_text_view_item_post_with_preview" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:paddingStart="16dp" - android:paddingEnd="16dp" - android:textSize="?attr/font_12" - android:fontFamily="?attr/font_family" - android:visibility="gone" /> - - <TextView android:id="@+id/title_text_view_item_post_with_preview" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -284,6 +285,7 @@ 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 @@ -296,6 +298,7 @@ android:minWidth="0dp" app:strokeWidth="0dp" app:icon="@drawable/ic_downvote_24dp" + app:iconSize="24dp" android:backgroundTint="#00000000" /> </com.google.android.material.button.MaterialButtonToggleGroup> @@ -304,8 +307,8 @@ android:id="@+id/save_button_item_post_with_preview" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_marginStart="16dp" app:strokeWidth="0dp" + 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" @@ -317,6 +320,7 @@ 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_constraintStart_toEndOf="@id/save_button_item_post_with_preview" @@ -334,6 +338,7 @@ android:fontFamily="?attr/font_family" app:strokeWidth="0dp" app:iconTint="@null" + app:iconSize="24dp" app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toEndOf="@id/share_button_item_post_with_preview" |