Skip to content

Instantly share code, notes, and snippets.

@AntonioDiaz
Created March 24, 2017 15:45
Show Gist options
  • Save AntonioDiaz/1ad14336e28805a84d163a4864f353a3 to your computer and use it in GitHub Desktop.
Save AntonioDiaz/1ad14336e28805a84d163a4864f353a3 to your computer and use it in GitHub Desktop.
Add view inside toolbar.
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:contentInsetLeft="0dp"
app:contentInsetStart="0dp"
app:titleTextColor="@android:color/white"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
app:layout_scrollFlags="scroll|enterAlways">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/ic_launcher"/>
<TextView
android:id="@+id/toolbar_title"
android:layout_marginLeft="16dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="toolbar title"
android:textColor="@android:color/white"
android:layout_marginTop="16dp"
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"/>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="subtitle caranchoa"
android:layout_margin="50dp"
android:textAlignment="center"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Display1"
android:textColor="@android:color/white"/>
</LinearLayout>
</android.support.v7.widget.Toolbar>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment