message: Ran measure and layout from requestLayout
  Got the idea from react-native-screens
diff: @@ -13,6 +13,8 @@ import androidx.annotation.Nullable;
  import androidx.viewpager.widget.PagerAdapter;
  import androidx.viewpager.widget.ViewPager;
  +import com.facebook.react.modules.core.ChoreographerCompat;
  +import com.facebook.react.modules.core.ReactChoreographer;
  import com.google.android.material.bottomnavigation.BottomNavigationView;
  public class TabNavigationView extends BottomNavigationView implements TabView {
  @@ -22,6 +24,17 @@ public class TabNavigationView extends BottomNavigationView implements TabView {
  int unselectedTintColor;
  private ViewPager.OnPageChangeListener pageChangeListener;
  private DataSetObserver dataSetObserver;
  + private boolean layoutRequested = false;
  + private final ChoreographerCompat.FrameCallback layoutCallback = new ChoreographerCompat.FrameCallback() {
  + @Override
  + public void doFrame(long frameTimeNanos) {
  + layoutRequested = false;
  + measure(
  + MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.EXACTLY),
  + MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.EXACTLY));
  + layout(getLeft(), getTop(), getRight(), getBottom());
  + }
  + };
  public TabNavigationView(Context context) {
  super(context);
  @@ -96,8 +109,15 @@ public class TabNavigationView extends BottomNavigationView implements TabView {
  for (int i = 0; i < pagerAdapter.getCount(); i++) {
  getMenu().add(Menu.NONE, i, i, pagerAdapter.getPageTitle(i));
  }
  - requestLayout();
  - post(measureAndLayout);
  + }
  +
  + @Override
  + public void requestLayout() {
  + super.requestLayout();
  + if (!layoutRequested && layoutCallback != null) {
  + layoutRequested = true;
  + ReactChoreographer.getInstance().postFrameCallback(ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE, layoutCallback);
  + }
  }
  @Override
  @@ -108,21 +128,9 @@ public class TabNavigationView extends BottomNavigationView implements TabView {
  @Override
  public void setTitle(int index, String title) {
  getMenu().getItem(index).setTitle(title);
  - post(measureAndLayout);
  }
  public void setIcon(int index, Drawable icon) {
  getMenu().getItem(index).setIcon(icon);
  - post(measureAndLayout);
  }
  -
  - final Runnable measureAndLayout = new Runnable() {
  - @Override
  - public void run() {
  - measure(
  - MeasureSpec.makeMeasureSpec(getWidth(), MeasureSpec.EXACTLY),
  - MeasureSpec.makeMeasureSpec(getHeight(), MeasureSpec.EXACTLY));
  - layout(getLeft(), getTop(), getRight(), getBottom());
  - }
  - };
  }
  