Fix visibility for description warning

This commit is contained in:
Thomas 2022-12-10 19:01:02 +01:00
parent 2ec7142561
commit 7fc8f96eef
4 changed files with 14 additions and 16 deletions

View File

@ -1038,16 +1038,14 @@ public class ComposeAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder
composeAttachmentItemBinding.preview.setOnClickListener(v -> displayAttachments(holder, position, finalMediaPosition));
if (attachment.description == null || attachment.description.trim().isEmpty()) {
composeAttachmentItemBinding.buttonDescription.setIconResource(R.drawable.ic_baseline_warning_24);
composeAttachmentItemBinding.buttonDescription.setStrokeColor(ThemeHelper.getNoDescriptionColorStateList(context));
composeAttachmentItemBinding.buttonDescription.setTextColor(ContextCompat.getColor(context, R.color.no_description));
Helper.changeDrawableColor(context, R.drawable.ic_baseline_warning_24, ContextCompat.getColor(context, R.color.no_description));
composeAttachmentItemBinding.buttonDescription.setIconTint(ThemeHelper.getNoDescriptionColorStateList(context));
composeAttachmentItemBinding.buttonDescription.setTextColor(ContextCompat.getColor(context, R.color.black));
composeAttachmentItemBinding.buttonDescription.setIconTintResource(R.color.black);
composeAttachmentItemBinding.buttonDescription.setBackgroundTintList(ThemeHelper.getNoDescriptionColorStateList(context));
} else {
composeAttachmentItemBinding.buttonDescription.setIconTint(ThemeHelper.getHavingDescriptionColorStateList(context));
composeAttachmentItemBinding.buttonDescription.setIconResource(R.drawable.ic_baseline_check_circle_24);
composeAttachmentItemBinding.buttonDescription.setTextColor(ContextCompat.getColor(context, R.color.having_description));
composeAttachmentItemBinding.buttonDescription.setStrokeColor(ThemeHelper.getHavingDescriptionColorStateList(context));
Helper.changeDrawableColor(context, R.drawable.ic_baseline_check_circle_24, ContextCompat.getColor(context, R.color.having_description));
composeAttachmentItemBinding.buttonDescription.setTextColor(ContextCompat.getColor(context, R.color.white));
composeAttachmentItemBinding.buttonDescription.setIconTintResource(R.color.white);
composeAttachmentItemBinding.buttonDescription.setBackgroundTintList(ThemeHelper.getHavingDescriptionColorStateList(context));
}
holder.binding.attachmentsList.addView(composeAttachmentItemBinding.getRoot());
mediaPosition++;

View File

@ -1,7 +1,7 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="@color/having_description"
android:tint="?colorControlNormal"
android:viewportWidth="24"
android:viewportHeight="24">
<path

View File

@ -1,10 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:tint="@color/no_description"
android:tint="@color/black"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:fillColor="@color/black"
android:pathData="M1,21h22L12,2 1,21zM13,18h-2v-2h2v2zM13,14h-2v-4h2v4z" />
</vector>

View File

@ -80,21 +80,21 @@
<com.google.android.material.button.MaterialButton
android:id="@+id/button_description"
style="@style/Widget.Material3.Button.OutlinedButton"
style="@style/Widget.Material3.Button"
android:layout_width="match_parent"
android:layout_height="48dp"
android:layout_marginStart="2dp"
android:layout_marginEnd="2dp"
android:text="@string/description"
android:textColor="@color/black"
android:textAlignment="textStart"
android:textColor="@color/no_description"
app:backgroundTint="@color/no_description"
app:icon="@drawable/ic_baseline_warning_24"
app:iconTint="@color/no_description"
app:iconGravity="end"
app:iconTint="@color/black"
app:layout_constraintEnd_toStartOf="@id/button_order_down"
app:layout_constraintStart_toEndOf="@id/button_order_up"
app:layout_constraintTop_toBottomOf="@id/preview"
app:strokeColor="@color/no_description" />
app:layout_constraintTop_toBottomOf="@id/preview" />
<com.google.android.material.button.MaterialButton