Adam
Adam

Reputation: 1141

How to disable an animation when Tab is selected in TabLayout android

The grey color appears for fraction of seconds when I touch on TabLayout. how to disable it?enter image description here

Upvotes: 1

Views: 1267

Answers (1)

Patryk Kubiak
Patryk Kubiak

Reputation: 1969

The gray color you see after clicking the TabLayout is a ripple color. You can disable that by setting app:tabRippleColor="@null" in your XML.

Here is the code

  <com.google.android.material.tabs.TabLayout
        android:id="@+id/tabLayout"
        app:tabRippleColor="@null"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">
    </com.google.android.material.tabs.TabLayout>

Upvotes: 4

Related Questions