Collapseable ListView

Shane119

Member
Licensed User
Longtime User
Hi Everyone

I'm working on an app that has a very long list, where the items in the list can be split into 1 of 10 or so categories. From reading the tutorials and the excellent examples provided I think I could produce something similar to the list on the following screen dump from "Mighty Grocery Lite":

List View.jpg

What I would like to do though, if possible, is have collapse abd expand of the items in the categories. Is this possible? If not can anyone think of a work around.

My initial workaround would be to only add the items to the list when an category was expanded - but this would mean constantly reading from a database.

Ideally I'm looking for some treeview/listview hybrid.

Thank you in advance for any help/guidance given.

Shane Brennan
 

Shane119

Member
Licensed User
Longtime User
Hi Erel

I don;t know if I've said this directly, but B4A is excellant! I am enjoying learning this software and how Android works. You and the guys on the forum have put a lot of work into this and it shows.

The problem for me is, I am so used to working with VB6, MS Access and VBA so my programming philisophy is very different and it is taking time for me to get my head around the programming techniques here, but I am enjoying it.

As for Derez's example - yes I have it's very good and I can see me using something similar to this when I ass backup/restore functionality to my Data Capture app that I'm creating - slowly but surely - because I'm learning a lot of things at once, including how to write web services in VB6 - no fun :( Well maybe a little :)

I'm probably not seeing this correctly, due to my lack of knowledge of Android and B4A, and I forgot to mention in my initial post, is that I want to also add multiple 'Views' to each node. e.g. a Tick box to say completed, a progress bar to show how far something is completed, and maybe a link to take me to other screens. For example I may want to jump to another screen to display:

Expected completion date,
General Notes
Budget info.
etc.

Is it possible to add panels/views to nodes to give a graphical view similar to the one in the illustration?

I'm sure it is, but I can not see how to do this at the moment..Sorry

Shane Brennan
 
Upvote 0

Shane119

Member
Licensed User
Longtime User
Hi Klaus.

Yes I've looked at the example, but I can not see how to collapse/expand sections. I do like this example though it has lots of good features and demonstrates exactly how I would like a few of my lists to work on future projects that I have in mind.

Sorry if I get the term wrong here, I could write code for 2 panels on for a category heading and another for the item, but the list would need to be created everytime I click on a category heading to either expand or callapse it...I'm sure I can do this, but for large lists this will take some time to process every time.

Again thank you for your help, this is really helping me understand both the current limits and potential of this software...But following the threads and the work Erel and others have put into this software, libraries, etc I can see this package can only get better.
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
Sorry if I get the term wrong here, I could write code for 2 panels on for a category heading and another for the item, but the list would need to be created everytime I click on a category heading to either expand or callapse it...I'm sure I can do this, but for large lists this will take some time to process every time.
Unfortunately that's the only solution. I just tested the time to generate a list with 500 items, it took less then 4 seconds on the emulator. Hopefully on a real device it should be much faster.

Best regards.
 
Upvote 0
Top