From 049087c0808bece109c402c67548afe690935848 Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Fri, 13 Sep 2019 16:16:52 -0700 Subject: [PATCH] incorporate erinn's feebback so android back button interacts with stack! --- go/gothings/android/CwtchActivity.go | 2 +- qml/main.qml | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/go/gothings/android/CwtchActivity.go b/go/gothings/android/CwtchActivity.go index 8370bb19..a1cb826c 100644 --- a/go/gothings/android/CwtchActivity.go +++ b/go/gothings/android/CwtchActivity.go @@ -15,7 +15,7 @@ type CwtchActivity struct { _ func(string) `slot:"updateAndroidNotification"` - _ func() `signal:"rootHomeButtonHandle,auto""` + _ func() `signal:"rootHomeButtonHandle,auto"` } func (c *CwtchActivity) init() { diff --git a/qml/main.qml b/qml/main.qml index 0f43ab18..d4584884 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -200,7 +200,13 @@ ApplicationWindow { Keys.onPressed: { if (event.key == Qt.Key_Back) { event.accepted = true - androidCwtchActivity.rootHomeButtonHandle() + if (theStack.currentIndex == theStack.emptyPane) { + androidCwtchActivity.rootHomeButtonHandle() + } else if (theStack.currentIndex == theStack.userProfilePane || theStack.currentIndex == theStack.groupProfilePane) { + theStack.currentIndex = theStack.messagePane + } else { + theStack.currentIndex = theStack.emptyPane + } } } }