I want to make a ListView like the one below. The ListItems will be grouped into sections and different sections have different item count. how do i get started??
N.B. I want the section headers on the side. i may also mention the items are queried from the database and sections are for now calculated based on a column in the table.
I think i have found something exactly what you need.
You need to implement separate adapters for sectionItem and EntryItem in this particular example which i am showing you.
Presuming that you know how to handle adapters and ListItems (customised with your own item.xml), this is a full fledged tutorial for how to make sections and entries.(Solution #2)
In the tutorial,the code to xml layout is also given but you may make your own custom layout for the section and entryitems.Its pretty easy and straightforward.
So that it will come off like this:
Use expandable listViews, here is example http://android-adda.blogspot.in/2011/06/custom-expandable-listview.html and for more info refer http://developer.android.com/reference/android/widget/ExpandableListView.html
You should use ExpandableListView
here also some examples:
Link1 Link2
Related
My problem is simple: I need to make a layout similar to android.R.layout.simple_expandable_list_item_1 which can fit more than one textview in the layout, as well as show the little '>' symbol that indicates that the tab is expandable.
How can this best be accomplished? My first thought was to use the layout as a background of a linear layout with two textviews in it, but I can't seem to make that work.
Vogella has a pretty good tutorial on how to achieve custom list views through Adapters.
Basically, what you do is you create a Layout with the looks you want for the list items and then you extend an adapter (ArrayAdapter for instance), see section 4. Then, in your activity, you create an instance of your Adapter implementation and populate it from an Array containing the data for the list.
Also have a look at the Developers site for how to make the list scroll smoothly with the ViewHolder pattern.
And if you feel you need more info on the expandable part maybe the hive can help.
Hi I just watch the last video of Android Design in Action: Collections and I would like how do you approach the following view:
The first thing that I though was use a GridView, but how do you achieve the first item fill two items size?
The other solution that I think is use a normal ListView, but in each row return two items view. And for the first row return a single item.
What do you think about these two approach? There are a better options?
UPDATE:
I want to inflate the collection dynamically from a Cursor or a List.
Check out the link..
http://www.androidviews.net/2013/01/pinterest-like-adapterview/
in that link have Staggeredgridview example with source code try that..
https://github.com/maurycyw/StaggeredGridViewDemo
Not exactly the same scenario, but you may find this post useful.-
Create gridlayout.
Let me help you my friend. Use the following library https://github.com/Utopia-Developers/StaggeredGridView Its an implementation of StaggeredGridView that allows you to set column span on each view in the getView() method of your adapter.
Hi how can i implement a list with section divider like the one on android's building blocks lists
Can you point any articles or tutorials to achieve this?
I implemented a possible version here:
http://steprobe.wordpress.com/2013/03/29/google-building-blocks-style-listview-for-android/
There are many tutorials to get grouped lists. The trick is to look for "adapter" and not "list". For instance, this one: http://android.cyrilmottier.com/?p=440
Each row in your list can be totally separated in terms of layout from others. So if you got 3 rows on your list, you can have each one can look totally different. You need to write your own adapter (i.e. extending ArrayAdapter), override getView(), getViewTypeCount() and getItemViewType(). Then for each row your getView() shall do any logic you want, inflate any layout you want and return that View to the list.
I'm planning to add expandablelistview in my activity. I did some researches on the Internet but none of them fits what I want. I read also that expandablelistview has parent and child elements. What I want to do is that the parent would be the categories let's say it's fruits, then its children are Apple, Lemon, Almonds, etc. I'd like to try that by using arrays, but am not so familiar with List and Hash.. Please give me some snippets of codes to start with.. appreciate any help. Thanks.
Expandable List View is quite easy to implement. You can just easily create two arrays with items that you want to add in the list. For more details and insight into the intricacies of the Expandable ListView you can take a look at this link:
Simple Expandable ListView Example
Also, if you need to create a Custom Expandable ListView, then you can find a good tutorial for that on this link:
Custom Expandable ListView
Good Morning All,
I am creating an application to display List of applications with their data usage.
I want my list to look similar to Traffic Counter Pro on android Market
I have also added the print-screen on my box.net as SOF does allow me to upload image
So Can someone direct me how to create ListView like this?
My second Question related to this how to create a tab style Activity.
Two examples that helped me a lot:
http://www.codemobiles.com/forum/viewtopic.php?t=876
and
http://android-developers.blogspot.com/2009/02/android-layout-tricks-1.html
i hope they are usefull to you.
You have to use custom ListView to embed images and format texts as given in the listview.
check out this example or this example or this example or even this example that gives you good understanding on listviews.
Good luck.
This is ListView which items consist of 4 Views objects, look through the tutorial of how to create ListViews and through the tutorial of how to create TabActivitys. And also use links suggested by #parag.
If you observe the screen shot carefully you can identify that group of these fields are available as list item.
They are
Application Icon
Application Name
Data Uploaded
Data Downloaded
Total Data Usage
So you have to create a layout with these fields as children with appropriate position and Use this custom layout as child layout for ListView.
I hope it may help you.