Skip to content

Commit

Permalink
Correctly separate fullscreen resize placement data. (#1690)
Browse files Browse the repository at this point in the history
  • Loading branch information
MortimerGoro authored and keianhzo committed Aug 28, 2019
1 parent 8aff84c commit b926cae
Showing 1 changed file with 4 additions and 2 deletions.
Expand Up @@ -69,6 +69,7 @@ public class NavigationBarWidget extends UIWidget implements GeckoSession.Naviga
private boolean mIsInVRVideo;
private boolean mAutoEnteredVRVideo;
private WidgetPlacement mPlacementBeforeResize;
private WidgetPlacement mPlacementBeforeFullscreen;
private Runnable mResizeBackHandler;
private Runnable mFullScreenBackHandler;
private Runnable mVRVideoBackHandler;
Expand Down Expand Up @@ -131,6 +132,7 @@ private void initialize(@NonNull Context aContext) {
mFullScreenResizeButton = findViewById(R.id.fullScreenResizeEnterButton);
mProjectionButton = findViewById(R.id.projectionButton);
mPlacementBeforeResize = new WidgetPlacement(aContext);
mPlacementBeforeFullscreen = new WidgetPlacement(aContext);


mResizeBackHandler = () -> exitResizeMode(ResizeAction.RESTORE_SIZE);
Expand Down Expand Up @@ -432,7 +434,7 @@ protected void onDraw(Canvas canvas) {
}

private void setFullScreenSize() {
mPlacementBeforeResize.copyFrom(mAttachedWindow.getPlacement());
mPlacementBeforeFullscreen.copyFrom(mAttachedWindow.getPlacement());
final float minScale = WidgetPlacement.floatDimension(getContext(), R.dimen.window_fullscreen_min_scale);
// Set browser fullscreen size
float aspect = SettingsStore.getInstance(getContext()).getWindowAspect();
Expand Down Expand Up @@ -501,7 +503,7 @@ private void exitFullScreenMode() {
}
}, 50);

mAttachedWindow.getPlacement().copyFrom(mPlacementBeforeResize);
mAttachedWindow.getPlacement().copyFrom(mPlacementBeforeFullscreen);
mWidgetManager.updateWidget(mAttachedWindow);

mIsInFullScreenMode = false;
Expand Down

0 comments on commit b926cae

Please sign in to comment.