From 8bc6659d7190b7cea950b3f99ee01aae6be87f28 Mon Sep 17 00:00:00 2001 From: Naveen Date: Tue, 22 Aug 2023 14:27:40 +0530 Subject: [PATCH] Set drawable size in code --- .../smsmessenger/adapters/ThreadAdapter.kt | 12 ++++++++---- app/src/main/res/drawable/scheduled_message_icon.xml | 9 --------- 2 files changed, 8 insertions(+), 13 deletions(-) delete mode 100644 app/src/main/res/drawable/scheduled_message_icon.xml diff --git a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ThreadAdapter.kt b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ThreadAdapter.kt index 443eb13b..4018aa98 100644 --- a/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ThreadAdapter.kt +++ b/app/src/main/kotlin/com/simplemobiletools/smsmessenger/adapters/ThreadAdapter.kt @@ -384,12 +384,16 @@ class ThreadAdapter( if (message.isScheduled) { typeface = Typeface.create(Typeface.DEFAULT, Typeface.ITALIC) - val scheduledDrawable = AppCompatResources.getDrawable(activity, R.drawable.scheduled_message_icon) - scheduledDrawable?.applyColorFilter(contrastColor) - setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, scheduledDrawable, null) + val scheduledDrawable = AppCompatResources.getDrawable(activity, R.drawable.ic_clock_vector)?.apply { + applyColorFilter(contrastColor) + val size = lineHeight + setBounds(0, 0, size, size) + } + + setCompoundDrawables(null, null, scheduledDrawable, null) } else { typeface = Typeface.DEFAULT - setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, null, null) + setCompoundDrawables(null, null, null, null) } } } diff --git a/app/src/main/res/drawable/scheduled_message_icon.xml b/app/src/main/res/drawable/scheduled_message_icon.xml deleted file mode 100644 index a04d784d..00000000 --- a/app/src/main/res/drawable/scheduled_message_icon.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - -