Split ActionBar - android

I want to have a split action bar for android where the search widget is at the top action bar and the rest of the icons are in the bottom using android:uiOptions="splitActionBarWhenNarrow" is there a way to do that?
Thank you.

splitActionBarWhenNarrow is not supported by Theme.Material or the appcompat-v7 action bar backport.
If you wish to stick with something based off of Theme.Holo for all devices, you are welcome to use splitActionBarWhenNarrow.
If you wish to use either Theme.Material or appcompat-v7, you will need to create your own "split action bar", by having a Toolbar at the bottom of the screen that you populate separately.
For example, this sample project uses a Toolbar on API Level 21+ devices along with Theme.Material, gracefully degrading to having everything be in the action bar on Android 4.x devices.

Related

Can Android Actionbar be placed vertically?

I want to have an action bar placed vertically(Tablet App)
Can I have this? I know the default action bar does not support this.
Can sherlock action bar?
Can any other?
I have given this time but I dont see any solution to this.
Can sherlock action bar?
No. It backports what's available in the built-in ActionBar.
Can any other?
AFAIK no library provides such functionality.
Can I have this?
Of course you can. Depending on what you use from ActionBar this could be easy. On The image you have provided there is a FrameLayout with two Buttons and additionally hidden overlay ListView after pressing bottom Button. Not too much work.

Android - Action Bar Style

I want to show Action Bar like below.
I have already used this library clickhere
But it takes only two icons on Action Bar. If I add four items, then last two are shown me like menu. I want all in Action bar same as image above.
Is it possible? if yes, then HOW? Can I change Action Bar color or its default style available in Device?
Thanks in Advance.
I recommend you use this:
http://jgilfelt.github.com/android-actionbarstylegenerator/
to style your ActionBar.
If you want all the 4 icons to be there, just add this attribute to all the menu items:
android:showAsAction="always"
hello try this library
it sure help you And you may have to add you own logic to handle this in below 2.3 Android OS and above 3.0 Android OS.
there is many demo sample available like below :
There is no way you can be sure of the number of icons displayed in the action bar. There is a large varierty of Android devices out there and they all have different screen sizes. That's why you have to prioritize the actions available in a menu : the most important will be displayed as actions in the action bars and the others will be displayed in the "menu" : the action overflow.
You should think of actions in a functional way, not a graphical way.
With ref to Image that you attached you should decide which design pattern you want to use in your application, there are many UI patterns available for mobiles, tablets. The image you attached looks like Side Navigation UI pattern. It's better you decide which UI pattern perfect for your app.. then start implementing it with custom action bar libs (if you want action bar in less than Android 3.0 ver) or any other.

ActionBarSherlock wrong tabs position on android 2.2.2

I'm having serious problems getting tabs in actionbarsherlock below main action bar tabs to work in an app that runs from Android 2.2 up and looks like Android 4. (see link)
Tabs position
Have you tried running the official Demos app of ActionBar Sherlock? (https://github.com/downloads/JakeWharton/ActionBarSherlock/ActionBarSherlock-Sample-Demos-4.2.0.apk) It should contain a demo for the actionbar with Tabs.
If that works on Android 2.2 then you know the problem is in your code and you can check the Demos source code to see what you are doing differently (https://github.com/JakeWharton/ActionBarSherlock/tree/master/samples).
It's usual behavior of action bar (actionbarsherlock just simulate it). Use
ActionBar act = getSupportActionBar();
act.setStackedBackgroundDrawable(getResources().getDrawable(R.drawable.mytab_base_t));
to avoid white color in top bar (this option you can't access from any theme item yet). You can also monitor action bar height to change custom view of tabs on-fly, but you can't change action bar behavior, forget it. Otherwise please use PagerTitleStrip against action bar tabs.

Android theme, fullscreen and the action bar

I have have some problems with devices that have the action bar. When running on a phone I want to go fullscreen with no title bar and no status bar. On tablets I want to show the action bar but still no title bar. Minsdk is 7! The method setTheme doesn't work when you toggle fullscreen so I can't have two themes. Is there a way to show the action bar in fullscreen mode? The support library doesn't support the Action bar.
The only reason I want to do this in the first place is cause they for no good reason at all broke the backward compability by moving the menu key to the action bar. The easy solution for this according to the docs is to add android:showAsAction="ifRoom" to the menu items. But that does absolutly nothing.
I've also tested numerous solutions I found on google that supposedly toggles fullscreen. None of them work on any of my devices so please do not point to something you've read if you haven't used it yourself.
EDIT: I Solved this. The problem seems to be that you have to specify a Holo theme to get the action bar back. Otherwise it won't show. I added this in my main Activity.
#Override
public void setTheme(int resid) {
if(isTablet(this))
{
super.setTheme(android.R.style.Theme_Holo);
return;
}
super.setTheme(resid);
}
On tablets I want to show the action bar but still no title bar
The action bar replaces the title bar. There is no concept of an activity having an action bar and a title bar.
Is there a way to show the action bar in fullscreen mode?
AFAIK, no, by definition.
The support library doesn't support the Action bar.
ActionBarSherlock provides a backport of the action bar for API Level 7 and higher.
The easy solution for this according to the docs is to add android:showAsAction="ifRoom" to the menu items. But that does absolutly nothing.
It certainly "does nothing" if you have no action bar. If you want a fullscreen experience, then you will need to roll your own menu replacement. IMHO, most fullscreen apps did this already (e.g., a game going with a game-styled "menu").

Google Music app split actionbar

The new Google Music app looks like it is using the new action bar API's with the split action bar items at the bottom. The cool thing is that it also works on my Nexus S Gingerbread phone, which doesn't have the new ICS API's. So, my question is of course how can I achieve that?
The Music app's action bar is a custom implementation, not a backport.
They are probably using some in-house / private action bar lib backported from ics.
Search for Sherlock Action bar lib. The new version 4.0 which will be out soon will allow you to use ics action bar api on older android versions.
You can add your own view at the bottom -- Linear Layout and add ImageButtons to this layout.

Categories

Resources