Archie
08/30/2020, 1:41 PM<style name="MyTheme" parent="Theme.MaterialComponents.DayNight.NoActionBar">
...
<item name="materialButtonStyle">@style/Widget.MyButton</item>
<item name="materialButtonOutlinedStyle">@style/Widget.MyButton.Outlined</item>
...
</style>
<!--Buttons Styles-->
<style name="ThemeOverlay.MyButton" parent="">
...
<item name="colorPrimary">@color/mycolor</item>
<item name="colorOnPrimary">@color/myOnColor</item>
...
</style>
<style name="Widget.MyButton" parent="Widget.MaterialComponents.Button">
<item name="materialThemeOverlay">@style/ThemeOverlay.MyButton</item>
...
</style>
....
But in Jetpack Compose
there is no styles
to set. Is it correct to instead of using the Button
directly, simply create a "`MyButton` " and use it instead like:
@Composable
fun MyButton(
....
modifier = Modifier,
) {
Button(modifier = modifier.backgroundColor(myColor)
....
}
or is there a better and correct way to do this?nickbutcher
08/30/2020, 1:45 PMArchie
08/30/2020, 1:47 PMIan Lake
08/30/2020, 3:44 PMArchie
09/06/2020, 5:05 PM