I'm trying to find some information on how to create a menu that looks like the top of the menu for chrome for Android. I have tried experimenting with implementing icons for Android 4.0, but no luck. Tried googeling, but the only thing i found was an answer that said icons can't be implemented when API >= 11.
How does Chrome do it then? It's made for devices that's 4.0+!
Use popup list window to achieve this. As you can add header and footer to any list, you can create one linear layout with back forward and star like options.. Add that view to the popup window.
Any ListView can be associated with HeaderViewListAdapter, using this you can attach seperate layouts as a header and or footer to your listViews.
As Vinodkumar said, you can also use ListPopupWindow with HeaderViewListAdapters.
In the Android reference: HeaderViewListAdapter and ListPopupWindow
Related
Hi Everyone
I'm new in android and i'd like to do a menu for an application.
I want to replicate the menu style of this game that has different section
http://i.giphy.com/l4Jz4PbvjJEZHZn8c.gif
I have 3 different xml layout that i want to show in my horizontal style menu capable of swiping from a layout to another.
I have heard i could use something called horizontal ListView but i don't really know how to use it.
How do i do?
try Sliding tab Layout. Its the same function just need to edit the codes for different design
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.
i am working on demo application.
have you any idea about popup menu in Android 2.1 version. actually working fine in android api level 11 and above..
reference url : http://www.sitepoint.com/build-intuitive-extensible-menus-in-android-with-java-and-xml-2/
yes, you can do this. you just need a little bit of Animation and its done. :) It will give the exact feeling like a pop-up menu. I have done this before.
you need to use Relative layout for this purpose, because they can overlap on each other.
On click event of button, you need to show the View (relative layout holding a custom menu in this case) with an animation say bounce animation. again click on same button will hide the view again with an animation.
I wish I could post the code here but I have to search where I put my project. :P ;)
I hope it will give a little idea about a totally customized pop-up menu.
I've just met some troubles in Android 4.0.3 with menu because it displays menu item in a list. But I can't a way to set it displaying in a grid-like layout.
Appreciate help.
My friend, I found the main reason why you couldn't display option menu as grid-style in Android 4.0.3.
Because you used #android:style/Theme.Holo for your application.
Menu of Theme.Holo was set for displaying in list-style.
The solutions are:
1, Try to use another theme such as #android:style/Theme.Wallpaper.NoTitleBar instead of #android:style/Theme.Holo.Wallpaper.NoTitleBar
2, Or if you still want to use Theme.Holo, so try to create a style for menu in values/style.xml. References: see styles in Android Framework. (Sr, I don't have Android framework here, so I can't show you what to do exactly now)
Hope this help!
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.