Want to create a bar after Action bar - android

I want to create a toolbar or bar after action bar.
In toolbar if i click on previous button the text will change to previous date and if i press next button it is will change to next date.
How I can create the bar after action bar.

Simply use the new Toolbar view. It was added to the support lib along with Android 5 and what it does is allow you to add the ActionBar as a simple View. You can then add your below view with simple "android_below="#id/toolbarId".

Related

Is it possible to customize items in split action bar?

I'm working with split action bar for my project, i would like to know is it possible to customize the items position in split action bar (i.e) i want some of the menu items in top of the action bar and some of them bottom of the action bar dynamically as my wish is it possible ?
Thanks in advance,
It is not possible to use normal actions on the top and split ActionBar at the same time. There is a trick you can use that is described below:
How to display both normal and split ActionBar?
But it is an old question and ActionBar is deprecated. You can now use multiple Toolbar objects instead of ActionBar. That way you can keep one of them at the bottom and add whatever actions you want to it.

How can I center a menu item in an action bar?

How can I center a menu item in an action bar? I am using an image icon in action bar as menu but it appears at the right side of the action bar and I want to center it. Is it possible in android ?
This can be done using custom views in actionbar. In native actionbar view you can't set alignment of menu items. Check here another SO post for custom action bar

Customize Navigation Drawer Action Bar (App Compact) in android

I want to customize navigation drawer app compact action bar, I want to remove app icon from that and want to make its title center in action bar.
I have applied all solutions , but nothing is working with all the conditions.
Please give me some clue for applying it correctly
You should creat a customize action bar. Then, if you want you can add a button that can open and close your drawerlayout.
I have solved my problem. As mentioned, I have two problems, and I solved that in following way :
1) For making title centre, we need to make custom layout of action bar, and need to remove action bar title.
2) for remove app icon from action bar, we need to set android:icon property of that activity in manifest with transparent image or colour.

Bottom ActionBar Progress Bar Over Button

I'm trying to make a feature where there's a button on the bottom action bar, and once I click on it, a progress bar appears on top of the button and makes the button slightly transparent (not disappear).
I used a custom layout for the top action bar, so on the bottom action bar, I wrote it through menu.xml since I've hard I couldn't have a second custom layout. I was wondering if this feature was possible just from the menu item properties.
Is it possible to make some form of like a frame-layout just from the menu.xml?
I'm assuming you're using a split action bar (uiOptions="splitActionBarWhenNarrow"), so that the custom layout you use is on the top with the application icon? The bottom bar is the menu items contained in an XML?
If this is the case, you can specify a custom layout for a menu item by using the layout attribute on the item. You could make a layout which has both items on top of each other (initially the button is VISIBLE with no alpha and the progress is GONE), then set up a click handler on the item in the onPrepareOptionMenu to set the alpha on the button to make it semi-transparent and change the visibility of the progress bar to VISIBLE.
I believe in the case where you use a custom layout, you can't use the id of the menu item for click handling (onMenuItemClicked), so you'd have to register a click listener either programatically or through the XML onClick attribute.
I apologize if any of the API calls are not 100% correct. I'm doing this mostly from memory.

Action bar option items menu icon

Does anyone know how to add "menu" text under the dots menu icons in action bar?
Also, how can I make my option menu items to display the icon in Android 4.0?
You can't add text under the default menu icon in the 4.0 Action bar, you do however have two alternatives
1) You can create your own icon that includes the text 'Menu' (Unfavourable)
2) Create a custom menu item with the dots image and the properties so that the text appears next to it.
android:showAsAction="always|withText"
Take a look at The Android SDK Documentation on Action Bar to see how to create custom items and make them perform tasks.

Categories

Resources