09-27-2021 18:59
09-27-2021 18:59
Hello! I have an application that requires use of the entire screen for swipe gestures. Is there any way that I can prevent a swipe down from opening the notification center?
I have already found how to prevent the swipe right to go back behavior by calling preventDefault() on the 'beforeunload'. Is there something similar that can be done for the notification center?
09-27-2021 19:00
09-27-2021 19:00
For context, I am developing on a Fitbit Sense with the latest sdk
09-27-2021 22:12
09-27-2021 22:12
Probably not for a Clock on a Sense.
The system defaults take precedence which makes even scrolling an issue.
But if you make it an App that might work, though that has other implications which may possibly be overcome with preventDefault()
Author | ch, passion for improvement.
09-28-2021 14:55
09-28-2021 14:55
Thanks for the response! I am building a sense App, so I was able to use the preventDefault trick to stop the app from unloading on a left swipe. However, I can't seem to find an event that calling preventDefault on will will cause the notification center to not open. I've tried it for every event I can find on the Document, Appbit, and the element I'm using as a detector
09-28-2021 15:24
09-28-2021 15:24
I don't think that gesture can be over-ridden.
09-28-2021 20:34 - edited 09-28-2021 21:43
09-28-2021 20:34 - edited 09-28-2021 21:43
@isaacfehr - the trick in an App is to not pull down from the top edge or left edge. As @Gondwana says the system gestures take precedence.
See the SimpleCalendar app. It has 4 way scroll starting from the middle and doesn't even use preventDefault().
Whereas the SimpleTimer app uses preventDefault() so the back button can be used to start / pause the timer or stopwatch.
Not sure that preventDefault() will override a full swipe from the left edge, it depends a bit on the action.
Author | ch, passion for improvement.