From 031b423101db5ff98cf5ba941f5104b7e6d75f10 Mon Sep 17 00:00:00 2001 From: Manu Date: Wed, 27 Nov 2024 14:17:06 +0100 Subject: [PATCH] fix: bottomtabs position on Android 15 --- .../views/bottomtabs/BottomTabsLayout.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabsLayout.java b/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabsLayout.java index 926e4590d60..904ba0bcb86 100644 --- a/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabsLayout.java +++ b/lib/android/app/src/main/java/com/reactnativenavigation/views/bottomtabs/BottomTabsLayout.java @@ -27,6 +27,17 @@ public void addView(View child, int index, ViewGroup.LayoutParams params) { } } + @Override + protected void onLayout(boolean changed, int l, int t, int r, int b) { + super.onLayout(changed, l, t, r, b); + if (android.os.Build.VERSION.SDK_INT > 34) { + if (bottomTabsContainer != null) { + int systemBarInsets = getRootWindowInsets().getSystemWindowInsetBottom(); + bottomTabsContainer.setPadding(0, 0, 0, systemBarInsets); + } + } + } + public void addBottomTabsContainer(BottomTabsContainer bottomTabsContainer) { CoordinatorLayout.LayoutParams lp = new CoordinatorLayout.LayoutParams(MATCH_PARENT, WRAP_CONTENT); lp.gravity = Gravity.BOTTOM;