Answer the question
In order to leave comments, you need to log in
How to add number on hamburger on navigation drawable?
How to add number on hamburger on navigation drawable?
tried doing something like this:
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:titleTextColor="@color/colorWhite"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" >
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent">
<ImageView
android:id="@+id/openMenu"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:src="@drawable/drawable"/>
<TextView
android:id="@+id/badger"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_gravity="end|right|top"
android:layout_marginTop="10dp"
android:background="@drawable/badge"
android:gravity="center"
android:text="1"
android:textColor="@color/colorWhite"/>
</FrameLayout>
</android.support.v7.widget.Toolbar>
Answer the question
In order to leave comments, you need to log in
If not on the menu, then something like this.
<?xml version="1.0" encoding="utf-8"?>
<pakage.custom_view.ActionView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="36dp"
android:layout_height="36dp"
android:background="@android:color/transparent"
android:orientation="vertical"
android:padding="4dp">
<ImageView
android:id="@+id/icon"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="@android:color/transparent"
tools:src="@drawable/ic_basket"/>
<TextView
android:id="@+id/counter"
style="@style/Counter.White"
android:layout_alignParentRight="true"
tools:text="1"/>
</pakage.custom_view.ActionView>
<android.support.design.widget.AppBarLayout
android:id="@+id/toolbar_layout"
style="@style/ToolBarStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:elevation="0dp"
app:theme="@style/ToolBarStyle"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
style="@style/ToolBarStyle"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ToolBarStyle"
/>
</android.support.design.widget.AppBarLayout>
<TextView
android:id="@+id/main_counter"
style="@style/Counter.White"
android:layout_marginLeft="32dp"
android:layout_marginTop="@dimen/main_counter_top_margin"
android:clickable="false"
android:focusable="false"
app:layout_anchor="@+id/toolbar"
app:layout_anchorGravity="left|top"
/>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question