Skip to content

Commit 6dcfb7d

Browse files
committed
edge-to-edge MakeCode avoid cutout
1 parent 7ebcbcd commit 6dcfb7d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,13 @@ protected void onCreate(Bundle savedInstanceState) {
103103
setContentView(R.layout.activity_makecode);
104104

105105
ViewCompat.setOnApplyWindowInsetsListener( findViewById(R.id.MakeCode), (v, windowInsets) -> {
106-
Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars());
106+
Insets insets = windowInsets.getInsets(
107+
WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout());
107108
ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams) v.getLayoutParams();
108109
mlp.leftMargin = insets.left;
109110
mlp.bottomMargin = insets.bottom;
110111
mlp.rightMargin = insets.right;
112+
mlp.topMargin = insets.top;
111113
v.setLayoutParams(mlp);
112114
return WindowInsetsCompat.CONSUMED;
113115
});

0 commit comments

Comments
 (0)