|
31 | 31 | import android.webkit.WebView; |
32 | 32 | import android.webkit.WebViewClient; |
33 | 33 | import android.widget.ImageView; |
| 34 | +import android.widget.LinearLayout; |
34 | 35 | import android.widget.TextView; |
35 | 36 | import android.widget.Toast; |
36 | 37 |
|
|
40 | 41 | import androidx.core.app.ActivityCompat; |
41 | 42 | import androidx.core.content.ContextCompat; |
42 | 43 | import androidx.core.content.PermissionChecker; |
| 44 | +import androidx.core.view.ViewCompat; |
43 | 45 | import androidx.core.view.WindowCompat; |
44 | 46 |
|
45 | 47 | import com.samsung.microbit.MBApp; |
@@ -739,12 +741,34 @@ private void displayCreate() { |
739 | 741 | //Remove title bar |
740 | 742 | this.requestWindowFeature(Window.FEATURE_NO_TITLE); |
741 | 743 | 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 | + |
742 | 755 | displayHtmlDelete(); |
743 | 756 | displayInit(); |
744 | 757 | } |
745 | 758 |
|
746 | 759 | public void displayConfigurationChanged(Configuration newConfig) { |
747 | 760 | 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 | + |
748 | 772 | displayInit(); |
749 | 773 | } |
750 | 774 |
|
|
0 commit comments