Previously  there was `pressIndicatorGesture` , I ...
# compose
v
Previously  there was 
pressIndicatorGesture
 , I am using this to immitate that :
Copy code
Modifier.pointerInput(Unit) {
    detectTapGestures(
        onLongPress = { doingSomething }
    )
}
how can I listen when you have left/cancel the long press?
a
You could add an
onPress
handler invoking
awaitRelease
, or more simply, just writing the code after
detectTapGestures
returns may work for you.
With either approach, you will probably need to add an extra variable like 
var didLongPress = false
 and set it in your long-press handler in order to distinguish long presses from other types of presses
v
Thank you @Alexandre Elias [G], I used for my usecase like this:
Copy code
Modifier.pointerInput(Unit) {
        detectTapGestures(
            onLongPress = {
                doingSomething(true)
            },
            onPress = {
                doingSomething(true)
                if (this.tryAwaitRelease()) {
                    doingSomething(false)
                }
            }
        )
    }
I used
tryAwaitRelease()
as it returned me a boolean value to check when gesture is cancelled
🙏 1