hello everyone, I am just starting composing… is ...
# compose
r
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
If you give
indication
to
.clickable
, you also got to give
interactionSource
👍 1
But doesn't
.clickable
adds ripple by default?
r
this is the exact code which worked:
Copy code
.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
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.
🙂 2
l
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
@Louis Pullen-Freilich [G] that’s correct, now I have it with the theme, thanks!