google / automotive-design-compose

Automotive Design for Compose is an extension to Jetpack Compose that allows every screen, component, and overlay of your Android App to be defined in Figma, and lets you see the latest changes to your Figma design in your app, immediately!
https://google.github.io/automotive-design-compose/
Apache License 2.0
113 stars 16 forks source link

Longpress callback support #1323

Open miguel-galarza opened 3 months ago

miguel-galarza commented 3 months ago

It is needed to get a callback event when a long press event is performed in a node. It is needed something similar as "TapCallback" function currently implemented but for a while pressing event.

iamralpht commented 3 months ago

I think we can take this on as a customization feature - as a workaround for now, you can add a Modifier tappable customization that handles the long press event.

If you're using the prototyping capabilities, then you can achieve a "long press" by changing variant "while pressed", and on the "while pressed" variant, have an "after time" trigger.

miguel-galarza commented 3 months ago

Thank you for the proposed workaround, for general information the ideal use case would be able to start an action when long press button is started and stop it when the button is released.