Skip to content

Commit 607c87c

Browse files
committed
edge-to-edge My Data
1 parent 76a6493 commit 607c87c

2 files changed

Lines changed: 27 additions & 1 deletion

File tree

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import android.webkit.WebView;
3232
import android.webkit.WebViewClient;
3333
import android.widget.ImageView;
34+
import android.widget.LinearLayout;
3435
import android.widget.TextView;
3536
import android.widget.Toast;
3637

@@ -40,6 +41,7 @@
4041
import androidx.core.app.ActivityCompat;
4142
import androidx.core.content.ContextCompat;
4243
import androidx.core.content.PermissionChecker;
44+
import androidx.core.view.ViewCompat;
4345
import androidx.core.view.WindowCompat;
4446

4547
import com.samsung.microbit.MBApp;
@@ -739,12 +741,34 @@ private void displayCreate() {
739741
//Remove title bar
740742
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
741743
setContentView(R.layout.fetch_main);
744+
745+
// Pass insets to children
746+
ViewCompat.setOnApplyWindowInsetsListener( findViewById(R.id.fetchMain), (v, windowInsets) -> {
747+
LinearLayout root = (LinearLayout) v;
748+
int childCount = root.getChildCount();
749+
for (int index = 0; index < childCount; ++index) {
750+
ViewCompat.dispatchApplyWindowInsets( root.getChildAt(index), windowInsets);
751+
}
752+
return windowInsets;
753+
});
754+
742755
displayHtmlDelete();
743756
displayInit();
744757
}
745758

746759
public void displayConfigurationChanged(Configuration newConfig) {
747760
setContentView(R.layout.fetch_main);
761+
762+
// Pass insets to children
763+
ViewCompat.setOnApplyWindowInsetsListener( findViewById(R.id.fetchMain), (v, windowInsets) -> {
764+
LinearLayout root = (LinearLayout) v;
765+
int childCount = root.getChildCount();
766+
for (int index = 0; index < childCount; ++index) {
767+
ViewCompat.dispatchApplyWindowInsets( root.getChildAt(index), windowInsets);
768+
}
769+
return windowInsets;
770+
});
771+
748772
displayInit();
749773
}
750774

app/src/main/res/layout/fetch_web.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
android:layout_width="fill_parent"
55
android:layout_height="fill_parent"
66
android:padding="0dp"
7-
android:orientation="vertical">
7+
android:background="@color/main_gray_color"
8+
android:orientation="vertical"
9+
android:fitsSystemWindows="true">
810

911
<LinearLayout
1012
android:id="@+id/fetchWebBar"

0 commit comments

Comments
 (0)