title: Custom App bar adding text and icons - Android
body: <p>i have created a simple custom appbar, I want to add text and icon, and also to change text color. </p>
  
  <p><a href="https://i.stack.imgur.com/ud8Ys.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ud8Ys.png" alt="enter image description here"></a></p>
  
  <p>I tried it Like this, but didnt work.</p>
  
  <p><strong>Manifest - label</strong></p>
  
  <pre><code>&lt;application
          android:allowBackup="true"
          android:icon="@mipmap/ic_launcher"
          android:label="@string/app_name"
          android:supportsRtl="true"
          android:theme="@style/AppTheme"&gt;
          &lt;activity
              android:name=".Login"
              android:screenOrientation="portrait"&gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name=".Signup"/&gt;
          &lt;activity
              android:name=".ForgotPassword"
              android:label="@string/forgotpass" /&gt;
          &lt;activity
              android:name=".CompanyProfile"
              android:label="@string/your_company_profile" /&gt;
  </code></pre>
  
  <p><strong>App_bar</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="?android:attr/actionBarSize"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:background="@color/colorAccent"
      app:theme="@style/myCustomAppBarTheme"
      app:popupTheme="@style/ThemeOverlay.AppCompat.Dark"&gt;
  
  &lt;/android.support.v7.widget.Toolbar&gt;
  </code></pre>
  
  <p><strong>Main_menu</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools" tools:context=".MainActivity"&gt;
  
  
      &lt;item android:id="@+id/action_settings"
          android:title="@string/action_settings"
          android:showAsAction="always"
          android:orderInCategory="100"
          /&gt;
  
  &lt;/menu&gt;
  </code></pre>
  
  <p><strong>Style</strong></p>
  
  <pre><code>&lt;resources&gt;
  
      &lt;!-- Base application theme. --&gt;
      &lt;style name="AppTheme" parent="AppTheme.Base"&gt;
          &lt;!-- Customize your theme here. --&gt;
      &lt;/style&gt;
  
      &lt;style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar"&gt;
          &lt;item name="colorPrimary"&gt;@color/colorPrimaryDark&lt;/item&gt;
          &lt;item name="colorPrimaryDark"&gt;@color/colorPrimary&lt;/item&gt;
          &lt;item name="colorAccent"&gt;@color/colorAccent&lt;/item&gt;
  
      &lt;/style&gt;
  
      &lt;!--*************************    Custom Theme  *******************************  --&gt;
          &lt;style name="myCustomAppBarTheme" parent="Theme.AppCompat.Light"&gt;
              &lt;item name="android:actionBarStyle"&gt;@style/AppTheme.ActionBar&lt;/item&gt;
              &lt;item name="actionBarStyle"&gt;@style/AppTheme.ActionBar&lt;/item&gt;
          &lt;/style&gt;
  
          &lt;style name="AppTheme.ActionBar" parent="Widget.AppCompat.Light.ActionBar"&gt;
              &lt;item name="android:titleTextStyle"&gt;@style/AppTheme.ActionBar.TitleText&lt;/item&gt;
              &lt;item name="titleTextStyle"&gt;@style/AppTheme.ActionBar.TitleText&lt;/item&gt;
              &lt;item name="android:height"&gt;100dp&lt;/item&gt;
              &lt;item name="height"&gt;100dp&lt;/item&gt;
          &lt;/style&gt;
  
          &lt;style name="AppTheme.ActionBar.TitleText" parent="TextAppearance.AppCompat.Widget.ActionBar.Title"&gt;
              &lt;item name="android:textSize"&gt;20sp&lt;/item&gt;
              &lt;item name="android:textColor"&gt;@color/colorWhite&lt;/item&gt;
          &lt;/style&gt;
      &lt;!--****************************  Custom Theme  *******************************  --&gt;
  
  &lt;/resources&gt;
  </code></pre>
  
  <p><strong>Activity</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      xmlns:tools="http://schemas.android.com/tools"
      android:orientation="vertical"
      android:background="@color/colorWhite"&gt;
  
      &lt;!-- Include Appbar --&gt;
      &lt;include
          android:id="@+id/app_bar"
          layout="@layout/app_bar" /&gt;
  
      &lt;!-- include Shadow below appbar --&gt;
      &lt;View android:layout_width="match_parent"
          android:layout_height="5dp"
          android:background="@drawable/toolbar_dropshadow"/&gt;
  
      &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:tools="http://schemas.android.com/tools"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:paddingBottom="@dimen/activity_vertical_margin"
          android:paddingLeft="@dimen/activity_horizontal_margin"
          android:paddingRight="@dimen/activity_horizontal_margin"
          android:paddingTop="@dimen/activity_vertical_margin"
          tools:context="com.example.baman.zupportdesk.ForgotPassword"
          android:background="@color/colorWhite"&gt;
  
          &lt;TextView
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:textAppearance="?android:attr/textAppearanceSmall"
              android:text="@string/pass_forgot"
              android:id="@+id/textView3"
              android:layout_alignParentTop="true"
              android:layout_alignParentLeft="true"
              android:layout_alignParentStart="true"
              android:textColor="@color/colorBlack"
              android:textSize="14dp" /&gt;
  
          &lt;EditText
              android:layout_width="match_parent"
              android:layout_height="50dp"
              android:inputType="textEmailAddress"
              android:ems="10"
              android:id="@+id/et_FP_email"
              android:drawableLeft="@drawable/icon_person"
              android:background="@color/editText_bg"
              android:textSize="18sp"
              android:hint="Enter email address"
              android:paddingLeft="5dp"
              android:textStyle="bold"
              android:layout_below="@+id/textView3"
              android:layout_alignParentLeft="true"
              android:layout_alignParentStart="true"
              android:layout_marginTop="20dp" /&gt;
  
          &lt;Button
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:text="@string/submit"
              android:id="@+id/btn_FP_submit"
              android:textAllCaps="false"
              android:background="@drawable/button_style"
              android:textColor="@color/colorWhite"
              android:textSize="20dp"
              android:textStyle="bold"
              android:layout_below="@+id/et_FP_email"
              android:layout_alignParentLeft="true"
              android:layout_alignParentStart="true"
              android:layout_marginTop="20dp" /&gt;
      &lt;/RelativeLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I want to add icon, Title and also change the tilte color in appbar. can some one help me to do this. tnx.</p>