Uses V3 : TestListViewPlus_2.aia (124.0 KB)
This demo shows multi selection with a long press and deletion of selected items. Uses detail text to highlight the selected item.
The only thing is that the margins around the list item interfere with the built-in search engine, which hides items that do not match the search. The items are hidden but their margins remain, creating large gaps between list items. I'll have to think if there's a way around this.
Don't give Dividers because it's for the old list view. A margin of 100 is a lot, reduce it to, for example, 20 and it will be ok. Margins between items will be double because they add up. Top Position Margin + Bottom Position Margin.
Hi, may I ask if I can disable or adjust the shadows? Also, can ! control the background colour, spacing and text alignment of each element by adding more parameters? I don't know how to use dynamic components or comp creator, so I wanna ask if there are any more extensions available. Thx
Hello. This is not possible with this extension. This extension only adds a few simple methods to the original ListView component. It's not easy to add many other methods to a ListView component from an extension. You need to look for an extension that creates the RecyclerView component from scratch. Or use the method with dynamic component creation.
Not sure if you're aware, but this extension doesn't seem to work under the emulator. When starting the TestListViewPlus example project using the emulator the following error is reported:
Runtime Error
invoke: no method named "CreateElement" in class java.lang.Boolean.
The emulator runs on the same PC as the web browser I'm using to run the App Inventor UI. It appears to connect to aiStarter using localhost. I start it from the Connect menu, choosing Emulator. This starts the emulator, and then the companion App (within the Emulator), and then runs the project. I have aiStarter installed, and running, and all my projects seem to work fine under the Emulator with this setup. When I try to run the TestListViewPlus project, or I include the ListViewPlus extension in a project, I get the messages I reported previously.
I don't unserstand how I'd use USB or Wifi to connect to the emulator that's running on my PC...? Perhaps you're thinking I have the companion app on my phone, and I could understand if this were the case, but it's not. I could try it I guess, but I haven't at this point.
I don't use an emulator so I don't know about emulator errors. Does your emulator have the latest Companion installed? CreateElement is a block from the built-in ListView component. So either your Companion is not up to date or there is some problem with the ListView. Make a project with just ListView without the ListViewPlus extension and try it out.
I believe it does have the latest companion installed. I just installed the emulator a few days a ago for the first time, so I'd be surprised if it was old. It reports version 2.65u when the emulator starts up.
No, my app that has a ListView in it works fine under the emulator, until I add ListViewPlus extension (that does nothing, just added an instance to screen1.) I've noticed now though, that another extension I tried (Ai2Tools) reports similar errors, so I may be unfairly singling out ListViewPlus, and it could be a general thing for extensions that use reflection to delve in to the internals.
A built .apk works fine on my phone. I just like using the emulator on the PC as it is so much more convenient for quick testing while developing.
And I'm only pointing out that it doesn't work under the emulator in case it'd be releatively simple to fix at some time in the future. In the mean time I can live with using my phone to test with.