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

Gabriel Feo

04/23/2020, 12:36 AM
For a shape which has three clickable like this one, how would one identify click coordinates?
PointerInput
doesn't seem to be a fit, as
PointerInputHandler
can't be
@Composable
l

Leland Richardson [G]

04/23/2020, 1:04 AM
cc @Shep Shapard
m

matvei

04/23/2020, 11:15 AM
Any reason you want to have one shape like this one? It appears to me this can be splitted in three (or at least two) shapes, so you can have three different elements with their "subshape" and their one clickable. Then, you will have s
Stack
with two children:
Row
of two clickables and then one centered circle clickable on top
If you do this, underlying gesture infrastructure will just work for you
If you want this to have somewhat custom behaviour, you cal take a look at
Copy code
Modifier.rawPressStartGestureFilter
or even reimplement your own filter, which is a little bit tricky
If these two options won't work, please, tell me how your dream API would look like 🙂
g

Gabriel Feo

04/23/2020, 4:15 PM
@matvei, you're spot on, I split the shape in three buttons last night actually! I'll take a look at that modifier though, looks like it would've solved the non-issue I had 😅
Thanks!
m

matvei

04/23/2020, 4:39 PM
No problem 😉
4 Views