In support library 28 you can use app:tabIndicator to set your app:tabIndicator form.
So you can do the following:
Create your own shape indicator with a rounded corner, and in addition to this, you can set the field to the left, right and bottom of the figure so that the rounding is more correct (so that the indicator does not touch the edges of the screen or view).
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:end="2dp" android:start="2dp" android:bottom="2dp"> <shape android:shape="rectangle"> <corners android:radius="20dp" /> <solid android:color="@color/colorAccent" /> </shape> </item> </layer-list>
Then in your TabLayout xml set app:tabIndicator="@drawable/shape_tab_indicator"
You can also set app:tabIndicatorFullWidth="false" instead of the field set for the form element.
source share