0

I have a problem with BottomNavigationView. I have to inflate menu runtime and I have a problem with default animation. It looks like tabs slide from right. Do you know how to disable this animation/behavior?

Default animation

XML:

    <com.google.android.material.bottomnavigation.BottomNavigationView
            android:id="@+id/navigation"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/white"
            app:itemActiveIndicatorStyle="@null"
            app:itemBackground="@null"
            app:itemIconSize="75dp"
            app:itemRippleColor="@null"
            app:labelVisibilityMode="unlabeled" />

Replacing menu runtime:

 binding.navigation.menu.clear()
 binding.navigation.inflateMenu(menuId)
0

1 Answer 1

3

I solved problem by using TransitionManager.endTransitions(...)

binding.navigation.menu.clear()
binding.navigation.inflateMenu(menuId)
TransitionManager.endTransitions(binding.navigation.getChildAt(0) as NavigationBarMenuView)

Maybe it will help someone else. If you have better way to solve this let me know. Thanks in advance!

Not the answer you're looking for? Browse other questions tagged or ask your own question.