Adrian Landborn

    Adrian Landborn

    1 year ago
    Are there any alternatives for Indication (other than Ripple)? Any tutorials on how to create and old-school “selectable” solution with different colors?
    Adrian Landborn

    Adrian Landborn

    1 year ago
    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

    Louis Pullen-Freilich [G]

    1 year ago
    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:
    val isPressed = interactionSource.collectIsPressedAsState()
    val buttonBackgroundColor = if (isPressed) ... else ...
    Indication
    is more for a generic effect that is shown across clickable elements, not for per-component behavior or appearance changes