Set drawable size in code
This commit is contained in:
parent
fead93ddf7
commit
8bc6659d71
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:width="@dimen/small_icon_size"
|
||||
android:height="@dimen/small_icon_size"
|
||||
android:drawable="@drawable/ic_clock_vector" />
|
||||
|
||||
</layer-list>
|
Loading…
Reference in New Issue