#212 Android Back button like home button

Merged
erinn merged 2 commits from dan:androidBack into master 4 months ago
dan commented 4 months ago

Android back button default behaviour on root pane is to exit that app. That’s not ideal so I’ve captured it and redirected to a home button like behaviour

It might be nice to have it do pane switching when not at root?

Android back button default behaviour on root pane is to exit that app. That's not ideal so I've captured it and redirected to a home button like behaviour It might be nice to have it do pane switching when not at root?

Drone Build Status: success

https://build.openprivacy.ca/cwtch.im/ui/318

Drone Build Status: success https://build.openprivacy.ca/cwtch.im/ui/318

Drone Build Status: success

https://build.openprivacy.ca/cwtch.im/ui/319

Drone Build Status: success https://build.openprivacy.ca/cwtch.im/ui/319
erinn was unassigned by dan 4 months ago
erinn was assigned by dan 4 months ago
erinn commented 4 months ago
Owner

updated back button handling (not very robust but i’m planning a layout manager change that will break this anyway so it’s fine for now):

    Keys.onPressed: {
        if (event.key == Qt.Key_Back) {
            event.accepted = true
            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
            }
        }
    }

”’

updated back button handling (not very robust but i'm planning a layout manager change that will break this anyway so it's fine for now): Keys.onPressed: { if (event.key == Qt.Key_Back) { event.accepted = true 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 } } } '''
erinn requested changes 4 months ago
go/gothings/android/CwtchActivity.go
@@ -14,2 +15,4 @@

_ func(string) `slot:"updateAndroidNotification"`

_ func() `signal:"rootHomeButtonHandle,auto""`
erinn

remove double-double-quote near eol

remove double-double-quote near eol
dan commented 4 months ago
Owner

added

fixed!

thanks

added fixed! thanks

Drone Build Status: success

https://build.openprivacy.ca/cwtch.im/ui/333

Drone Build Status: success https://build.openprivacy.ca/cwtch.im/ui/333

Drone Build Status: success

https://build.openprivacy.ca/cwtch.im/ui/332

Drone Build Status: success https://build.openprivacy.ca/cwtch.im/ui/332
erinn approved these changes 4 months ago

Drone Build Status: success

https://build.openprivacy.ca/cwtch.im/ui/335

Drone Build Status: success https://build.openprivacy.ca/cwtch.im/ui/335

Drone Build Status: success

https://build.openprivacy.ca/cwtch.im/ui/334

Drone Build Status: success https://build.openprivacy.ca/cwtch.im/ui/334

Reviewers

erinn approved these changes 4 months ago
The pull request has been merged.
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.