I would like to add a custom pulldown menu to the actionbar in my project similar to the one that can be found in the google books app (screen).
In this case it represents the complete table of contents of the book.
I tried to follow the guide from the developer site where there is an example with a SpinnerAdapter. But when i use a custom Layout (in my case a RelativeLayout with two TextViews in it) i get an Exception that saying "ArrayAdapter requires the resource ID to be a TextView". So i dismissed my idea with the pulldown but then i found the pulldown in the books app wich looks to me like they used a custom layout as well because it looks to me like two single TextViews in one Layout.
Could anybody please enlighten me if what i want to do is even possible and how?
To me, that looks like the options menu -- that's where options menu items not promoted to the action bar itself appear. Use onCreateOptionsMenu() and add whatever items you want to the Menu.
EDIT:
Sorry, the screenshot was a bit confusing. There are two possibilities that I can see:
This could be a submenu for that action bar item -- I haven't played with submenus and the action bar yet (though this reminds me that I need to do that...)
This could be a PopupMenu tied to a custom action bar View
Related
If I don't use show as action=always when creating a menu will it create a menu on the bottom like the old school android phones. I'm trying to create something that has like the facebook mobile tabs on the bottom, and has them for every screen. Or should I actually just make tabs for every screen?
You may be interested in a "split action bar". That way your items could appear at the bottom. showAsAction controls how/if the item appear in the Action Bar.
More information here: http://developer.android.com/guide/topics/ui/actionbar.html#SplitBar
If that doesn't look of interest then yes.. you should use tabs (or a view of some sort) at the bottom to render your "menu items".
I want this type of custom title bar
But can anyone tell me what the portion marked with red is made of? I mean are they tabs or image buttons or something else? Please don't give me links on how to apply a custom title bar, I already know it. But I don't know what the red-marked portion is (tabs or image buttons etc) And how can I have that vertical line between Search and Make Video option (in the portion that's marked red) I'm using Gingerbread.
I tried using search engines but how can I search when I don't know the name of the thing I want to search :s
They are called ActionBar Action Items. See: http://developer.android.com/guide/topics/ui/actionbar.html\
As for dividers, take a look at: ActionBar MenuItem Divider
You should to use ActionBarSherlock.
http://actionbarsherlock.com/
This is for add actionbar in devices android <3.x.
My need is to add a drop down menu like the one shown in attached image link.
http://i.imgur.com/cWtykfN.jpg
I don't know what to be used, whether it is tabs or menus. My need is when I press the last tab/menu, the sub menu should be shown and I could be able to handle the corresponding actions. Even when I handle those menus, I should be able to show the top tab/ menu without interruption.
It's called as overflow menus. Look this example, you will get an idea.
http://wptrafficanalyzer.in/blog/adding-action-items-and-overflow-menu-items-to-action-bar-in-android/
And nice explanation been given here. http://blog.stylingandroid.com/archives/1249 and for source code.ref here: https://github.com/StylingAndroid/StylingActionBar/Tree/StylingPart2
Use the ActionBar with tab-navigation-mode and if the last tab is clicked you could simply trigger a PopupMenu (even though this seems a little weird and is not what I expect to happen when I click tab).
I'm trying to figure out how to create a User Information dropdown menu exactly like what evernote uses in the screen shot below.
Dropdowns and normal spinners don't seem to support a Header value where the Username is.
Does anyone have any ideas how to to implement something like this with a header, custom fields in the dropdown list and spinner icon in bottom right of header.
Also, the sample at http://developer.android.com/guide/topics/ui/actionbar.html#Dropdown is not what I need unless it can be expanded for header and custom entries.
Supporting Android 3.1+
Here's the screenshot
I am trying to find a way to impelement a share button into my app (same like the one in the standard ICS gallary app, see picture link).
http://betanews.com/2011/10/19/get-acquainted-with-the-newest-android-ice-cream-sandwich-slideshow/#11
Intent.ACTION_SEND only opens a dialoge to the select the sharing options.
Android Share Via Dialog
This works fine, but from design side, I find this drop down list to select a app much more convenient.
Yet I cant figure out how to?
Does anybody have a good Idea how this button could be coded?
That is implemented using a ListPopupWindow, which at the moment is only available on Android 4.0.
This is implemented using ShareActionProvider available in SDK14+.
ActionProvider class replaces an action item with a customized layout,
but it also takes control of all the item's behaviors. When you
declare an action provider for a menu item in the action bar, it not
only controls the appearance of the item in the action bar with a
custom layout, but also handles the default event for the menu item
when it appears in the overflow menu
Its quiet easy to implement, you can follow the official documentation here.