Используйте этот помощник, он использует отражение для изменения свойств TextView (s) BottomNavigationBar!
public class BottomNavigationViewHelper {
public static void refineBottomBar(Context context, BottomNavigationView view) {
BottomNavigationMenuView menuView = (BottomNavigationMenuView) view.getChildAt(0);
try {
for (int i = 0; i < menuView.getChildCount(); i++) {
BottomNavigationItemView item = (BottomNavigationItemView) menuView.getChildAt(i);
Field LargeText = item.getClass().getDeclaredField("mLargeLabel");
LargeText.setAccessible(true);
Field SmallText = item.getClass().getDeclaredField("mSmallLabel");
SmallText.setAccessible(true);
TextView SmallTextView =(TextView) SmallText.get(item);
TextView LargeTextView =(TextView) LargeText.get(item);
SmallTextView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
LargeTextView.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
SmallTextView.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);
LargeTextView.setGravity(Gravity.CENTER_VERTICAL | Gravity.CENTER_HORIZONTAL);
LargeTextView.setPadding(0, 0, 0, 0);
SmallTextView.setPadding(0, 0, 0, 0);
}
} catch (NoSuchFieldException e) {
Log.e("BNVHelper", "Unable to get shift mode field", e);
} catch (IllegalAccessException e) {
Log.e("BNVHelper", "Unable to change value of shift mode", e);
}
}
}