Are there any alternatives for Indication (other t...
# compose
a
Are there any alternatives for Indication (other than Ripple)? Any tutorials on how to create and old-school “selectable” solution with different colors?
a
Thanks!
This solution works to give a consistent color to the Press-action. I would need to set the Pressed-color based on the the actual buttons background color. This could of course be achieved by creating different implementations of an Indication but a color-pick option would be better.
l
If you want something like that, then maybe you don’t want indication, and you just want the
Button
itself to change how it appears when pressed
You can do something like:
Copy code
val isPressed = interactionSource.collectIsPressedAsState()
val buttonBackgroundColor = if (isPressed) ... else ...
🙏 1
Indication
is more for a generic effect that is shown across clickable elements, not for per-component behavior or appearance changes