实现如下样式切换
1、布局文件
<com.google.android.material.tabs.TabLayout android:id="@+id/tabLayout" android:layout_width="match_parent" android:layout_height="40dp" android:layout_marginStart="@dimen/margin_15dp" android:layout_marginEnd="@dimen/margin_15dp" android:background="@drawable/shape_white_alp40" 背景色 android:gravity="center_vertical" app:tabBackground="@drawable/shape_white" 点击后背景色 app:tabIndicatorHeight="0dp" app:tabMode="fixed" app:tabRippleColor="&#