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
1
vote
0 answers

Android toolbar replace colorPrimary with a full width background image in Task View or Recent Apps Screen

Hi I have a problem with my toolbar. I'm testing on a lollipop 5.1.1. I have tried: How to add image in toolbar This Setting header color of app in overview (recent apps) screen takes the full width background image and squashes it into the…
1
vote
2 answers

How to get color of Toolbar's/ActionBar's text color programmatically?

I'm trying to get toolbar's textColor using this method: private int getToolbarTextColor() { int toolbarTextColor; TypedArray typedArray = getTheme().obtainStyledAttributes(new int[]{R.attr.titleTextColor}); try { …
h.nodehi
  • 1,036
  • 1
  • 17
  • 32
1
vote
2 answers

Display back button in fragment with Toolbar

I'm using fragment based navigation, each fragment has it's own toolbar. When navigating to a fragment I want the back button to display in the toolbar. I have overridden the OnCreateView method as follows: public override View…
trampster
  • 8,598
  • 4
  • 37
  • 52
1
vote
1 answer

webview ocuping whole screen, covering the toolbars

I have an app with two toolbars and a webview. When the user slides up in the webview the top toolbar should slide and hide, when he slides down the top toolbar should slide and show, much like the youtube app does.
user3109249
1
vote
2 answers

TextView marquee in toolbar widget not working despite setting necessary properties

Despite setting necessary properties, the marquee animation is NOT working within my toolbar. Does anyone know what is wrong and how this issue can be fixed? Unfortunately, {my app name} has stopped XML
wbk727
  • 8,017
  • 12
  • 61
  • 125
1
vote
1 answer

Android toolbar menu - change dynamically

I have group inside menu.xml and I try to change the visibility of the group. //in the onCreate myToolbar = (Toolbar) findViewById(R.id.my_toolbar); setSupportActionBar(myToolbar); @Override public boolean onPrepareOptionsMenu(Menu menu)…
Alon
  • 2,919
  • 6
  • 27
  • 47
1
vote
2 answers

Extend Toolbar behind Status Bar

I have an application in which I would like to change the color of the Toolbar fairly often. Right now, I am manually setting the Status Bar color and the Toolbar color (where the status bar color is a darker version of the toolbar color). Is it…
vanshg
  • 1,125
  • 2
  • 10
  • 19
1
vote
2 answers

Add Logo (Icon) and app name on the ActionBar?

How can I add app logo as well as app name? I tried, but either logo appears or app name, not both.
1
vote
1 answer

android.support.v7.widget.Toolbar.getNavigationIcon() returns null

I have some classes in my project...but one gives me some problems that I can't solve alone... Here is the onCreate method that causes me trouble : @Override protected void onCreate(Bundle savedInstanceState) { …
Mesabloo
  • 337
  • 4
  • 13
1
vote
1 answer

How to show pinned view to Toolbar in CoordinatorLayout

How show view detail on the AppBarLayout or Toolbar with Material Design implementation like below:
1
vote
1 answer

Hide App name in Navigation Drawer

I need some guide to remove the name of app which is quite annoying in top bar of navigation: App Top Bar Navigation I'm using Toolbar and native google Navigation Drawer I tried some method…
Blacksword
  • 331
  • 3
  • 17
1
vote
1 answer

AppCompat ActionBar restoring original layout

In my app, I use a MainActivity for storing the main layout (DrawerLayout, with a CoordinatorLayout as content root, with the toolbar and fragment holder in it), and various fragments as screens. On one particular screen I'd like to expand the…
fonix232
  • 2,132
  • 6
  • 39
  • 69
1
vote
2 answers

android get activity context in abstract base class

I am creating an abstract base class to keep my navigation drawer code in one place and want to implement an onClickListener on my app title (defined in the toolbar) to start my launch activity I am using the following code : @Override public void…
sudshekhar
  • 1,576
  • 3
  • 18
  • 31
1
vote
2 answers

Toolbar title not showing in Center properly if Back button is enabled

I want to show title of a toolbar in center so i am using custom textview to show title like this :
Kapil Rajput
  • 11,429
  • 9
  • 50
  • 65
1
vote
2 answers

How to align items in an android-toolbar?

How can I align items of a toolbar to the left, middle and right? Everytime I inflate the menu from my toolbar_menu.xml it loads the icons to the far right. How can I put them in the order I want? I am using an standalone toolbar at the bottom of…
1 2 3
99
100