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

Oleksandr Balan

05/02/2022, 10:48 AM
Can I “ignore” some events based on position in
pointerInput
so the events are passed to underlying components? See image in 🧵
I want overlay to “catch & ignore” events only in semi-transparent parts and pass them through in fully transparent circle in the middle.
👀 2
t

Tgo1014

05/02/2022, 12:02 PM
I’m having the same issue 👀
Is there at least a way to disable/enable the touch interception so it let the compose under it to grab the touches? I know there’s a enable and disable flag but basically it intercept the touch and do nothing instead of letting the compose under get it
o

Oleksandr Balan

05/02/2022, 5:21 PM
To pass all events in your case, you should not apply modifier (
clickable
I guess?). Something like this:
Copy code
val clickable = if (enable) {
    Modifier.clickable { 
        // ....
    }
} else {
    Modifier
}
Box(
    modifier = Modifier.then(clickable)
)
t

Tgo1014

05/02/2022, 5:22 PM
So I can make the modifier to be dynamic? Interesting, I’ll try it now, let me see
It worked, thanks Oleksandr!
👍 1
20 Views