Action Items with dropdown menu view - android

I want to create something similar to this picture where you select the action view and it brings up a dropdown list of items, is that just a submenu of the menu item or something else?

The easiest way to do that is probably to bundle in the GreenDroid library and use their solution: https://github.com/cyrilmottier/GreenDroid
Although this could also be accomplished with a basic LinearLayout containing a few buttons.

My guess id that you could do it with a new activity with the options. Normal dialogues are created this way. Then use the adequate layout to make it look like this. You can get the sources for the Option dialogue from the android source code and then style it accordingly.
Hope it helps.

It's looks like just a Spinner as ActionView with it's own adapter.

Related

Add separators and icons to android actionbar popup menu

I'm try to customize my app popup menu adding separators and icons.
Basically I would like to obtain a menu like this (from Google Photos app):
How can I achieve this?
Thank you all in advance :)
I dont think there is a straightforward way to add separators and icons to popup menu.
I suppose, you have to use PopupWindow. Using PopupWindow, you have to design the layout. So you can design it the way you want, like having icons and separators. But the catch here is, you have to position the PopupWindow using x,y and gravity parameters, and also the fade-in animation.
https://developer.android.com/reference/android/widget/PopupWindow.html
you can use multiple row in listview to obtain the design,
look at this example: http://www.survivingwithandroid.com/2014/08/android-listview-with-multiple-row.html

How to implement view/interface like this in android?

If i click on(+Add to group)Button then alert/Dialog like view should visible. How to implement view like this in android??
It could be simply implemented using android-popupwindow.
Examples:
http://mrbool.com/how-to-implement-popup-window-in-android/28285
Is there a simple example of the PopupWindow class using Android v2.0?
Basic Steps:
Create a layout in XML for the menu.
Inflate that layout and apply to the PopupWindow.
Acquire a reference to that button. (i.e. Add to Groups);
Find its absolute coordination on the window.
Use showAtLocation to show the menu in the appropriate location.
Note: AFAIK, there's a bunch of libraries out there which fit your requirements. So, don't reinvent the wheel.
It's doable. You have to manually create a custom layout that automatically gets dismissed after pressing the action item.
Here is a small android library to create the QuickAction dialog style:
QuickAction Library
For more info, read this article.

Creating Dynamic list in android?

i want like used listview in android and i want to create dynamic list like below image.how to possible and i want to fix top toolbar and below toolbar .
Thanks!!!
You are looking for three keywords: custom listview, adding search button to actionbar and adding a tab bar.
1) For your custom listview you need to create a layout for each row. You could realize it with a simple nested LinearLayout or RelativeLayout for the following parts. I could highly recommend this tutorial. Just modify the layout to create a row for your snippet:
2) For the search button in the actionbar, check out this section of the Android developer guide. This should help you getting started.
3) A tab bar example can be found here or here.
Hope it helps you getting started.
For the list: Create a layout xml and a ListAdapter that knows how to inflate the layout and populate it with each list item's data. Doing a quick google I found this presentation on it that looks to be fairly comprehensive.
For the top and bottom bar: Look at the action bar developer guide.
As has already been said, nobody will write your code for you. But this stuff should enable you to learn how to do it yourself.

Android PopUp ListView

I want to implement in my android application a functionality like when a user clicks a button in header a small list view is popup having 5 values in the corner of the screen. Please give some suggestion, its urgent. Thanks in advance.
You mean a quick action menu ? Like this ?
If so, check this :
http://www.londatiga.net/it/how-to-create-quickaction-dialog-in-android/
It depends somewhat on the minimum SDK that you are targeting. If you are able to write your application with a minimum target of Android 3.0 (API Level 11), then there are at least two classes that you can use to accomplish creating a simple popup anchored to another view (in this case, your button):
ListPopupWindow
PopupMenu
Otherwise, you will need to do a little customization of PopupWindow, which is the class that many early QuickAction implementations are based on.
HTH
Design a listview inside it RelativeLayout view in that same layout and make it as invisible. once you click a button at the header you can make it visible. which shows the listview.
You can create a new Activity for popup and add android:theme="#android:style/Theme.Translucent.NoTitleBar" to Activity node in Manifest file.

style a ListView as a standard ContextMenu

I am wondering where the default ContextMenu style is defined... to copy/use it!
I have few ListView in my app, using the provided TexView layout android.R.layout.simple_list_item_1. My listings are looking odd (black background) compare to the default ones like the ContextMenu (white background).
So if you know where it is, or how to make my ListView having a "standard" style, I would be glad to know about it ;)
Thanks
jo
I think the Context Menus look identical to the regular Options Menu. And those menu items are setup with a layout found at:
$(SDK_ROOT)/platforms/android-$(API_LEVEL)/data/res/layout/menu_item.xml.

Categories

Resources