Is it possible to reduce the top and bottom padding in TabLayout?

Viewed 116

I am defining a TabLayout with a layout_height of wrap_content as follows:

<com.google.android.material.tabs.TabLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:tabBackground="@color/grey"
    app:tabGravity="fill"
    app:tabIndicatorColor="@color/textColorPrimary"
    app:tabIndicatorFullWidth="true"
    app:tabMode="fixed"
    app:tabTextColor="@color/textColorPrimary" />

This renders as demonstrated in the image below.

TabLayout with non-fixed height

Is it possible to provide some properties to the TabLayout – whilst keeping its layout_height as wrap_content – so that it appears more vertically compact as in the image below?

TabLayout with fixed height

I have tried setting the tabPaddingTop and tabPaddingBottom values to 0dp but that does not produce any visual change.

0 Answers
Related