|
54 | 54 | import java.util.concurrent.Executor;
|
55 | 55 | import java.util.concurrent.atomic.AtomicBoolean;
|
56 | 56 |
|
| 57 | +import static org.mozilla.vrbrowser.ui.widgets.menus.VideoProjectionMenuWidget.VIDEO_PROJECTION_NONE; |
| 58 | + |
57 | 59 | public class NavigationBarWidget extends UIWidget implements GeckoSession.NavigationDelegate,
|
58 | 60 | GeckoSession.ProgressDelegate, GeckoSession.ContentDelegate, WidgetManagerDelegate.WorldClickListener,
|
59 | 61 | WidgetManagerDelegate.UpdateListener, SessionChangeListener,
|
@@ -102,7 +104,7 @@ public class NavigationBarWidget extends UIWidget implements GeckoSession.Naviga
|
102 | 104 | private BrightnessMenuWidget mBrightnessWidget;
|
103 | 105 | private MediaControlsWidget mMediaControlsWidget;
|
104 | 106 | private Media mFullScreenMedia;
|
105 |
| - private @VideoProjectionMenuWidget.VideoProjectionFlags Integer mAutoSelectedProjection; |
| 107 | + private @VideoProjectionMenuWidget.VideoProjectionFlags int mAutoSelectedProjection = VIDEO_PROJECTION_NONE; |
106 | 108 | private HamburgerMenuWidget mHamburgerMenu;
|
107 | 109 | private SendTabDialogWidget mSendTabDialog;
|
108 | 110 | private TooltipWidget mPopUpNotification;
|
@@ -252,7 +254,7 @@ private void initialize(@NonNull Context aContext) {
|
252 | 254 | mAudio.playSound(AudioEngine.Sound.CLICK);
|
253 | 255 | }
|
254 | 256 |
|
255 |
| - if (mAutoSelectedProjection != null) { |
| 257 | + if (mAutoSelectedProjection != VIDEO_PROJECTION_NONE) { |
256 | 258 | enterVRVideo(mAutoSelectedProjection);
|
257 | 259 | return;
|
258 | 260 | }
|
@@ -698,6 +700,7 @@ private void exitVRVideo() {
|
698 | 700 | boolean composited = mProjectionMenu.getPlacement().composited;
|
699 | 701 | mProjectionMenu.getPlacement().copyFrom(mProjectionMenuPlacement);
|
700 | 702 | mProjectionMenu.getPlacement().composited = composited;
|
| 703 | + mProjectionMenu.setSelectedProjection(VIDEO_PROJECTION_NONE); |
701 | 704 | mWidgetManager.updateWidget(mProjectionMenu);
|
702 | 705 | closeFloatingMenus();
|
703 | 706 | mWidgetManager.setControllersVisible(true);
|
@@ -870,11 +873,14 @@ public void onFullScreen(GeckoSession session, boolean aFullScreen) {
|
870 | 873 | }
|
871 | 874 | AtomicBoolean autoEnter = new AtomicBoolean(false);
|
872 | 875 | mAutoSelectedProjection = VideoProjectionMenuWidget.getAutomaticProjection(getSession().getCurrentUri(), autoEnter);
|
873 |
| - if (mAutoSelectedProjection != null && autoEnter.get()) { |
| 876 | + if (mAutoSelectedProjection != VIDEO_PROJECTION_NONE && autoEnter.get()) { |
874 | 877 | mAutoEnteredVRVideo = true;
|
875 | 878 | postDelayed(() -> enterVRVideo(mAutoSelectedProjection), 300);
|
876 | 879 | } else {
|
877 | 880 | mAutoEnteredVRVideo = false;
|
| 881 | + if (mProjectionMenu != null) { |
| 882 | + mProjectionMenu.setSelectedProjection(mAutoSelectedProjection); |
| 883 | + } |
878 | 884 | }
|
879 | 885 | } else {
|
880 | 886 | if (mIsInVRVideo) {
|
|
0 commit comments