From dcbc58f1161a99d4402017a2a35d5b4e7b03e420 Mon Sep 17 00:00:00 2001 From: Imanol Fernandez Date: Fri, 15 Mar 2019 14:12:23 +0100 Subject: [PATCH] Correctly hide controller on autoselected VR video playback (#1023) --- .../org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java | 3 ++- .../vrbrowser/ui/widgets/VideoProjectionMenuWidget.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java index 48e6e26bc..5371f0175 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/NavigationBarWidget.java @@ -494,6 +494,7 @@ private void enterVRVideo(@VideoProjectionMenuWidget.VideoProjectionFlags int aP } mIsInVRVideo = true; mWidgetManager.pushBackHandler(mVRVideoBackHandler); + mProjectionMenu.setSelectedProjection(aProjection); // Backup the placement because the same widget is reused in FullScreen & MediaControl menus mProjectionMenuPlacement.copyFrom(mProjectionMenu.getPlacement()); @@ -512,7 +513,7 @@ private void enterVRVideo(@VideoProjectionMenuWidget.VideoProjectionFlags int aP mWindowWidget.setVisible(false); closeFloatingMenus(); - if (mProjectionMenu.getSelectedProjection() != VideoProjectionMenuWidget.VIDEO_PROJECTION_3D_SIDE_BY_SIDE) { + if (aProjection != VideoProjectionMenuWidget.VIDEO_PROJECTION_3D_SIDE_BY_SIDE) { mWidgetManager.setControllersVisible(false); } diff --git a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/VideoProjectionMenuWidget.java b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/VideoProjectionMenuWidget.java index edb4fd1c2..f616042a2 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/VideoProjectionMenuWidget.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/VideoProjectionMenuWidget.java @@ -120,6 +120,10 @@ private void handleClick(@VideoProjectionFlags int aVideoProjection) { return mSelectedProjection; } + public void setSelectedProjection(@VideoProjectionFlags int aProjection) { + mSelectedProjection = aProjection; + } + public static @VideoProjectionFlags Integer getAutomaticProjection(String aURL, AtomicBoolean autoEnter) { if (aURL == null) { return null;