I want to create a tablayout like this:

As you can see, i have rounded corners for tab layout background. I tried following code:
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<android.support.design.widget.TabLayout
android:id="@+id/tabs2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabIndicatorColor="#CECECF"
app:tabBackground="@drawable/tab_bar_bg"
app:tabMode="fixed"
app:tabGravity="fill"/>
And result:

Is there a way to achive this rounded corners with tablayout? If answer is yes then what is my roadmap?
Ps: Don't mind the icons or icon colors on screenshot.
Add this file to your drawable directory and add it to as background in your custom tab layout.
shape.xml
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<corners
android:bottomLeftRadius="16dp"
android:bottomRightRadius="16dp"
android:radius="32dp"
android:topLeftRadius="16dp"
android:topRightRadius="16dp" />
<solid android:color="@color/tab_color" />
<padding
android:bottom="0dp"
android:left="0dp"
android:right="0dp"
android:top="0dp" />
<size
android:height="32dp" />
</shape>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With