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

Commit

Permalink
Fixes full screen exit issues (#3220)
Browse files Browse the repository at this point in the history
  • Loading branch information
keianhzo authored Apr 22, 2020
1 parent 95c72d4 commit 9c338d8
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,15 @@ private void initialize(@NonNull Context aContext) {

mNavigationListeners = new ArrayList<>();

mFullScreenBackHandler = this::exitFullScreenMode;
mFullScreenBackHandler = () -> {
if (mAttachedWindow != null) {
mAttachedWindow.setIsFullScreen(false);
}
};
mVRVideoBackHandler = () -> {
exitVRVideo();
if (mViewModel.getAutoEnteredVRVideo().getValue().get()) {
exitFullScreenMode();
if (mAttachedWindow != null) {
mAttachedWindow.setIsFullScreen(false);
}
};

Expand Down Expand Up @@ -278,7 +282,9 @@ private void updateUI() {

mBinding.navigationBarFullscreen.fullScreenExitButton.setOnClickListener(view -> {
view.requestFocusFromTouch();
exitFullScreenMode();
if (mAttachedWindow != null) {
mAttachedWindow.setIsFullScreen(false);
}
if (mAudio != null) {
mAudio.playSound(AudioEngine.Sound.CLICK);
}
Expand Down Expand Up @@ -601,7 +607,7 @@ private void enterFullScreenMode() {
}

private void exitFullScreenMode() {
if (mAttachedWindow == null || !mViewModel.getIsFullscreen().getValue().get()) {
if (mAttachedWindow == null) {
return;
}

Expand Down

0 comments on commit 9c338d8

Please sign in to comment.