Style set to MaterialButton has no effect
Hey there, I'm using splitties and I wanted to use filledUnelevated MaterialButton, but I need to remove insetTop and insetBottom.
// create button with applied theme
private val materialStyles = MaterialComponentsStyles(ctx)
private val customButton = materialStyles.button.filledUnelevated(theme = R.style.PinButton)
// styles.xml
<style name="PinButton">
<item name="android:height">50dp</item>
<item name="android:insetTop">0dp</item>
<item name="android:insetBottom">0dp</item>
</style>
Unfortunately parameters from style are not applied. Maybe i'm doing something wrong, if there is a way to change inset values I would love some code. Otherwise, here is a bug
Hi, xml styles don't support programmatic usage (unless you hack deep like I did to integrate styles from Material Components, as documented in Splitties Views DSL README). You need to set the insets programmatically, in Kotlin (or Java if you dare). Also, I don't think android:height is an existing attribute for view styles, maybe you are looking for minHeight/minimumHeight, or height from ViewGroup.LayoutParams?