Synchronizing 2 ListViews

356 views
Skip to first unread message

Pablo Bertu

unread,
Jan 28, 2018, 8:33:37 PM1/28/18
to MIT App Inventor Forum
Hi!

What´s the easiest way to keep 2 lists synchronized? when user selects, say, item #3 in the 1st listview, I´d like the 2nd listview to select the third item at the same time.

So far I have tried this:


The "IF" block is only to make sure that I don´t try to position the second list in an item higher than its current size.

Any ideas? Thanks!

Bertu

TimAI2

unread,
Jan 29, 2018, 3:31:03 AM1/29/18
to MIT App Inventor Forum
Put both listviews inside a vertical scrolling arrangement and make the height of the listviews bigger than the arrangement. They should work together.

TimAI2

unread,
Jan 29, 2018, 6:08:01 AM1/29/18
to MIT App Inventor Forum

Abraham Getzler

unread,
Jan 29, 2018, 9:20:13 AM1/29/18
to MIT App Inventor Forum
If your two lists are that well matched, you can just
turn the two lists into a two column table (list of lists),
and show just a single List View populated with
text CSV rows, like in this example:

Each Element would contain the comma separated values at that index
from the two lists, populated by you in the Before Picking event.

ABG

Abraham Getzler

unread,
Jan 29, 2018, 10:09:33 AM1/29/18
to MIT App Inventor Forum
If you want to be sneaky, trim the tops off the two ListView
Elements lists based on a Canvas TouchUp
event on a pretend scroll bar.

Also, there might be a way using a scrollable arrangement
around the two ListViews, if I remember right.

ABG



Pablo Bertu

unread,
Jan 30, 2018, 8:43:52 AM1/30/18
to MIT App Inventor Forum
Great support and ideas from both Tim and Abraham! Thanks, I will test it soon and let you know how it goes.

Saludos!

Bertu

Reply all
Reply to author
Forward
0 new messages