Listview display changed

This is a shadow under the element, under the CardView, caused by the elevation setting. It is more visible when we set larger margins. This is the intended elevation effect, although slightly cut off by the container the list is in. It might be worth improving this, e.g. by adjusting the elevation value relative to the margin width.

I'll try to add it as soon as I manage to compile the ai2 sources.

1 Like

Im unsure if its at all related but Google playstore now rejected my update App Status: Rejected - App loads, but crashes.
Ive installed the app on my phone and it runs just fine !

Did you build it on a code server or a normal one?

It was built on the non-updated server link you posted August 21 2024 Version: code50
Didn't seem any point trying to using the normal one as ListViewPlus isnt compatible.

From Google Playstore - your app loads but crashes. You can refer to the attached screenshot for additional information.
appinventor.ai_stm6386.ScotNav

The issues with the app failing Google Play Store test appear to be related to the GooglePlayBilling - InAppBilling Extension I'm using.

I have also a problem after the changes of listview. I got an error comment on my phone. "List index smaller than 1".
What could this be?

The answer is in your error. Somewhere you are calling index 0. AI2 list indexes start at 1.

I have't anywhere set this to 0. I even didn't change the code.

I don't think this error comes from ListView. ListView doesn't generate this type of error and is immune to index = 0. At index 0, no item is simply selected. This error comes from Lists, from this block:

lists_select_item

SelectedIndex may return 0 if no item is selected, so if you use this block with SelectionIndex, you need to protect it appropriately to avoid getting an error. For example, using the condition "if (SelectionIndex != 0)" or, if possible, ensuring that an item in the ListView is always selected.

You are probably using the index in list block, which returns 0 if an item was not found in your list... to avoid us guessing what might be the issue,

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select "Download Blocks as Image". You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Oke thanks for your reactions everyone! I'll try to explain what I am doing.

First I make lists in an extension. I did this because of memory problems with compiling the code. I call this lists with listview to select an option.
This is the java code to make the list I call in this case.

 //LstLwrBekendeBr()
    @SimpleFunction(description = "Return List")
    public YailList LstLwrBekendeBr() {

        List listIts1 = new ArrayList();
	List ListIts2a = new ArrayList();
	List ListIts2b = new ArrayList();
	List ListIts2c = new ArrayList();
	List ListIts2d = new ArrayList();
	List ListIts2e = new ArrayList();
	List ListIts2f = new ArrayList();

	ListIts2a.add("Transportkoeling");
	ListIts2a.add("Koeling op dak");
	ListIts2a.add("Koeling tegen gebouw op grond");
	ListIts2a.add("Aggregaat stationair");
	ListIts2a.add("Vrachtwagen stationair");
	ListIts2a.add("Blaffende hond (groot)");
	ListIts2a.add("Metaalbewerking met hamer oid");
	ListIts2a.add("Tennisbaan, recreatief");
	ListIts2a.add("Padelbaan, 3m glazen wand");
	ListIts2a.add("Live band, versterkt");
	ListIts2a.add("Muziekinstallatie");

	ListIts2b.add(85);
	ListIts2b.add(75);
	ListIts2b.add(80);
	ListIts2b.add(90);
	ListIts2b.add(85);
	ListIts2b.add(90);
	ListIts2b.add(110);
	ListIts2b.add(84);
	ListIts2b.add(91);
	ListIts2b.add(105);
	ListIts2b.add(100);

	ListIts2c.add(100);
	ListIts2c.add(85);
	ListIts2c.add(90);
	ListIts2c.add(100);
	ListIts2c.add(100);
	ListIts2c.add(108);
	ListIts2c.add(125);
	ListIts2c.add(105);
	ListIts2c.add(102);
	ListIts2c.add(115);
	ListIts2c.add(110);

	ListIts2d.add(3.5);
	ListIts2d.add(8);
	ListIts2d.add(1);
	ListIts2d.add(0.75);
	ListIts2d.add(1.5);
	ListIts2d.add(0.7);
	ListIts2d.add(1);
	ListIts2d.add(0.6);
	ListIts2d.add(1.5);
	ListIts2d.add(0.6);
	ListIts2d.add(1);

	ListIts2e.add(2);
	ListIts2e.add(2);
	ListIts2e.add(2);
	ListIts2e.add(2);
	ListIts2e.add(1);
	ListIts2e.add(3);
	ListIts2e.add(3);
	ListIts2e.add(3);
	ListIts2e.add(3);
	ListIts2e.add(4);
	ListIts2e.add(4);

	ListIts2f.add(50);
	ListIts2f.add(50);
	ListIts2f.add(50);
	ListIts2f.add(100);
	ListIts2f.add(20);
	ListIts2f.add(20);
	ListIts2f.add(60);
	ListIts2f.add(85);
	ListIts2f.add(100);
	ListIts2f.add(100);
	ListIts2f.add(100);

        listIts1.add(YailList.makeList(ListIts2a));
        listIts1.add(YailList.makeList(ListIts2b));
        listIts1.add(YailList.makeList(ListIts2c));
        listIts1.add(YailList.makeList(ListIts2d));
        listIts1.add(YailList.makeList(ListIts2e));
        listIts1.add(YailList.makeList(ListIts2f));
        return YailList.makeList(listIts1);
    }

With this code blocks I call a window with listview. The list is given in as a value (Elements).

As for me, I still don't know what you're doing and where the ListView is. The ListView component works fine for me, so if you think otherwise, make a simple project that will show us where the problem is.

Oke.. In this case I focussed on working with the list. I'll next send the blocks with listview

There is no such thing as a memory problem for that little data...

Store your data in text files in csv format . Store the files in the assets of your app. Then on first run of the app read the files and store the data in the lists. Then store the lists in TinyDB for all further runs of the app.

Use Do it to debug your blocks, see also tip 4 here App Inventor: How to Learn | Pura Vida Apps, see also Live Development, Testing, and Debugging Tools

Taifun

Thanks for your advice. I am going to work this out.
Note.. This is not the only list I use. I have plenty of datalists to work with.

Here is procedure I call within the statements of listview. With this procedure I show the different lists to wordk with. The lists will be shown in a seperate window.


The strange thing about this is that it gives an error but it does show the list in the window.

Because as I already mentioned, this is not sn error from ListView. Look for where you use the blue list blocks.

How I use the list blocks I tried to explain a view posts above. This always worked good. Now it sometimes gives an error and mostly it doesn't.

Are you testing this in companion?