From 6f43a16a23dcef50a02714d001c382366782f430 Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Wed, 11 Feb 2026 19:41:05 +0000 Subject: [PATCH 01/23] AGP 8.13.2 and Gradle 8.13 --- .gitignore | 2 ++ .idea/gradle.xml | 2 +- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6842b843..fd8ea8c9 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,8 @@ local.properties .idea/deploymentTargetDropDown.xml .idea/appInsightsSettings.xml .idea/deploymentTargetSelector.xml +.idea/AndroidProjectSystem.xml +.idea/runConfigurations.xml *.iml # OS-specific files diff --git a/.idea/gradle.xml b/.idea/gradle.xml index dfbfb5ed..967058c3 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -4,6 +4,7 @@ diff --git a/build.gradle b/build.gradle index bf170ac3..a6936e4d 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.6.1' + classpath 'com.android.tools.build:gradle:8.13.2' classpath 'com.google.gms:google-services:4.4.3' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 48c0a02c..2733ed5d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From a7eaa1fc97acf097c3f7109fe07bb810e4164818 Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Wed, 11 Feb 2026 21:08:25 +0000 Subject: [PATCH 02/23] Refactor - Migrate BuildConfig to Gradle Build Files --- app/build.gradle | 3 +++ gradle.properties | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index dc395fc5..e8904d78 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -30,6 +30,9 @@ android { lint { abortOnError false } + buildFeatures { + buildConfig true + } } dependencies { diff --git a/gradle.properties b/gradle.properties index 61c499e0..10eb45ee 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,6 +16,5 @@ android.useAndroidX=true android.enableJetifier=true -android.defaults.buildfeatures.buildconfig=true android.nonTransitiveRClass=false android.nonFinalResIds=false From 23471a7dffa515e4c2bf0fa8eb402cf3e9066cfd Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Wed, 11 Feb 2026 21:21:11 +0000 Subject: [PATCH 03/23] AGP 9.0.0 Gradle 9.1.0 --- app/build.gradle | 2 +- build.gradle | 2 +- gradle.properties | 10 ++++++++++ gradle/wrapper/gradle-wrapper.properties | 2 +- pfLibrary | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index e8904d78..45e23af5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -20,7 +20,7 @@ android { buildTypes { release { minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' signingConfig signingConfigs.release } } diff --git a/build.gradle b/build.gradle index a6936e4d..39dd7a13 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:8.13.2' + classpath 'com.android.tools.build:gradle:9.0.0' classpath 'com.google.gms:google-services:4.4.3' } } diff --git a/gradle.properties b/gradle.properties index 10eb45ee..e6ff7d35 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,3 +18,13 @@ android.useAndroidX=true android.enableJetifier=true android.nonTransitiveRClass=false android.nonFinalResIds=false +android.defaults.buildfeatures.resvalues=true +android.sdk.defaultTargetSdkToCompileSdkIfUnset=false +android.enableAppCompileTimeRClass=false +android.usesSdkInManifest.disallowed=false +android.uniquePackageNames=false +android.dependency.useConstraints=true +android.r8.strictFullModeForKeepRules=false +android.r8.optimizedResourceShrinking=false +android.builtInKotlin=false +android.newDsl=false diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2733ed5d..d706aba6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/pfLibrary b/pfLibrary index 075e8e84..98d1eea5 160000 --- a/pfLibrary +++ b/pfLibrary @@ -1 +1 @@ -Subproject commit 075e8e844873f8443dcbe7fca64bb4aa18b0aced +Subproject commit 98d1eea582e87b720621956caacc456a70ff687f From c4128e6e35579f19a1eb3cbb2b1639666ed73f86 Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Thu, 12 Feb 2026 15:28:12 +0000 Subject: [PATCH 04/23] Target SDK 36 and update dependencies --- app/build.gradle | 16 ++++++++-------- pfLibrary | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 45e23af5..50357ab2 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,11 +1,11 @@ apply plugin: 'com.android.application' android { - compileSdk 35 + compileSdk=36 defaultConfig { applicationId "com.samsung.microbit" - minSdkVersion 21 - targetSdk 35 + minSdkVersion 23 + targetSdk 36 // When target SDK version is 30+, // requestLegacyExternalStorage will continue to work for 29 Android 10 } @@ -36,16 +36,16 @@ android { } dependencies { - implementation 'androidx.lifecycle:lifecycle-process:2.9.2' + implementation 'androidx.lifecycle:lifecycle-process:2.10.0' testImplementation 'junit:junit:4.13.2' implementation 'androidx.appcompat:appcompat:1.7.1' - implementation 'com.google.android.material:material:1.12.0' + implementation 'com.google.android.material:material:1.13.0' implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.4.0' - implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.29' - implementation 'no.nordicsemi.android:dfu:2.4.1' + implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.30' + implementation 'no.nordicsemi.android:dfu:2.10.1' implementation project(':pfLibrary') implementation 'com.google.android.gms:play-services-analytics:18.1.1' - implementation 'com.google.code.gson:gson:2.13.1' + implementation 'com.google.code.gson:gson:2.13.2' implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.1.0' } diff --git a/pfLibrary b/pfLibrary index 98d1eea5..5c430387 160000 --- a/pfLibrary +++ b/pfLibrary @@ -1 +1 @@ -Subproject commit 98d1eea582e87b720621956caacc456a70ff687f +Subproject commit 5c4303871fbd0d6fc5ce7b106eb377b7672de6e3 From 5cc47141ab7f4750e60ad9a7379c4bd3bc0db021 Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Fri, 13 Feb 2026 11:33:39 +0000 Subject: [PATCH 05/23] androidx.core:core:1.17.0 --- app/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/app/build.gradle b/app/build.gradle index 50357ab2..6211fadc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -36,6 +36,7 @@ android { } dependencies { + implementation 'androidx.core:core:1.17.0' implementation 'androidx.lifecycle:lifecycle-process:2.10.0' testImplementation 'junit:junit:4.13.2' implementation 'androidx.appcompat:appcompat:1.7.1' From 288ef7aa3ee692778429bd81a34e8cce6502b157 Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Sat, 14 Feb 2026 16:05:14 +0000 Subject: [PATCH 06/23] edge-to-edge HomeActivity --- .gitignore | 1 + app/src/main/AndroidManifest.xml | 1 + .../samsung/microbit/ui/activity/HomeActivity.java | 13 +++++++++---- app/src/main/res/layout/activity_home.xml | 5 +++-- app/src/main/res/layout/custom_nav_header_main.xml | 3 ++- app/src/main/res/values/styles.xml | 4 ++++ 6 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index fd8ea8c9..0610a7c3 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,7 @@ local.properties .idea/deploymentTargetSelector.xml .idea/AndroidProjectSystem.xml .idea/runConfigurations.xml +.idea/deviceManager.xml *.iml # OS-specific files diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c4944d86..bb20efc4 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -66,6 +66,7 @@ diff --git a/app/src/main/java/com/samsung/microbit/ui/activity/HomeActivity.java b/app/src/main/java/com/samsung/microbit/ui/activity/HomeActivity.java index a3fe9754..3843a94d 100644 --- a/app/src/main/java/com/samsung/microbit/ui/activity/HomeActivity.java +++ b/app/src/main/java/com/samsung/microbit/ui/activity/HomeActivity.java @@ -33,6 +33,8 @@ import androidx.core.content.ContextCompat; import androidx.core.content.PermissionChecker; import androidx.core.view.GravityCompat; +import androidx.core.view.ViewCompat; +import androidx.core.view.WindowCompat; import androidx.drawerlayout.widget.DrawerLayout; import com.samsung.microbit.MBApp; @@ -124,11 +126,8 @@ protected void onStop() { protected void onCreate(Bundle savedInstanceState) { logi("onCreate() :: "); - // TODO: EdgeToEdge - Remove once activities handle insets. - // Call before the DecorView is accessed in setContentView - getTheme().applyStyle(R.style.OptOutEdgeToEdgeEnforcement, /* force */ false); - super.onCreate(savedInstanceState); + WindowCompat.enableEdgeToEdge(getWindow()); setContentView(R.layout.activity_home); @@ -171,6 +170,12 @@ private void setupButtonsFontStyle() { */ private void setupDrawer() { + // DrawLayout passes insets to children + // Allow left side menu (custom_nav_header_main, nav_view) to pass insets to child ScrollView + ViewCompat.setOnApplyWindowInsetsListener( findViewById(R.id.nav_view), (v, windowInsets) -> { + return windowInsets; + }); + Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); toolbar.setNavigationContentDescription(R.string.content_description_toolbar_home); ImageView imgToolbarLogo = (ImageView) findViewById(R.id.img_toolbar_logo); diff --git a/app/src/main/res/layout/activity_home.xml b/app/src/main/res/layout/activity_home.xml index 99c08976..069dfc92 100644 --- a/app/src/main/res/layout/activity_home.xml +++ b/app/src/main/res/layout/activity_home.xml @@ -4,7 +4,8 @@ android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" - android:fitsSystemWindows="false" + android:fitsSystemWindows="true" + android:background="@color/main_gray_color" tools:openDrawer="start"> - \ No newline at end of file + diff --git a/app/src/main/res/layout/custom_nav_header_main.xml b/app/src/main/res/layout/custom_nav_header_main.xml index 46fe4df7..b8adbe32 100644 --- a/app/src/main/res/layout/custom_nav_header_main.xml +++ b/app/src/main/res/layout/custom_nav_header_main.xml @@ -4,6 +4,7 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/main_gray_color" + android:fitsSystemWindows="true" android:isScrollContainer="true" android:orientation="vertical"> @@ -199,4 +200,4 @@ android:textColor="@color/white_color" /> - \ No newline at end of file + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 8a62a62e..4ca0676a 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -10,6 +10,10 @@ true + + - \ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 4ca0676a..1b5d5710 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -328,11 +328,4 @@ - - - From 7ebcbcddcfddf495b55b49aaa9bc3ca49577a616 Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Tue, 17 Feb 2026 14:09:55 +0000 Subject: [PATCH 17/23] edge-to-edge MakeCode --- .../microbit/ui/activity/MakeCodeWebView.java | 40 +++++++++++++++++-- app/src/main/res/layout/activity_makecode.xml | 17 ++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 app/src/main/res/layout/activity_makecode.xml diff --git a/app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java b/app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java index 4c206124..be119033 100644 --- a/app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java +++ b/app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java @@ -9,6 +9,8 @@ import android.util.Base64; import android.util.Log; import android.view.View; +import android.view.ViewGroup; +import android.view.Window; import android.webkit.DownloadListener; import android.webkit.JavascriptInterface; import android.webkit.ValueCallback; @@ -17,6 +19,7 @@ import android.webkit.WebSettings; import android.webkit.WebView; import android.webkit.WebViewClient; +import android.widget.LinearLayout; import android.widget.Toast; import com.samsung.microbit.BuildConfig; @@ -31,7 +34,11 @@ import static android.content.ContentValues.TAG; +import androidx.core.graphics.Insets; +import androidx.core.view.ViewCompat; import androidx.core.view.WindowCompat; +import androidx.core.view.WindowInsetsCompat; +import androidx.core.view.WindowInsetsControllerCompat; /** * Displays MakeCode @@ -54,19 +61,35 @@ public class MakeCodeWebView extends Activity implements View.OnClickListener { private boolean mRelaunchOnFinishNavigation = false; private String mRelaunchURL = makecodeUrl; - public static void setMakecodeUrl(String url) { makecodeUrl = url; } + protected void showSystemBars( boolean show) { + WindowInsetsControllerCompat wIC = + WindowCompat.getInsetsController(getWindow(), getWindow().getDecorView()); + if (wIC == null) { + return; + } + + int type = WindowInsetsCompat.Type.statusBars(); + if (show) { + wIC.show(type); + } else { + wIC.hide(type); + } + } + @Override protected void onStart() { super.onStart(); + showSystemBars( false); } @Override protected void onStop() { super.onStop(); + showSystemBars( true); } @Override @@ -77,8 +100,19 @@ protected void onCreate(Bundle savedInstanceState) { activityHandle = this; - setContentView(R.layout.activity_help_web_view); - webView = (WebView) findViewById(R.id.generalView); + setContentView(R.layout.activity_makecode); + + ViewCompat.setOnApplyWindowInsetsListener( findViewById(R.id.MakeCode), (v, windowInsets) -> { + Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()); + ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams) v.getLayoutParams(); + mlp.leftMargin = insets.left; + mlp.bottomMargin = insets.bottom; + mlp.rightMargin = insets.right; + v.setLayoutParams(mlp); + return WindowInsetsCompat.CONSUMED; + }); + + webView = (WebView) findViewById(R.id.MakeCodeWebView); webView.setLayerType(View.LAYER_TYPE_HARDWARE, null); diff --git a/app/src/main/res/layout/activity_makecode.xml b/app/src/main/res/layout/activity_makecode.xml new file mode 100644 index 00000000..a3e7994d --- /dev/null +++ b/app/src/main/res/layout/activity_makecode.xml @@ -0,0 +1,17 @@ + + + + + From 6dcfb7d3a0b3c512d47581ad7d3a3696478430b6 Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Wed, 18 Feb 2026 23:30:59 +0000 Subject: [PATCH 18/23] edge-to-edge MakeCode avoid cutout --- .../com/samsung/microbit/ui/activity/MakeCodeWebView.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java b/app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java index be119033..f2b6350c 100644 --- a/app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java +++ b/app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java @@ -103,11 +103,13 @@ protected void onCreate(Bundle savedInstanceState) { setContentView(R.layout.activity_makecode); ViewCompat.setOnApplyWindowInsetsListener( findViewById(R.id.MakeCode), (v, windowInsets) -> { - Insets insets = windowInsets.getInsets(WindowInsetsCompat.Type.systemBars()); + Insets insets = windowInsets.getInsets( + WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout()); ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams) v.getLayoutParams(); mlp.leftMargin = insets.left; mlp.bottomMargin = insets.bottom; mlp.rightMargin = insets.right; + mlp.topMargin = insets.top; v.setLayoutParams(mlp); return WindowInsetsCompat.CONSUMED; }); From 168558f9e81bb04ed491c5b033a8b745f038924e Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Sun, 1 Mar 2026 12:59:50 +0000 Subject: [PATCH 19/23] edge-to-edge MakeCode avoid keyboard --- .../java/com/samsung/microbit/ui/activity/MakeCodeWebView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java b/app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java index f2b6350c..f5a7f9c1 100644 --- a/app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java +++ b/app/src/main/java/com/samsung/microbit/ui/activity/MakeCodeWebView.java @@ -104,7 +104,7 @@ protected void onCreate(Bundle savedInstanceState) { ViewCompat.setOnApplyWindowInsetsListener( findViewById(R.id.MakeCode), (v, windowInsets) -> { Insets insets = windowInsets.getInsets( - WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout()); + WindowInsetsCompat.Type.systemBars() | WindowInsetsCompat.Type.displayCutout() | WindowInsetsCompat.Type.ime()); ViewGroup.MarginLayoutParams mlp = (ViewGroup.MarginLayoutParams) v.getLayoutParams(); mlp.leftMargin = insets.left; mlp.bottomMargin = insets.bottom; From 8d28863cd1105135116a5a8dd9516f43df367ab5 Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Mon, 2 Mar 2026 14:45:22 +0000 Subject: [PATCH 20/23] edge-to-edge MakeCode avoid keyboard --- app/src/main/AndroidManifest.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 68bae14a..e3f391af 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -163,6 +163,7 @@ android:name=".ui.activity.MakeCodeWebView" android:configChanges="orientation|screenSize" android:label="MakeCode Webview" + android:windowSoftInputMode="adjustResize" android:launchMode="singleTask" android:theme="@android:style/Theme.NoTitleBar.Fullscreen"/> Date: Tue, 3 Mar 2026 15:23:46 +0000 Subject: [PATCH 21/23] edge-to-edge MakeCode orientation and keyboard changes --- app/src/main/AndroidManifest.xml | 2 +- .../microbit/ui/activity/MakeCodeWebView.java | 34 ++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index e3f391af..62612f8b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -161,7 +161,7 @@ android:launchMode="singleTask"/> filePathCallback, WebChromeClient.FileChooserParams fileChooserParams) { onShowFileChooser_filePathCallback = filePathCallback; try { From 76a649345da5708cd2a7345568add762e149c6c3 Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Fri, 6 Mar 2026 19:15:14 +0000 Subject: [PATCH 22/23] Revert to DFU 2.4.1 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 6211fadc..8fd6b6bf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -44,7 +44,7 @@ dependencies { implementation 'androidx.cardview:cardview:1.0.0' implementation 'androidx.recyclerview:recyclerview:1.4.0' implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.30' - implementation 'no.nordicsemi.android:dfu:2.10.1' + implementation 'no.nordicsemi.android:dfu:2.4.1' implementation project(':pfLibrary') implementation 'com.google.android.gms:play-services-analytics:18.1.1' implementation 'com.google.code.gson:gson:2.13.2' From 607c87c819e85e62c4da3e66fd38faedf5ea3da7 Mon Sep 17 00:00:00 2001 From: Martin Williams Date: Sat, 7 Mar 2026 00:10:46 +0000 Subject: [PATCH 23/23] edge-to-edge My Data --- .../microbit/ui/activity/FetchActivity.java | 24 +++++++++++++++++++ app/src/main/res/layout/fetch_web.xml | 4 +++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/samsung/microbit/ui/activity/FetchActivity.java b/app/src/main/java/com/samsung/microbit/ui/activity/FetchActivity.java index 0bc34806..334609ae 100644 --- a/app/src/main/java/com/samsung/microbit/ui/activity/FetchActivity.java +++ b/app/src/main/java/com/samsung/microbit/ui/activity/FetchActivity.java @@ -31,6 +31,7 @@ import android.webkit.WebView; import android.webkit.WebViewClient; import android.widget.ImageView; +import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; @@ -40,6 +41,7 @@ import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.core.content.PermissionChecker; +import androidx.core.view.ViewCompat; import androidx.core.view.WindowCompat; import com.samsung.microbit.MBApp; @@ -739,12 +741,34 @@ private void displayCreate() { //Remove title bar this.requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.fetch_main); + + // Pass insets to children + ViewCompat.setOnApplyWindowInsetsListener( findViewById(R.id.fetchMain), (v, windowInsets) -> { + LinearLayout root = (LinearLayout) v; + int childCount = root.getChildCount(); + for (int index = 0; index < childCount; ++index) { + ViewCompat.dispatchApplyWindowInsets( root.getChildAt(index), windowInsets); + } + return windowInsets; + }); + displayHtmlDelete(); displayInit(); } public void displayConfigurationChanged(Configuration newConfig) { setContentView(R.layout.fetch_main); + + // Pass insets to children + ViewCompat.setOnApplyWindowInsetsListener( findViewById(R.id.fetchMain), (v, windowInsets) -> { + LinearLayout root = (LinearLayout) v; + int childCount = root.getChildCount(); + for (int index = 0; index < childCount; ++index) { + ViewCompat.dispatchApplyWindowInsets( root.getChildAt(index), windowInsets); + } + return windowInsets; + }); + displayInit(); } diff --git a/app/src/main/res/layout/fetch_web.xml b/app/src/main/res/layout/fetch_web.xml index 08cfb67c..7669f9da 100644 --- a/app/src/main/res/layout/fetch_web.xml +++ b/app/src/main/res/layout/fetch_web.xml @@ -4,7 +4,9 @@ android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="0dp" - android:orientation="vertical"> + android:background="@color/main_gray_color" + android:orientation="vertical" + android:fitsSystemWindows="true">