Skip to content

Instantly share code, notes, and snippets.

@maxlord
Created October 17, 2016 15:58
Show Gist options
  • Save maxlord/89c39676659920b6caba57b0f304cd39 to your computer and use it in GitHub Desktop.
Save maxlord/89c39676659920b6caba57b0f304cd39 to your computer and use it in GitHub Desktop.
Standalone-toolbar
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
android:theme="@style/ThemeOverlay.AppCompat.Dark"
app:popupTheme="@style/AppTheme.PopupOverlay">
<android.support.v7.widget.LinearLayoutCompat
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<FrameLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginEnd="16dp"
android:layout_marginRight="16dp">
<ImageView
android:id="@+id/toolbar_icon"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:src="@drawable/ic_arrow_back"
android:tint="@color/white"
android:visibility="gone"/>
</FrameLayout>
<TextView
android:id="@+id/toolbar_title"
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/app_name"/>
</android.support.v7.widget.LinearLayoutCompat>
</android.support.v7.widget.Toolbar>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment