I am trying to show unread notification in tab. Below is my custom tab layout.
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/tabTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="sample"
android:alpha="0.5"
android:textStyle="bold"
android:layout_marginRight="4dp"
android:textColor="@android:color/white"
/>
<TextView
android:id="@+id/tabBadge"
android:layout_width="28dp"
android:layout_height="28dp"
android:layout_toRightOf="@id/tabTitle"
android:layout_centerVertical="true"
android:textColor="#FFF"
android:gravity="center"
android:text="10"
android:visibility="visible"
android:textStyle="bold"
android:background="@drawable/badge_circle"/>
</RelativeLayout>
I tried below for badge_circle.xml one by one. But all of them gives me only oval shape. I am literally confused now on how to make the circle shape.
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="ring" >
<gradient
android:startColor="#FFFF0000"
android:endColor="#FFFF0000"
android:angle="270"/>
</shape>
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<gradient
android:type="radial"
android:gradientRadius="5"
android:centerX=".2"
android:centerY=".1"
android:startColor="#FFFF00"
android:endColor="#FFFF99" />
<size
android:width="20dp"
android:height="20dp"/>
</shape>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid
android:color="#d3d3d3"/>
<size
android:width="8dp"
android:height="8dp"/>
</shape>
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<gradient
android:angle="0"
android:startColor="#FF000000"
android:endColor="#FFFFFFFF" />
</shape>