https://kotlinlang.org logo
#compose
Title
# compose
a

Alex

11/10/2021, 11:15 AM
Is there a way to trigger the ripple click effect programmatically in compose?
r

Rick Regan

11/10/2021, 1:09 PM
l

Louis Pullen-Freilich [G]

11/10/2021, 2:12 PM
You can manually emit a PressInteraction to the interaction source used by the component / ripple, or just share the same interaction source instance between components
r

Rick Regan

11/10/2021, 2:38 PM
(Sorry, I had read this response within the thread I linked above as saying it was not possible: https://kotlinlang.slack.com/archives/CJLTWPH7S/p1630014079123200?thread_ts=1629998733.073900&cid=CJLTWPH7S )
l

Louis Pullen-Freilich [G]

11/10/2021, 2:41 PM
It's not strictly programmatic ripple control, its just emitting an event that ripples respond to. You can't manually stop / start the ripple with a direct API or anything, but you can tell the ripple through this that something has been pressed, which will cause the ripple to start