Tag: android-actionbar

How do you remove the title text from the Android ActionBar?

I’m looking through the Holo.Light theme, and I can’t seem to find the magic style to override to get rid of the title text that briefly shows up when my app first launches. How can I do that?

How to update a menu item shown in the ActionBar?

I have an Activity that has 2 fragments. Both are ListFragments and both contribute MenuItems to the Menu. I have one MenuItem that I’ve set the attribute android:showAsAction to have it show as a button on the ActionBar. Which works fine. Now the MenuItem is state dependent. It’s a Pause/Resume menu option for pausing and […]

Android transparent status bar and actionbar

I’ve done a few researches on this topic and I couldn’t find a complete solution so, step by step and with some trial and error, I finally find out how can we achieve these results: having a transparent or coloured Actionbar and Statusbar. See my answer bellow.

How to get Toolbar from fragment?

I have ActionBarActivity with NavigationDrawer and use support_v7 Toolbar as ActionBar. In one of my fragments toolbar has custom view. In other fragments Toolbar should show title. How get Toolbar instance for customizing from fragments? I can get ActionBar with getActivity().getActionBar(), but if I call setTitle() for this instance ActionBar it do nothing. UPD: In […]

SearchView's OnCloseListener doesn't work

I’m trying to add support for the SearchView in the Android 3.0+ ActionBar, but I can’t get the OnCloseListener to work. Here’s my code: @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu, menu); searchView = (SearchView) menu.findItem(R.id.search_textbox).getActionView(); searchView.setOnQueryTextListener(new OnQueryTextListener() { @Override public boolean onQueryTextChange(String newText) { searchLibrary(newText); return false; } @Override public boolean onQueryTextSubmit(String query) { […]

How to display custom view in ActionBar?

I want to display custom search in actionbar (I’m using ActionBarSherlock for that). I got that: But I want make custom layout (edittext field) to occupy the entire available width. I’ve implemented custom layout as suggested here. There is my custom layout search.xml: <?xml version=”1.0″ encoding=”utf-8″?> <LinearLayout xmlns:android=”http://schemas.android.com/apk/res/android” style=”?attr/actionButtonStyle” android:layout_width=”fill_parent” android:layout_height=”match_parent” android:layout_gravity=”fill_horizontal” android:focusable=”true” > <FrameLayout […]

Android action bar not showing overflow

I have an action bar in my app with 3 items. Only 2 can be displayed due to space issues, so I’d expect the first to be displayed and the rest to be displayed in the overflow. However in practice only the first 2 items are shown and there is no overflow detectable. Here is […]

Android Lollipop, AppCompat ActionBar custom view doesn't take up whole screen width

So, I just updated my codebase to Lollipop, and I’m having issues with the Action Bar. I’m using AppCompat and ActionBarActivity, and inflating a custom view. It seems that the custom view no longer takes up the whole width of the screen, leaving a thin strip on the left Way it used to look Way […]

How to implement DrawerArrowToggle from Android appcompat v7 21 library

So now that Android 5.0 was released i was wondering how to implement the animated actionbar icons. This library here implements it fine for me but since the appcompat v7 library has it how can it be implemented? The library references it in themes.xml <item name=”drawerArrowStyle”>@style/Widget.AppCompat.DrawerArrowToggle</item> Under this style <style name=”Base.V7.Theme.AppCompat” parent=”Platform.AppCompat”> UPDATE I got […]

How do I declare an extended height Toolbar/Action Bar on Android Lollipop?

I’ve seen extended height app bar’s in the Google Design App Bar guidelines. How do I implement these in Android Lollipop?

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.