diff --git a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java index 1ead9f66615..773b6ea5cb7 100644 --- a/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java +++ b/android/modules/ui/src/java/ti/modules/titanium/ui/widget/tabgroup/TiUIBottomNavigationTabGroup.java @@ -31,6 +31,7 @@ import com.google.android.material.shape.ShapeAppearanceModel; import org.appcelerator.kroll.common.Log; +import org.appcelerator.titanium.R; import org.appcelerator.titanium.TiBaseActivity; import org.appcelerator.titanium.TiC; import org.appcelerator.titanium.TiDimension; @@ -79,13 +80,18 @@ public void addTab(TabProxy tabProxy) } } + @SuppressLint("PrivateResource") @Override public void addViews(TiBaseActivity activity) { // Manually calculate the proper position of the BottomNavigationView. - int resourceID = activity.getResources().getIdentifier("design_bottom_navigation_height", "dimen", - activity.getPackageName()); - this.mBottomNavigationHeightValue = activity.getResources().getDimensionPixelSize(resourceID); + this.mBottomNavigationHeightValue + = activity.getResources().getDimensionPixelSize(R.dimen.design_bottom_navigation_height); + + if (activity.getTheme().toString().indexOf("Material3") > -1) { + this.mBottomNavigationHeightValue + = activity.getResources().getDimensionPixelSize(R.dimen.m3_bottom_nav_min_height); + } // Fetch padding properties. If at least 1 property is non-zero, then show a floating tab bar. final TiDimension paddingLeft = TiConvert.toTiDimension(