In android.support.design.widget.TabLayout , how to make the active tab always appear in the center, exactly the same as in the Play Newsstand application, as shown below.
The first and last tab should also appear in the center.


I tried using padding in TabLayout. This does not work. This is the code I wrote:
<android.support.design.widget.TabLayout android:id="@+id/tabs" android:layout_width="wrap_content" android:layout_height="wrap_content" app:tabIndicatorColor="@color/yellow" app:tabSelectedTextColor="@android:color/white" app:tabTextColor="#EEE" app:tabMode="scrollable" android:gravity="bottom" android:clipToPadding="false" android:paddingLeft="90dp" android:paddingRight="90dp" />
In this case, tabIndicator will also shift 90dp to the left. It should remain in the center regardless of filling.
source share