https://kotlinlang.org logo
#korge
Title
# korge
p

Pablo Caviglia

12/27/2020, 4:20 AM
hi all, touch events question, I have two views on the hierarchy, and they work pretty well in relation to the touch events hierarchy. If i have view B on top of view A, I get the touch events correctly triggered by view B, and view A events are ignored or so. This behavior works by implementing the method onClick. The problem arise when I implement the methods onDown and onUp on view A. In this case even when view B is on top of view A, the onUp and onDown events of View A gets processed … ideas ?
d

Deactivated User

12/27/2020, 7:01 AM
Uhm. Don't remember the details. Maybe you can put a dummy click event on B to prevent that from happening for now?
p

Pablo Caviglia

12/27/2020, 11:50 AM
yes, i actually fixed it in a dummy way. I’ve just set the view A a flag that’s set when view B is opened, and when the flag is on the events are not considered
I’m not sure about the root of this problem. The only thing I found out is that if both components handle onUp/onDown OR and ONLY OR both handles onClick, everything works as expected.
d

Deactivated User

12/27/2020, 8:17 PM
can you provide a small smple reproducing the issue, so I can try and investigate?
p

Pablo Caviglia

12/27/2020, 8:18 PM
Sure, give me a second
👍 1
d

Deactivated User

12/27/2020, 8:20 PM
though you were on holidays, is this a bug that caused a last minute problem?
p

Pablo Caviglia

12/27/2020, 8:30 PM
No no, it's part of a secondary project im playing with
Nothing urgent
d

Deactivated User

12/27/2020, 8:39 PM
okay 🙂 👍
p

Pablo Caviglia

12/27/2020, 9:09 PM
Just nerding 🤣
🦜 1
😂 1
K 1
🎉 1
5 Views