summaryrefslogtreecommitdiff
path: root/wasp/apps
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-11-29 09:07:49 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-11-29 09:12:14 (GMT)
commit057c140f0e1ddaa6a9e5024c8638a7a49f1b2d7d (patch)
treef53577e1fe0c144e7a840a4c8742eaece67041c0 /wasp/apps
parentc6d5e841a0574198a530d4d400ec9dc7adf36034 (diff)
apps: pager: notifications: improve swipe handling
Currently the swipe handling added for the confirmation view has a number of prolems: it does not work at all for multi-screen notifications, it interferes with the haptic feedback if we keep swiping down and an up swipe incorrectly dismisses whole notification app. Fix these. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp/apps')
-rw-r--r--wasp/apps/pager.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/wasp/apps/pager.py b/wasp/apps/pager.py
index f9de947..2f74d0e 100644
--- a/wasp/apps/pager.py
+++ b/wasp/apps/pager.py
@@ -99,11 +99,18 @@ class NotificationApp(PagerApp):
super().background()
def swipe(self, event):
- if event[0] == wasp.EventType.DOWN:
- self.confirmation_view.active = True
- self._draw()
- super().swipe(event)
+ if self.confirmation_view.active:
+ if event[0] == wasp.EventType.UP:
+ self.confirmation_view.active = False
+ self._draw()
+ return
+ else:
+ if event[0] == wasp.EventType.DOWN and self._page == 0:
+ self.confirmation_view.active = True
+ self._draw()
+ return
+ super().swipe(event)
def _draw(self):
if self.confirmation_view.active: