Custom listview

extension

#21

@PixiiBomb great too, thank you very much!


#22

you’re very welcome, and I think making the index change is a great idea!


#23

hola, las imagenes de custom listview no se pueden cargar desde internet verdad?


#24

@Sebastian_Segovia it’s on our todo list :slight_smile:


#25

@PixiiBomb - You have a better way than this, I feel this way is not good.


#26

How to work with Lists by Saj
How to work with Lists and Lists of lists (pdf) by appinventor.org

after picking an item from the first list, select the corresponding item from a second list using the Listview.SelectionIndex

Taifun


#27

Thanks @Taifun , could you please give me the whole document (or a link for me to download)


#29

In this example, we can use the SelectionIndex from the Custom List View to access the same index in different lists.
I have a list for the Icons, Names and Descriptions.
I can then display the information from each list in different labels.

I’ve also chosen to hide the bottom section when the app starts, and only display the bottom section when an item is selected from the Custom List Viewer.

Hope that helps!

Example.aia (91.3 KB)


#30

Thanks @PixiiBomb very much. Every time you troubleshoot for me, I feel great.:laughing: Always understandable and clear.


#31

I’m always happy to help :smiley:


#33

I really feel stuck, @PixiiBomb help me :frowning_face:


thu.aia (182.5 KB)


#34

Ok so, unlike the other problems we’ve completed together so far, this one requires a more complex solution.
In the previous examples, we worked with 3 different lists because the data was simple. We just used icons, names and descriptions to work with.

You’ve got 19 different lists, where each index in the list basically corresponds to an item, and you want to be able to save the information. With this much data, a simple list is no longer the option we want to take, because all of that information is going to start cluttering our screen and it’s going to get unnecessarily complicated.

With this much extra data, we need to start working on a database. We have a couple of options, we can use a TinyDB, a Fusion Table, or Firebase.

  • I don’t recommend TinyDB, because you’re going to wind up having to over-complicate your data, in this case.
  • I DO recommend a Fusion Table, because the data you’re working with is mostly strings and integers, and you can structure this data easily.
  • I don’t recommend Firebase, in this case. There is nothing wrong with it, but it’s not necessary. Unless you just happen to find it easier than a Fusion Table.

The Fusion Table is literally just a table of data. You can even create your data in Microsoft Excel or Google Sheets, and import that data into a Fusion Table.

This Google Sheet:


is an example of how your data should look in a Fusion Table.

  • Each column is a piece of data
  • Each row describes the item (Mon1, Mon2, Mon3, etc)
  • The numbers represents the indexes: (Row 1 = column titles, Row 2 = everything about Mon1, Row 3 = everything about Mon2, etc)
  • The image column is actually unnecessary if you just want to name your images the same name as your items. (Mon1.jpg, Mon2.jpg, Mon3.jpg, etc)
  • Notice that the columns C, D and E (Fish, Shrimp and Carrot) just have numbers in them. Because you can call that data as a variable. Using a join textblock, you could write “Fish :” + DATA + “Kg”

Ok, so now what I want you to do is take a break from your project and start a new project working with a FusionTable or Firebase (your choice). This guy breaks it up pretty well: https://www.youtube.com/watch?v=fDTCUK8yAKw&index=1&list=PLqhmukaG7I-KucjN-GZThTQ-TjJK7Y2hr

Now if you want to save the “Done” data on the user’s device, then I would suggest using a TinyDB.
But i think it would be easier to retrieve the data using a database format (like Fusion or Firebase), because you can see the data in a separate webpage, and it will be a lot easier to work with.

Let me know how it goes!


#35

Thanks @PixiiBomb , i’m doing it the way you guided, i understand the problem. But if I do with Fusiontable then the application running must have internet connection right you do. If you do not have an internet connection, how do you keep the data up to date?


#36

Well I would hope that the user has internet connection or some form of WIFI in 2017 :stuck_out_tongue:
But, if you’re concerned about that, we could probably take a minute to re-structure your blocks, and see if we can create a faux-database using like 5 lists instead of 19.

See if you can play around with, and give me a couple days. I’m kind of working on this big project that’s due tomorrow :frowning: So I’ll get back to you :hugs:


#37

Thank you very much @PixiiBomb.:grin: You know, all day today I’m learning about Fusion Table, but I have not had a specific tutorial like what I’m looking for. I really need help from you, because I know you understand what I say, and your ability to do absolutely. I am very confident in you. I mention the Internet because in our country not all have wifi or 3G.:joy: But I’m aiming for an application that even if no internet is still usable. For what you help, I’m close to completing the main steps of the application, only the accumulation of the components in listFINISH as I sent you the day before is my application completed. Looking forward to receiving your help soon.
(I have to use GoogleTranslate, please understand, I’m trying to learn English):sweat:


#38

I’m just fast reading here, but, wouldn’t it be good for offline database to use a csv file in this case?
Also, TinyDB sometimes is undervalued, since you can save a record like: Tag = unique id, value = list of values on that record (name, picture, etc, etc.) All you need to do is search for the right tag, and get item 1 of the list saved to get the name, item 2 to get the picture, etc.

Are these offline solutions applicable here?


#39

You can also use SQLite component; much more powerful


#40

I totally forgot about it. That would be the best offline solution of course.


#41

@silicone_ahk - well it’s actually really easy to help you, because you’re very good at describing the issues you’re having! And your English is very good :smiley:

The suggestions from Italo and Hossein are also very good. I would definitely play around with that and see what you come up with, and I’ll check back in a day or so ^^


#42

Ok, I’ve got a different way of re-structuring the data that should help clean up some of the blocks section.

(This is building off of Example.aia) Example.aia (93.8 KB)

We have 7 lists in this example:

  • database is the MAIN list with all of the data
  • The remaining lists are all column titles (written in capital letters)

When the screen initializes, we hide the bottom part of the layout, and initialize the database list. Then we break up the database list into smaller lists of data, and lastly we add the names and icons to the Custom List Viewer.

Each item in the database list contains all the information about each of the animals: Their name, icon, age, favorite color, favorite food, and a description (in that specific order, separated by commas)

We can take each item and break it up into it’s own list using the list from csv table block (array). We can loop through the database list and each array and specify what each piece of data is.

For Example: The [AGE] list is going to look like: (2,4,5,1,10).
We specified that by saying that all of the data for the age of each animal is located in the third column of every row in the database list.

To display ALL of that information, we would just need to add additional labels (which I didn’t do in this example, but you can see how that’s accomplished in the listview_animals.AfterPicking event)


So, now we need to be able to save that data, using that same type of formatting. Which we can totally do, but I’m about to leave for class and give my presentation. (Wish me luck!!) :smiley: I’ll check back later today, to help with the rest! Let me know if you come up with anything else in the mean time


Read from CSV as table
List View: multicolumn or font (monospace)
Copy the screen and paste in new add screen