Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Correctly handle back action on VR Activity #11

Merged
merged 1 commit into from
Mar 12, 2018
Merged

Conversation

MortimerGoro
Copy link
Contributor

No description provided.

Copy link
Contributor

@bluemarvin bluemarvin left a 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();
}
}

Copy link
Contributor

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() ?

Copy link
Contributor Author

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();
}
Copy link
Contributor

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.

Copy link
Contributor Author

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?

@TrevorFSmith
Copy link
Contributor

TrevorFSmith commented Mar 9, 2018 via email

@MortimerGoro
Copy link
Contributor Author

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)

@MortimerGoro MortimerGoro changed the title Handle button click or back to exit the VR browser Correctly handle back action on VR Activity Mar 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants