Medvedev91 / timeto.me

App with pomodoro, checklists, goals, tasks, repetitive, calendar and time tracking.
https://timeto.me
GNU General Public License v3.0
203 stars 13 forks source link

Fix navigation buttons click handling #69

Closed di72nn closed 1 month ago

di72nn commented 1 month ago

Fix an issue with unwanted clicks when using gesture navigation. Fixes #58.

Medvedev91 commented 1 month ago

I use motionEventSpy() instead of clickable() because it works much faster in this case.

di72nn commented 1 month ago

Well, of course it works faster, but also incorrectly, because it doesn't wait for the motion to finish. And the motion can be canceled (something like that probably happens in the related issue).

Even simpler way to reproduce it is to touch the button, move your finger away from the button, and then release outside of the button. Any normal button doesn't register such events as clicks, but these navigation buttons do.

Medvedev91 commented 1 month ago

Yes, I know all the side effects. But I'm going by experience of use in each situation. This method worked well for years.

I'am sure there is a solution for LineageOS. Like 1px bottom padding or something else. I will try to fix that as soon as I get LinageOS.

Medvedev91 commented 1 month ago

The buttons are placed above the navigation. It's strange that motionEventSpy() is triggered. Perhaps we can also consider this to be a LinageOS bug.

In the worst case, we can make a special modifier for LinageOS.

di72nn commented 1 month ago

Now that you mentioned it... I actually have the "navigation hint" (the bar) disabled, so there's zero space for navigation at the bottom. Enabling the "navigation hint" does resolve the issue (at least on crDroid). Maybe LineageOS has broken implementation, I don't have any device to compare (there are other implementations though - e.g., Samsung).

Medvedev91 commented 1 month ago

On my devices it works well even if the bar disabled.

Medvedev91 commented 1 month ago

Also, I want to say thank you! Glad to see someone managed to understand my code.

: )