0

How can I create a toolbar/actionbar that combines the default actiondrawertoggle button (with the burger-arrow animation) with an edittext and a simple button like this?

enter image description here

NoNaMe
  • 6,020
  • 30
  • 82
  • 110
DennisVA
  • 2,068
  • 1
  • 25
  • 35

1 Answers1

0

Toolbar is a ViewGroup, so, you can use a Toolbar as a FrameLayout.

Here is a simple example, take a look at it:

<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_appcompat"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:minHeight="?attr/actionBarSize"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar" >
    <LinearLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >
    //customize your toolbar content layout here.
    </LinearLayout >
</android.support.v7.widget.Toolbar>

Hope you'll be inspired.

SilentKnight
  • 13,761
  • 19
  • 49
  • 78