Show menu item icons in actionbar while having navigation drawer - java

Been trying everything to show the menu item search (searchWidget) in the actionbar. I have a navigationdrawer, which doesn't hide the actionbar items at any time. But still the search item is always at the overflow, even when having a large screen device.
I have tried using always in the showAsAction in the menu item, and even putting the menu item as visible in the onPrepareOptionsMenu method, and calling it when the drawer opens and closes to see if something changed, and still nothing.
I won't post code now, just wondering if someone had the same problem. If necessary I will post code of course.

If you are using regular action bar menu items (API 13+) then you simply need to say -
android:showAsAction="always"
for that menu item in the menu resource.
However, if you are using the compat library - appcompat-v7 for action bar and menu items (API 7+) then you need your app's name as the namespace as -
yourapp:showAsAction="always"
and add the following to menu tag at the top with the android namespace as -
xmlns:yourapp="http://schemas.android.com/apk/res-auto"

Related

Seperate Menu from Action Bar in Android

After i added an action bar to my android app, the menu moved to the action bar.. What's i'm trying to do is to make the action bar at the top, and keep the menu in bottom as it was before. Is it possible to make menu independent from action bar?
You can use a Split Action Bar to position action items and the overflow menu (the three dot menu) along the bottom of your device on phones in portrait (phones in landscape and tablets will still have it in the action bar).
If you really have a good reason to put the overflow menu in a different spot (potentially confusing users who are expecting to have it in the action bar/split action bar positions), you can add a PopupMenu to any location in your layout to add a menu that acts similar to how the Action Bar overflow menu works.

Android: Convert a normal menu to slider menu? (With minimal coding)

I have an app with a normal menu i.e. the common old menu that shows up at the bottom of the screen when the menu button is pressed. But it is a problem in some phones where there is no hard menu button.
I want to switch to slider menu with a menu icon on top. Is there an easy way to do this (I mean a way where code change would be minimum) retaining the existing functionality? Or will i have to go about coding the slider menu from scratch?
Any example code of a similar situation would really help.
I have an app with a normal menu i.e. the common old menu that shows up at the bottom of the screen when the menu button is pressed
Normally, that "menu" will appear as the overflow on devices with an action bar that either:
do not have a MENU button, or
run Android 4.4+
But it is a problem in some phones where there is no hard menu button.
Make sure that your app has an action bar.
I want to switch to slider menu with a menu icon on top
The options menu/action-bar-with-overflow is unrelated to the "slider menu". They serve different roles. Please read the design guidelines for a navigation drawer (a.k.a., "slider menu").
Is there an easy way to do this (I mean a way where code change would be minimum) retaining the existing functionality?
No, because they are not related.

navigation in actionbar sherlock

I would like to implement the navigation with options like left and right button that are displayed in following URL. I found the Tab Option for android is possible via Action Bar and Tab Host Control. But I can not find the option with those two button actions.
Navigation in a UItoolbar in iOS
I also tried this by using Linear Layout and horizontal Scrollview concepts but the UI are not comfort as i wish . So If you find Anything Kindly do the needful.
If you want useing SlideNavigation use this library as i used this in my app for create Navigation SlideNavigaiton
and if you want Navigation Ontab you can use scrollable tab as you can see in sherlock actionbar sample and on other way you can Hide actionBar and create custom layout with scrollable contetn for your aim
hope to be usefull :)

Android ActionBarSherlock

I am using action bar sherlock and have three tabs showing absolutely fine. The problem I am having is that I can't seem to get the title showing at all, it literally shows three tabs at the top. When using the native action bar on the same project, it showed the title on one line, then the tabs underneith (split action bar). This time, only tabs. I do have the required elements in the manifest such as:
uiOptions="splitActionBarWhenNarrow"
I am using the theme #style/Theme.Sherlock.Light

Show action bar also for menu button?

I'm creating an action bar on ICS. Due to spacing only the icons are displayed.
But I'd also like to supply the action bar as context-like menu with text if the menu button of the phone is pressed.
How can I achieve this?
Atm I have 3 icons. 2 of them are displayed at the top in action bar.
If I press the menu phone button, the 3rd is displayed as contextmenu! But I'd like to have all 3 of them.
class MyActivity extends SherlockFragmentActivity {
#Override
public boolean onCreateOptionsMenu(Menu menu) {
MenuInflater inflater = getSupportMenuInflater();
/* IMPLEMENTATION HERE */
}
}
From the documentation on Menus:
If a menu item does not appear as an action item, then the system places it in the overflow menu.
Thus, showing the same action item in both the action bar and the overflow menu is not possible. What you could do is this:
Check (at runtime) which menu items fit in the Action Bar and which do not.
For each menu item that is displayed in the Action Bar, create a new, identical menu item dynamically, making sure to call newMenuItem.setShowAsAction(SHOW_AS_ACTION_NEVER) to ensure that it is displayed in the overflow menu (w/ text).
This, in my opinion, goes against Android's menu design standards and I wouldn't suggest doing it. It might appear like a better design choice in your eyes, but users expect apps to be consistent across the entire Android platform. Manipulating your menus in weird ways can cause confusion, and can negatively impact user experience as a result.

Categories