Tag: android-actionbar

ActionBar capacity/overflow not changing on orientation change

I have an app using the ActionBar, where I handle orientation changes myself: android:configChanges=”keyboard|keyboardHidden|orientation|screenSize” …and the menu should fit in the ActionBar without overflow in landscape, but not in portrait: <?xml version=”1.0″ encoding=”utf-8″?> <menu xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:title=”@string/Game” android:id=”@+id/game” android:icon=”@android:drawable/ic_menu_manage” android:showAsAction=”ifRoom|withText”/> <item android:title=”@string/Type” android:id=”@+id/type” android:icon=”@android:drawable/ic_menu_edit” android:showAsAction=”ifRoom|withText”/> <item android:title=”@string/Other” android:id=”@+id/other” android:icon=”@android:drawable/ic_menu_gallery” android:showAsAction=”ifRoom|withText”/> <item android:title=”@string/Solve” android:id=”@+id/solve” android:icon=”@android:drawable/ic_menu_directions” android:showAsAction=”ifRoom|withText”/> […]

Actionbar convert tabs to list navigation if there is no room

I have an actionbar with a logo, a title, 2 tabs and a search function. On a phone (3.5″) everything works fine. The actionbar has 2 lines. The logo title and the search function appear on the first line and the tabs apear on the second line. On my tablet (7″) everyting is shown on […]

Hide application launcher icon in title bar when activity starts in android

I’ve searched SO but not found similar questions as I’m not sure how to phase it in a sentence. I am using ActionBarSherlock, with a logo instead of the launcher icon (i.e. 72×72 icon) with text in the top corner of the activity. When the activity loads for the first time, for a fraction of […]

How to change the ActionBar menu item's icon dynamically

I want to change the menu item’s icon dynamically as I get notification from a server. However, I’m getting a NullPointerException when the codes to change the menu item’s icon run. Codes I used to change the menu item’s icon are defined in the onCreatOptionsMenu method as follow: @Override public boolean onCreateOptionsMenu(Menu menu) { // […]

Android Toolbar with two lines in the title?

I want to have a double height actionbar (as in the material guideline examples), but with (possibly) 2 lines of text in the title. The title I’m using is dynamic and depends on the item displayed in the page. If there’s one line it should look like a normal actionbar, if there’s 2 lines then […]

Android ActionBar menu with vertical (rotated) text items based on Custom Action Provider

I am adding a menu to an action bar item. The menu will contain vertical text for each item. What the menu contains is not important. I basically just want to create my own view that will pop up when I press an action bar item. So for the purposes of this question, you could […]

How to display android actionbar title without truncation occurring

I have an app with a reasonably long title (e.g. My Long Title App). I am using an ActionBar and noticed the app title keeps being truncated (e.g. My Long Title A…). This happens even though 2 action bar items (both marked as ‘ifRoom’) are displayed. Does anyone know if there is a way to […]

ActionBar – PullToRefresh

I am developing an App where you can view BusStop Timetables. And users can refresh with the ActionBar PullToRefresh (Library). My app has also translucent statusbar on KitKat enabled. Now the ActionBar Overlay, which should be normally overlap the actionbar, is now displaced upwards. How can I solve that? Best regards!

How to click views behind a Toolbar?

I have a toolbar with a transparent/translucent background that overlays the content. So, behind the toolbar, views can appear that are clickable. The problem is that they can not be clicked through the toolbar because the toolbar is catching the click event. I tried setting android:clickable=”false”, android:focusable=”false” and android:focusableInTouchMode=”false” for the toolbar, but it has […]

Split action bar on Android 5.0 (Lollipop)

Does anybody know if the split action bar when narrow feature was removed from Android 5.0? It seems that it does not have any effect on the layout anymore.

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