Questions tagged [android-toolbar]

A Toolbar is a widget based generalization of action bars for use within layouts.

The Toolbar was introduced in Android 5.0 Lollipop however it was also added to Added to appcompat-v7:21.0.0 for backwards compatibility. The widget consists of a navigation button, a title and subtitle, one or more custom views and an action menu. You should use Toolbar instead of Actionbar when you want to use the Actionbar features but you require more control over it's appearance, if you want multiple Actionbars, or if you want Actionbars that only take up part of the width of the screen.

For more information:

See also:

3112 questions
54
votes
12 answers

android lollipop toolbar: how to hide/show the toolbar while scrolling?

I'm using the new toolbar widget introduced in the appcompat / support-v7. I would like to hide/show the toolbar depending on if the user is scrolling up/down the page, just like in the new Google's playstore app or NewsStand app. Is there something…
nomongo
  • 3,435
  • 7
  • 30
  • 33
52
votes
7 answers

How to enable homeAsUp or call setDisplayHomeAsUpEnabled() on standalone toolbar with appcompat v21

I am trying to convert my app to use the v21 AppCompat library, so I started to use Toolbar instead of ActionBar. In all my regular activities (which extend ActionBarActivity) everything is fine. but in my SettingsActivity which extends…
Gavriel
  • 18,880
  • 12
  • 68
  • 105
51
votes
5 answers

How to keep the toolbar visible with adjustPan?

I have a layout like the one below and I would like to have the following behavior when the user taps on the EditText: Keyboard should overlay the "LinearLayout aligned to the bottom"; EditText should be visible on the screen, not overlaid by the…
Gustavo Pagani
  • 6,583
  • 5
  • 40
  • 71
51
votes
3 answers

Hide/Show Toolbar programmatically on CoordinatorLayout

When I scroll my RecycleView ToolBar hide or show (with animation). How I can return ToolBar back programmatically?
Artem
  • 4,569
  • 12
  • 44
  • 86
51
votes
1 answer

How do you remove an inflated menu/items from the new Lollipop Toolbar?

I include a v7 Toolbar in my layout. I'm…
loeschg
  • 29,961
  • 26
  • 97
  • 150
50
votes
6 answers

Change Toolbar Menu Item color (non-hidden action)

Say I have a menu (options_menu.xml) similar to the following:
loeschg
  • 29,961
  • 26
  • 97
  • 150
50
votes
8 answers

"Back button" using getSupportActionbar and appcompat v7 toolbar

I'm using the new toolbar from the Appcompat V7 library and I'm making an application with navigation drawer and with fragments. In some fragments I don't want to show the hamburger icon but the arrow instead... That is fine I did this in this…
András Ferencz
  • 622
  • 1
  • 7
  • 15
49
votes
4 answers

Seeing message in logs: "app:theme is deprecated"?

Ever since upgrading to the latest appcompat library, I'm seeing a message in my logs from ViewUtils. app:theme is now deprecated. Please move to using android:theme instead. I'm using parent="Theme.AppCompat.Light.NoActionBar" as my theme parent.
spierce7
  • 14,797
  • 13
  • 65
  • 106
49
votes
12 answers

How to change Toolbar Navigation and Overflow Menu icons (appcompat v7)?

I am having a hard time with v7 Toolbar. What was once a simple task for ActionBar, now seems overly complex. No matter what style I set, I cannot change either navigation icon (which opens a Drawer) or overflow menu icon (which opens a menu). So I…
49
votes
12 answers

Toolbar icon tinting on Android

I've noticed that using AppCompat themes, default toolbar icons get tinted by the attribute colorControlNormal in my style. As you…
natario
  • 24,954
  • 17
  • 88
  • 158
49
votes
15 answers

How can I fix the Spinner style for Android 4.x placed on top of the Toolbar

According to Android documentation, Material Design style is supported for Spinner widget. So I decided to use it in my app placing it on top of the Toolbar. layout/activity_base.xml
Damian Petla
  • 8,963
  • 5
  • 44
  • 47
48
votes
16 answers

Clicking hamburger icon on Toolbar does not open Navigation Drawer

I have a simple android.support.v7.widget.Toolbar and all I am trying to do is to open a NavigationDrawer by pressing the "hamburger" icon in the top left corner. The "hamburger" button is visible, and when I start to pull from the left I see the…
ez4nick
  • 9,756
  • 12
  • 37
  • 69
47
votes
5 answers

How to reduce the gap between navigation icon and toolbar title?

My problem is the extra space between the nav-drawer icon and toolbar title. The sample images are below: The xml view of the toolbar is
47
votes
6 answers

Using Toolbar with Fragments

I am trying to create a viewpager that swipes through 3 different fragments each with a different toolbar. I have implemented the new toolbar in an activity before and got it to work however I am trying to get it to work with fragments Here is the…
47
votes
2 answers

Android Lollipop, add popup menu from title in toolbar

I'm unable to see how adding a popup menu from the title is accomplished like is shown in many of the material design examples. Any help would be much appreciated.
Matt Wear
  • 1,211
  • 2
  • 15
  • 24