diux-dev / rosettadrone

Android-based mavlink wrapper for DJI drones
BSD 3-Clause "New" or "Revised" License
113 stars 51 forks source link

Come up with a better way to clear the log view #10

Closed dbaldwin closed 5 years ago

dbaldwin commented 6 years ago

I'm just putting this in here as a future enhancement. I've found that the long press behavior for clearing the log has left me empty-handed on several occasions. This generally happens as I'm scrolling and trying to view some previous data. The log gets cleared out by accident. I think the default behavior with this code:

https://github.com/diux-dev/rosettadrone/blob/master/app/src/main/java/sq/rogue/rosettadrone/logs/LogFragment.java#L43-L50

This suggests the default behavior happens in 500ms:

https://stackoverflow.com/questions/1930895/how-long-is-the-event-onlongpress-in-the-android

That's too quick IMO. It also suggests that the long press is configurable. I've found that my Nexus 7 tablet has this option:

https://mcmw.abilitynet.org.uk/touch-hold-delay-android-jelly-bean-4-2-2/

So I'm going with that solution for the time being. Just wanted to share feedback and a workaround for those experiencing the same issue.

dbaldwin commented 6 years ago

FWIW setting the touch and hold delay in Accessibility settings to "Medium" does the trick for me.

sdowhy commented 6 years ago

From what I've read the long press timeout is only configurable systemwide. I've replaced the long click listener with a touch listener and I have it not execute the clear log command until 3 seconds.

There's still a lot of tweaking to be done with the UI but other things are taking precedence at the moment. At some point the logs are going to get a complete overhaul, including saving and better parsing.

sdowhy commented 6 years ago

Fixed in next release.