Do not hardcode appcompat widget classes

They should be handled by the theme
This commit is contained in:
topjohnwu
2020-08-19 02:45:14 -07:00
parent 6d749a58c6
commit 1fcf35ebeb
23 changed files with 55 additions and 49 deletions
@@ -199,6 +199,11 @@ fun Button.setIconRes(res: Int) {
(this as MaterialButton).setIconResource(res)
}
@BindingAdapter("app:icon")
fun Button.setIcon(drawable: Drawable) {
(this as MaterialButton).icon = drawable
}
@BindingAdapter("strokeWidth")
fun MaterialCardView.setCardStrokeWidthBound(stroke: Float) {
strokeWidth = stroke.roundToInt()