Is there an "overflow" view for the Android 3.0+ ActionBar? - android

I have a number of tabs on the ActionBar and I want to find a way to handle those when the tablet is put into portrait mode. Currently, if you have more than 3-4 and any showing menu items, any more tabs will be cut off and unavailable. I'm wondering if there's a way to have those overflow into a "more" tab automatically. Or, if there's a way to have physical tabs and a drop down list for extra options as the last "tab". Has anyone encountered this scenario yet?

I would do one of the following if I were developing the app that required a use case with a high count of tabs:
Override onConfigurationChanged to detect when in portrait mode and hide the text on the tabs leaving only the icon. Using themes you can also adjust the padding of the tab contents.
Override onConfigurationChanged to detect when in portrait mode and switch the navigation be list-based. This will provide you with more room for action items while still showing the current "tab" that the user is on.
Implement a custom navigation view which responds to portrait in whatever manner you would like (e.g., scrolling horizontally, presenting only the selected tab with text, showing only the selected tab with an overflow-style button for the additional ones).

From http://developer.android.com/sdk/android-4.0.html#ActionBar
The ActionBar has been updated to support several new behaviors. Most importantly, the system gracefully manages the action bar’s size and configuration when running on smaller screens in order to provide an optimal user experience on all screen sizes. For example, when the screen is narrow (such as when a handset is in portrait orientation), the action bar’s navigation tabs appear in a “stacked bar," which appears directly below the main action bar.
Yay!

Related

Android: Tabbed actionbar in portrait mode

I am unsure what to search for this so all links are appreciated.
When I change the orientation of my device to portrait mode all the tabs are going below the action bar, not on it, even though there is plenty of room (I am using 2 tabs while testing on a Nexus 10). Will the tabs always appear below the action bar in portrait mode or is there a way around this?
What I want to happen:
(source: android.com)
What is happening: NOTE: this is the behavior I am getting even when there is PLENTY of room to display the tabs in the action bar:
(source: android.com)
Thanks in advance!
Will the tabs always appear below the action bar in portrait mode
On small/normal screens, yes. Action bar tabs will go where the action bar implementation wants to put them... which includes them not being tabs at all in some cases, but a drop-down list instead.

Action Bar Tab not splitting in Landscape mode

I want to display Tabs below Android Action Bar in Landscape mode
I have set
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
I tried android:uiOptions="splitActionBarWhenNarrow" in Android manifest but everything seems to be OK in Portrait. But when view changes to Landscape, the tabs get embedded inside action bar.
Anyone has implemented this, because this does not seem to work.
OS - ICS and above.
This is correct behaviour. It's Split-Action-Bar-When-Narrow option and there are no options how to determine which actions will be displayed at top and which at bottom. ActionBar element is doing this according to screen orientation and screen resolution. Use your own toolbar.

Android App with tabs and menu items

I'm trying to implement an application with a specific view. It needs to have a horizontal bar at the top that contains the app icon, and other buttons and spinners. These items must be static and should appear on every page of the app.
Below that horizontal bar will be a Tabbed component, with the tabs being horizontal at the bottom of the page. I can also implement the desired behavior with the tabs on top of the Tabbed component. Each tab will obviously change the fragment being displayed within the tab's frame.
I am working on an implementation that uses the ActionBar and the menu options. However, I can't get the menu options (my buttons and spinners) to appear above the tabs. And I'm not sure if menu options is the right approach. Any ideas?
Silly me! the answer was right there. I simply had to turn the title bar back on (only with no title) and the menu options would appear right into that title bar.
keep in mind that this feature is heavily dependent on the version of android and model of device that you have.
Older phones have a menu button which will bring up the same menu, as do some modern phones (like the galaxy SIII), so, be sure to test this everywhere so you know what the end-user will actually experience.

Android - Tabbed Navigation in Landscape Orientation

We are building an Android 4.0 app with tabbed navigation at the top. This all works great in portrait mode but when the application changes to landscape mode (which we want to support), the default behaviour is for the tabs to move up into the top/action bar which seems to eliminate the ability to have a screen title shown and seems crowded with the actions that appear on the right of the top/action bar.
What is the best approach to prevent this and how difficult would it be to override this default behaviour?

Android Action Bar Tabs and Menu Items

I am using a action bar. I have menu items on that. I have set the property on it as
android:showAsAction="ifRoom|withText"
So it's working in Potrait and landscape really well. On one page I have Tabs, it's not recognizing tabs and overwriting the tabs. What I would like to do is, in Potarit just show tabs and all menu in drop down. In Landscape show tabs and as many menu items possible on action bar.
Thanks,
Have a res/menu/options.xml and a res/values-land/options.xml to distinguish the cases. Or, if the rule really is not portrait vs. landscape but a minimum screen width, use res/menu/options.xml and res/menu-wNNNdp/options.xml, where NNN is the minimum width in dp for when you want to use some other approach for your menu.

Categories

Resources