Below is an image of GPS Essentials app, which I guess a lot uses.
I am interested in making a menu similar to this. How is such a menu (or what ever it is called) created.
My first thought was to use a ListView having elements containing an image and text-view in vertical orientation. But then I was wondering if there is any better, preferably an easier way to do it.
I would be very greatful if you could share your experience with me. Thank you.
GridView is the solution exactly. You have to actually define a custom adapter for the GridView.
Why custom adapter? Because you have to inflate a custom row (having ImageView and TextView) to every item in your GridView.
Hint: Search for the example with word "Android Gridview example", you will get many articles/tutorials.
use GridView. You can find documentation here http://developer.android.com/resources/tutorials/views/hello-gridview.html
Related
What I want to have is a listview populated with my custom Folder class at the top, and objects at the bottom. I was thinking it would look something like it does in an OS.
I've spent hours looking through tutorials online, but the best I could find was putting an image and some text in the same row.
To be clear, I'm looking for something like this:
Folder_1
Folder_2
Folder_3
Item_1
Item_2
all in the same list.
Could anyone here help me figure this out?
The appearance of list items in a ListView is controlled by the getView() method of the list's Adapter. Any kind of customization that you want to do on a per-item basis (which includes having totally different list items) can be done from the getView() method. If you share some of the code of what you have already tried, others can help you further.
can someone help me and tell me is this possible in android. I need to have in my app a gridview alike widget, but with different item height and width, like this:
So is this possible, and if so, what can I use to achieve this.
Thanks
For this you need a work around or you can say a third party Library named as "AndroidStaggeredGrid"
You can check it on here
#Darko,
Yes, it it possible to do like this in Android.
There are many ways to implement this. As you said GridView cannot be used to achieve this. For a normal user this will appear has grids.
Ways:
Use fragment for each and every "grid" you can see and each fragment will have its layout to display either 2 or 3 images in grid (No gridview is required here too). Use ImageViews as usually.
If the layout design is same, then you can define a single layout with internal design in the same format. Each row with imageviews - This is not encouraged by the way.
Design layouts for each and every format of design per row. Inflate each particular row to a list (using custom adapter). Based on position in getView() you can control which row design to be added to list. Inbuilt scroll in ListView, so no problem!
I suggest you to go with number #1 or #3. Using fragments you will have better control.
If you come to know any better idea, please share!
It's StaggeredGridView
You can find an implementation at https://github.com/bulletnoid/StaggeredGridView
It's possible using GridLayout. More details in the link.
http://developer.android.com/reference/android/widget/GridLayout.html
I need to create listview like in this picture. The listview item go over each other like google chrome tabs.. I can move up or down listview item... Could anyone tell me a good advice or tell me examples how should I do this?
Thanks
You need an iOS passbook style component like CardWalletView
You have to create some accordions type control
Here is a link which will help you
http://android-puremvc-ormlite.blogspot.com/2011/07/android-simple-accordion-panel.html
when you close the previous view you will not animate that view to the end you have to keep some margin of 2 to 3 pixels to show view as you want
Another idea is you should create some view and use drag and drop... But also you have to some Math calculation... Try this maybe you can get something
Expanding list views may help you with that. I assume that your list view will essentially expand on click and shift everything below the selected area downwards revealing only the content of that selected tab.
Expanding list views utilize the parent-child methods that would allow you to create a very rough view of what you are showing. Styling and customizing those rough layouts afterwards could very well allow you to get that look you're looking for.
Here are some links that might be useful.
http://www.androidhive.info/2013/07/android-expandable-list-view-tutorial/
http://developer.android.com/reference/android/widget/ExpandableListView.html
I wonder if there is a tutorial or example code how the effect below achieved in Android, or if someone published an adapter already for this... Basically based on the number of results returned the screen is populated with boxes, and as the finger swipes down more boxes will load on demand until the results run out.
This is a GridView. And you can use your custom Load More GridView. This is a custom ListView example of the same. You can implement your own custom GridView similar to this.
What you are looking for is a Lazy List Adapter.
There is a great implementation for it. You can check it here. All what you need next is to create the layout of your list rows, i.e the boxes.
Does anyone have a good tutorial for implementing onItemClick() for a ListView populated by a custom ArrayAdapter?
I'm struggling with how Android is recycling views, and how to affect the layout of the selected view (which is a RelativeLayout). The way I've implemented it, I'm just doing a simple background colour change, but everytime I choose a row, when I scroll the ListView there are other off screen items selected too.
Any ideas?
Have a look to this answer. Custom code of ArrayAdapter.getView() (where view recycling is done) might be useful to you, I was trying to achieve something similar and it worked for me at last :)
You can find lots of good examples of the custom Listview with Adapters.Some of the Examples are listed below:
(1)custom-listview-android
(2)android-custom-listview-with-image-and-text
(3)Custom Array Adapter