From 23a2a957847557a8cdefde66530b23a8603e5724 Mon Sep 17 00:00:00 2001 From: Mark Qvist Date: Sat, 17 Sep 2022 17:21:16 +0200 Subject: [PATCH] Improved lifecycle management on Android --- sbapp/main.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/sbapp/main.py b/sbapp/main.py index 41d8d6f..533c177 100644 --- a/sbapp/main.py +++ b/sbapp/main.py @@ -253,10 +253,15 @@ class SidebandApp(MDApp): w.height, w.size_hint_y, w.opacity, w.disabled = 0, None, 0, True def quit_action(self, sender): - RNS.exit() - RNS.log("RNS shutdown complete") - MDApp.get_running_app().stop() - Window.close() + self.root.ids.nav_drawer.set_state("closed") + self.sideband.should_persist_data() + + def final_exit(dt): + RNS.exit() + MDApp.get_running_app().stop() + Window.close() + + Clock.schedule_once(final_exit, 0.5) def announce_now_action(self, sender=None): self.sideband.lxmf_announce()