r

    Radoslaw Juszczyk

    1 year ago
    hello everyone, I am just starting composing… is there a way to put a ripple effect on a
    Surface
    ? I have tried:
    Surface(modifier=Modifier.clickable(indication=….))
    but
    indication
    is not resolved what is the correct way to do that?
    l

    Luke

    1 year ago
    If you give
    indication
    to
    .clickable
    , you also got to give
    interactionSource
    But doesn't
    .clickable
    adds ripple by default?
    r

    Radoslaw Juszczyk

    1 year ago
    this is the exact code which worked:
    .clickable(
        onClick = {},
        indication = rememberRipple(),
        interactionSource = remember { MutableInteractionSource() },
    )
    nah, by default it was just solid highlight
    this is just a piece of code which i wouldnt believe it worked, this compose is really taking me out of my comfort zone ;d
    l

    Luke

    1 year ago
    I hear you. It's definitely far from what we are used to, but I still prefer Compose UI over XML. The learning curve is steep but worth climbing.
    l

    Louis Pullen-Freilich [G]

    1 year ago
    nah, by default it was just solid highlight
    If you have a
    MaterialTheme
    in your application it will configure this for you, so it is a ripple by default
    r

    Radoslaw Juszczyk

    1 year ago
    @Louis Pullen-Freilich [G] that’s correct, now I have it with the theme, thanks!