I'm using SmartTabLayout
. And I want to use indicator like this (like a circle). I couldn't find some appropriate argument in xml
.
Any ideas?
Want this:
I have this:
XML code:
<com.ogaclejapan.smarttablayout.SmartTabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="48dp"
app:stl_clickable="true"
app:stl_defaultTabBackground="?attr/selectableItemBackground"
app:stl_defaultTabTextAllCaps="true"
app:stl_defaultTabTextColor="#FC000000"
app:stl_defaultTabTextHorizontalPadding="16dp"
app:stl_defaultTabTextMinWidth="0dp"
app:stl_defaultTabTextSize="12sp"
app:stl_distributeEvenly="false"
app:stl_dividerColor="#4D000000"
app:stl_dividerThickness="1dp"
app:stl_drawDecorationAfterTab="false"
app:stl_indicatorAlwaysInCenter="false"
app:stl_indicatorColor="#40C4FF"
app:stl_indicatorCornerRadius="2dp"
app:stl_indicatorGravity="bottom"
app:stl_indicatorInFront="false"
app:stl_indicatorInterpolation="smart"
app:stl_indicatorThickness="4dp"
app:stl_indicatorWidth="auto"
app:stl_indicatorWithoutPadding="false"
app:stl_overlineColor="#4D000000"
app:stl_overlineThickness="0dp"
app:stl_titleOffset="24dp"
app:stl_underlineColor="#4D000000"
app:stl_underlineThickness="1dp" />
Going through some of the code in the demo. I came across "Trick 1" layout which is probably the answer. Test it out and get back to me if it doesn't work. If it doesn't work, I will pull the project and test it out.
<com.ogaclejapan.smarttablayout.SmartTabLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@id/viewpagertab"
android:layout_width="match_parent"
android:layout_height="@dimen/tab_height"
android:clipToPadding="false"
android:paddingLeft="4dp"
android:paddingRight="4dp"
app:stl_defaultTabTextColor="@color/white"
app:stl_defaultTabTextHorizontalPadding="18dp"
app:stl_dividerColor="@color/transparent"
app:stl_dividerThickness="0dp"
app:stl_indicatorColor="@color/black_20"
app:stl_indicatorCornerRadius="18dp"
app:stl_indicatorInterpolation="smart"
app:stl_indicatorGravity="center"
app:stl_indicatorThickness="36dp"
app:stl_underlineColor="@color/transparent"
app:stl_underlineThickness="0dp"
/>