Philip S
08/16/2022, 11:51 AMTextButton
? In my image the left one gets a dark grey colour when pressed. I would like to change it so something arbitrary, like say red.Louis Pullen-Freilich [G]
08/16/2022, 11:59 AMPhilip S
08/16/2022, 12:08 PMCompositionLocalProvider(LocalRippleTheme provides object : RippleTheme {
@Composable
override fun defaultColor(): Color {
return RippleTheme.defaultRippleColor(Color.Red, true)
}
@Composable
override fun rippleAlpha(): RippleAlpha {
return RippleAlpha(0f, 0f, 0f, 255f)
}
}) {
//Your button here
}
Louis Pullen-Freilich [G]
08/16/2022, 12:10 PMLouis Pullen-Freilich [G]
08/16/2022, 12:11 PMPhilip S
08/16/2022, 12:17 PMTextButton
is there an other color i need to set aswell? In case i want to follow the Material standardYusuf Wagh
08/16/2022, 12:21 PMInteractionSource.collectIsPressedAsState()
using above func you can observe button state change ...
val isPressed by collectIsPressedAsState()
after that you can update colors based on state the
ButtonDefaults.buttonColors(///)
Louis Pullen-Freilich [G]
08/16/2022, 8:20 PMYusuf Wagh
08/16/2022, 11:18 PM