I have made a material design toolbar. The menu item includes a cart. I want a number to be shown along with the cart icon indicating the number of items present in the cart.
toolbar.xml
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Light"
android:id="@+id/tool_bar"
android:elevation="6dp">
menu_cart.xml
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item android:id="@+id/action_cart" android:icon="@drawable/bag"
android:title="Cart"
android:orderInCategory="100" app:showAsAction="always" />
</menu>
The textview should be visible on top of the cart icon hiding it a bit,maybe. Not as a textview beside the cart icon.
Something like this -