I solved this problem by using custom Navigation layout
Using it you can customize anything in title on action bar:
build.gradle
dependencies {
compile 'com.android.support:appcompat-v7:21.0.+'
...
}
AndroidManifest.xml
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name">
<activity
android:name=".MainActivity"
android:theme="@style/ThemeName">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
styles.xml
<style name="ThemeName" parent="Theme.AppCompat.Light">
<item name="actionBarStyle">@style/ActionBar</item>
<item name="android:actionBarStyle" tools:ignore="NewApi">@style/ActionBar</item>
<style name="ActionBar" parent="Widget.AppCompat.ActionBar">
<item name="displayOptions">showCustom</item>
<item name="android:displayOptions" tools:ignore="NewApi">showCustom</item>
<item name="customNavigationLayout">@layout/action_bar</item>
<item name="android:customNavigationLayout" tools:ignore="NewApi">@layout/action_bar</item>
<item name="background">@color/android:white</item>
<item name="android:background">@color/android:white</item>
action_bar.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/action_bar_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:drawableLeft="@drawable/ic_launcher"
android:drawablePadding="10dp"
android:textSize="20sp"
android:textColor="@android:color/black"
android:text="@string/app_name"/>