Set drawable size in code
This commit is contained in:
parent
fead93ddf7
commit
8bc6659d71
|
@ -384,12 +384,16 @@ class ThreadAdapter(
|
||||||
|
|
||||||
if (message.isScheduled) {
|
if (message.isScheduled) {
|
||||||
typeface = Typeface.create(Typeface.DEFAULT, Typeface.ITALIC)
|
typeface = Typeface.create(Typeface.DEFAULT, Typeface.ITALIC)
|
||||||
val scheduledDrawable = AppCompatResources.getDrawable(activity, R.drawable.scheduled_message_icon)
|
val scheduledDrawable = AppCompatResources.getDrawable(activity, R.drawable.ic_clock_vector)?.apply {
|
||||||
scheduledDrawable?.applyColorFilter(contrastColor)
|
applyColorFilter(contrastColor)
|
||||||
setCompoundDrawablesRelativeWithIntrinsicBounds(null, null, scheduledDrawable, null)
|
val size = lineHeight
|
||||||
|
setBounds(0, 0, size, size)
|
||||||
|
}
|
||||||
|
|
||||||
|
setCompoundDrawables(null, null, scheduledDrawable, null)
|
||||||
} else {
|
} else {
|
||||||
typeface = Typeface.DEFAULT
|
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