Skip to content

Commit 623b4b2

Browse files
committed
Make dialog disappear as soon as leaving animation is started
1 parent 355ee98 commit 623b4b2

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

kvs/ProductScreen.kv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
id: android_tabs
1515
tab_bar_height: '50dp'
1616
lock_swiping: True
17-
# anim_duration: 0.0
1817
text_color_normal: (0,0,0,1)
1918
text_color_active: (1,1,1,1)
2019
color_indicator: (0,0,0,1)

scrs/ProductScreen.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def on_timeout(self, dt):
193193
#
194194
# upon leaving the screen, cancel the timeout event
195195
#
196-
def on_leave(self, *args):
196+
def on_pre_leave(self, *args):
197197
self.timeout_event.cancel()
198198

199199
if self.final_dialog is not None:
@@ -271,11 +271,7 @@ def on_cancel_payment(self, dt):
271271
def on_confirm_payment(self, dt=None):
272272
Logger.info(f"StellaPayUI: Payment was confirmed by the user.")
273273

274-
spinner = MDSpinner(
275-
size_hint=(None, None),
276-
size=(dp(32), dp(32)),
277-
active=True
278-
)
274+
spinner = MDSpinner(size_hint=(None, None), size=(dp(32), dp(32)), active=True)
279275

280276
# Show a spinner when user confirms the payment and hide the other buttons
281277
self.shopping_cart_dialog.ids.button_box.add_widget(spinner)
@@ -310,7 +306,10 @@ def update_ui_after_payment(self, transaction_successful: bool):
310306
def show_thanks_dialog(self):
311307
self.timeout_event.cancel()
312308

313-
self.final_dialog = MDDialog(text="Gelukt! Je aankoop is geregistreerd!", on_dismiss=self.on_thanks)
309+
self.final_dialog = MDDialog(
310+
text="Gelukt! Je aankoop is geregistreerd!",
311+
on_dismiss=self.on_thanks,
312+
)
314313

315314
self.timeout_event = Clock.schedule_once(self.on_thanks, 5)
316315
self.final_dialog.open()

0 commit comments

Comments
 (0)