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

Commit

Permalink
Use show/hide instead of setVisible to ensure back handler is removed (
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored and bluemarvin committed Jan 3, 2020
1 parent 2365f46 commit 41d5d1f
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ private void initialize(@NonNull Context aContext) {
closeFloatingMenus();

if (!wasVisible) {
mProjectionMenu.setVisible(true);
mProjectionMenu.show(REQUEST_FOCUS);
}
});

Expand Down Expand Up @@ -678,6 +678,7 @@ private void enterVRVideo(@VideoProjectionMenuWidget.VideoProjectionFlags int aP
mMediaControlsWidget.getPlacement().visible = false;
mWidgetManager.addWidget(mMediaControlsWidget);
mMediaControlsWidget.setBackHandler(mVRVideoBackHandler);
mMediaControlsWidget.setOnClickListener(v -> v.requestFocusFromTouch());
}
mMediaControlsWidget.setProjectionMenuWidget(mProjectionMenu);
mMediaControlsWidget.setMedia(mFullScreenMedia);
Expand Down Expand Up @@ -749,10 +750,10 @@ public void updateServoButton() {

private void closeFloatingMenus() {
if (mProjectionMenu != null) {
mProjectionMenu.setVisible(false);
mProjectionMenu.hide(KEEP_WIDGET);
}
if (mBrightnessWidget != null) {
mBrightnessWidget.setVisible(false);
mBrightnessWidget.hide(KEEP_WIDGET);
}
}

Expand Down

0 comments on commit 41d5d1f

Please sign in to comment.