From c63afc809743e22bbfd9830c8fb6c0f8147786d6 Mon Sep 17 00:00:00 2001 From: 0xd9a <0xd9a@noreply.codeberg.org> Date: Sat, 24 Dec 2022 16:20:21 +0530 Subject: [PATCH] Use 'chip' for description button in compose --- .../android/ui/drawer/ComposeAdapter.java | 12 +++++------ .../res/layout/compose_attachment_item.xml | 21 ++++++++----------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java index 88ae84242..3938b4fc3 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/ComposeAdapter.java @@ -1156,15 +1156,15 @@ public class ComposeAdapter extends RecyclerView.Adapter displayAttachments(holder, position, finalMediaPosition)); if (attachment.description == null || attachment.description.trim().isEmpty()) { - composeAttachmentItemBinding.buttonDescription.setIconResource(R.drawable.ic_baseline_warning_24); + composeAttachmentItemBinding.buttonDescription.setChipIconResource(R.drawable.ic_baseline_warning_24); composeAttachmentItemBinding.buttonDescription.setTextColor(ContextCompat.getColor(context, R.color.black)); - composeAttachmentItemBinding.buttonDescription.setIconTintResource(R.color.black); - composeAttachmentItemBinding.buttonDescription.setBackgroundTintList(ThemeHelper.getNoDescriptionColorStateList(context)); + composeAttachmentItemBinding.buttonDescription.setChipIconTintResource(R.color.black); + composeAttachmentItemBinding.buttonDescription.setChipBackgroundColor(ThemeHelper.getNoDescriptionColorStateList(context)); } else { - composeAttachmentItemBinding.buttonDescription.setIconResource(R.drawable.ic_baseline_check_circle_24); + composeAttachmentItemBinding.buttonDescription.setChipIconResource(R.drawable.ic_baseline_check_circle_24); composeAttachmentItemBinding.buttonDescription.setTextColor(ContextCompat.getColor(context, R.color.white)); - composeAttachmentItemBinding.buttonDescription.setIconTintResource(R.color.white); - composeAttachmentItemBinding.buttonDescription.setBackgroundTintList(ThemeHelper.getHavingDescriptionColorStateList(context)); + composeAttachmentItemBinding.buttonDescription.setChipIconTintResource(R.color.white); + composeAttachmentItemBinding.buttonDescription.setChipBackgroundColor(ThemeHelper.getHavingDescriptionColorStateList(context)); } holder.binding.attachmentsList.addView(composeAttachmentItemBinding.getRoot()); mediaPosition++; diff --git a/app/src/main/res/layout/compose_attachment_item.xml b/app/src/main/res/layout/compose_attachment_item.xml index ebf9c3b08..4beca2ea6 100644 --- a/app/src/main/res/layout/compose_attachment_item.xml +++ b/app/src/main/res/layout/compose_attachment_item.xml @@ -25,14 +25,14 @@ + app:layout_constraintTop_toTopOf="@id/preview" + app:srcCompat="@drawable/ic_compose_attachment_play" /> - + app:layout_constraintTop_toBottomOf="@id/preview" + app:textEndPadding="0dp" />