Skip to content

Commit 360be21

Browse files
fix: edge to edge/fullscreen margins (#1847)
Ensures that when in edge to edge or fullscreen modes the values for margin left and right are 0 Co-authored-by: Kepa Totorica <kepa.baum.totorica@outsystems.com>
1 parent 5bca218 commit 360be21

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

framework/src/org/apache/cordova/CordovaActivity.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,11 @@ protected void createViews() {
227227
boolean isStatusBarVisible = statusBarView.getVisibility() != View.GONE;
228228
int top = isStatusBarVisible && !canEdgeToEdge && !isFullScreen ? bars.top : 0;
229229
int bottom = !canEdgeToEdge && !isFullScreen ? bars.bottom : 0;
230+
int left = !canEdgeToEdge && !isFullScreen ? bars.left : 0;
231+
int right = !canEdgeToEdge && !isFullScreen ? bars.right : 0;
230232

231233
FrameLayout.LayoutParams webViewParams = (FrameLayout.LayoutParams) webView.getLayoutParams();
232-
webViewParams.setMargins(bars.left, top, bars.right, bottom);
234+
webViewParams.setMargins(left, top, right, bottom);
233235
webView.setLayoutParams(webViewParams);
234236

235237
FrameLayout.LayoutParams statusBarParams = new FrameLayout.LayoutParams(

0 commit comments

Comments
 (0)