-
Notifications
You must be signed in to change notification settings - Fork 220
Correctly handle back action on VR Activity #11
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we want to follow the platform standard of using the home button on the controller to exit the app. Have the close button exit the app seems like the wrong approach. I think we would just want it to close the window and the the user will be able to open a new window from the dashboard?
exitApp(); | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we just be calling super.onBackPressed() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's for GearVR app which tipically show the exit confirmation UI and we have to use a System Util to show it. But we could super.onBackPressed() for other platforms instead of calling exitApp.
@Override | ||
public void onCloseClick() { | ||
exitApp(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really want to be exiting the app when we close the window? That doesn't seem right to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example Oculus browser exits the apps when the window is closed. I like the idea of the dashboard too. @TrevorFSmith What's the design plan is for this? Does it make sense to have 0 windows open?
If the user closes the only window, a new window should open with a blank
tab and a keyboard to enter text in the URL bar., like.it does on mobile
Firefox. It should not exit Crow.
On Mar 9, 2018 12:46 PM, "Imanol Fernandez" <[email protected]> wrote:
*@MortimerGoro* commented on this pull request.
------------------------------
In app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java
<#11 (comment)>:
@@ -114,7 +129,14 @@ void createWidget(final int aType, final int aHandle, SurfaceTexture aTexture, i
int currentSession = SessionStore.get().getCurrentSessionId();
widget = new BrowserWidget(this, currentSession);
} else if (aType == Widget.URLBar) {
- widget = new URLBarWidget(this);
+ URLBarWidget w = new URLBarWidget(this);
+ w.setDelegate(new URLBarWidget.Delegate() {
+ @OverRide
+ public void onCloseClick() {
+ exitApp();
+ }
For example Oculus browser exits the apps when the window is closed. I like
the idea of the dashboard too. @TrevorFSmith
<https://github.com/trevorfsmith> What's the design plan is for this? Does
it make sense to have 0 windows open?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACH2xdb8oppyOiHbPDBem_Uw4juOIhVks5tcuoOgaJpZM4SkuHf>
.
|
d231be6
to
215f2df
Compare
Thanks for the info @TrevorFSmith. I'll hide the close button for now until we implement multiple windows. @bluemarvin I have updated the PR. Now super.onBackPressed() is used on all platforms but Oculus where we show the back Confirmation menu. Also fixed some stuff when destroying the activity after a back (virtual display was leaking some objects) |
215f2df
to
28c59e3
Compare
No description provided.