6

Having reviewed a lot of material, I still did not find a solution. As you can see on git below, when you tap on the botton navigation icon, it has gray animation from the center to the edges. Is there a way to disable this animation?

Gray animation Here's my XML

<com.google.android.material.bottomnavigation.BottomNavigationView
        android:id="@+id/bottom_navigation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_gravity="bottom"
        android:background="@android:color/white"
        app:elevation="0dp"
        app:itemIconTint="@color/bottomNavigationIconColor"
        app:itemTextColor="@drawable/nav_item_text_color_state"
        app:labelVisibilityMode="labeled"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:menu="@menu/bottom_navigation_main" />

and nav_item_text_color_state

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:state_checked="false"
        android:color="@color/bottomNavigationIconColor" />
    <item
        android:state_checked="true"
        android:color="#005EFF" />
</selector>

Update Found solution to this. To disable this gray ripple effect just add app:itemBackground="@null" to xml.

1
  • provide your code or xml file
    – Ashish
    Commented May 15, 2019 at 21:15

4 Answers 4

7

Use app:itemRippleColor="@color/your_color" to set your custom color for tap effect or app:itemRippleColor="@null" for no effect

2
  • this is wrong answer
    – oxied
    Commented May 18, 2022 at 17:36
  • app:itemRippleColor="@null" worked for me
    – Mike
    Commented May 9 at 20:37
5

Found solution to this, just add app:itemBackground="@null" to xml.

0
5

Set app:itemBackground to null doesn't work now.

The new way is:

app:itemBackground="@android:color/transparent" 
0

None of the codes above worked for me. If that's the case for you too, try this:

app:itemActiveIndicatorStyle="@null"
app:itemBackground="@android:color/transparent"

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