Scroll multiple listviews at the same time

661 views
Skip to first unread message

daniel farfan balvaneda

unread,
Aug 2, 2017, 10:35:42 AM8/2/17
to MIT App Inventor Forum
Hi, 
I would like to know if there is an option to scroll down multiple lists at the same time.
i have like 5 lists to "create" a table but when i scroll down they only do it individually.

Regards


Italo

unread,
Aug 2, 2017, 11:03:08 AM8/2/17
to MIT App Inventor Forum
If you need to scroll 5 lists together, why don't you JOIN the 5 elements into one and just have one list?

Like  item1 - item2 - item3 - item4 - item5

daniel farfan balvaneda

unread,
Aug 2, 2017, 11:14:19 AM8/2/17
to MIT App Inventor Forum
I did not think that was possible so i did not try.
It seems that could work, i will try it and post the results.

Thank you!!!

Tim Carter

unread,
Aug 2, 2017, 12:31:42 PM8/2/17
to MIT App Inventor Forum

Abraham Getzler

unread,
Aug 2, 2017, 2:20:42 PM8/2/17
to MIT App Inventor Forum
You can make your own phony scroll bar on the right using a thin vertical Canvas and a Ball.
As the Canvas is touched Up (chosen for its infrequency) calculate the relative position
in the Canvas (Y/Height) and assign to the parallel ListViews just those Elements of their base lists
from that point onwards.

Remember the offset so you can get proper indexing into the base lists 
from the SelectionIndex, or just rely on Selection if that's all you need.

ABG

Italo

unread,
Aug 2, 2017, 2:45:34 PM8/2/17
to MIT App Inventor Forum
@Abraham: That's a really smart idea.

@Tim: I remember I did something like that once, for a universal CSV reader, using a vertical scroll arrangement, and one label per column. I added the \n character after each item in the columns, and it showed the whole CSV with more than 1000 lines just like a spreadsheet.
But as you might guess, there's no way to click or select anything. It was just a viewer.

Using listview might be a good solution to add the possibility of selecting, at least what line to work with.

Ghica

unread,
Aug 3, 2017, 8:15:52 AM8/3/17
to MIT App Inventor Forum
You could also use one of Taifun's table layouts using a webviewer and some JavaScript. See here: http://puravidaapps.com/table.php
Cheers, Ghica.

daniel farfan balvaneda

unread,
Aug 5, 2017, 12:38:38 PM8/5/17
to MIT App Inventor Forum
Hi, i could not do that. How can i join 5 listviews into 1

daniel farfan balvaneda

unread,
Aug 5, 2017, 12:39:35 PM8/5/17
to MIT App Inventor Forum
Hi, i could not do that, do you have an example of that ? :/  

Abraham Getzler

unread,
Aug 6, 2017, 11:02:39 PM8/6/17
to mitappinv...@googlegroups.com
See attached for how to do it, using data from the Pizza Party sample
and 5 columns.

Pardon the Landscape sample shot.

ABG

fill_ListViews.PNG
blocks.png
btnSelectAll_Click.PNG
Designer.PNG
Capture.PNG
fusion_listview_columns.aia
listViews.PNG
reload.PNG
when_Ball1_Dragged.PNG
when_canvasScroll_TouchUp.PNG
when_ftbSelectAll_GotResult.PNG
when_LvwN_AfterPicking.PNG
announce.PNG

Tim Carter

unread,
Aug 7, 2017, 6:01:36 AM8/7/17
to MIT App Inventor Forum
Also:

Create Vertical Scroll Arrangement (VSA): Height Automatic, Width 100%
Inside this VSA create a Horizontal Arrangement(HA): Height Automatic, Width 100%
Inside the HA add your List Views: Set Widths to suit, Set Height to something like 1000 pixels or more   << the important bit!

The list views should all scroll together.

You have to ensure that all the entries in all the listviews have the same length or number of lines, so that the listview box heights for each entry remain the same, for example

If you had 2 listviews of 100px wide each

Entry for 1st  ListView = "Labrador"
Entry for 2nd ListView = "The Labrador is a very popular breed of dog due to its good nature, especially around children, and its ease of training"

You will see that the boxes go out of alignment if you add more similar entries (this is especially so when using responsive sizing)

Abraham Getzler

unread,
Aug 7, 2017, 12:22:20 PM8/7/17
to MIT App Inventor Forum
(I forgot to include my runtime screen shot).

I dealt with the misalignment problem by limiting my ListViews
to just 4 rows, denying them enough content to get too far out of alignment.

I am surprised my ListViews aligned anyway.

This sample could be made posher by stacking a horizontal Canvas over each ListView,
with alternating background colors, wired to adjust their (and their corresponding ListView
Width by the direction of horizontal drags.

ABG

Capture.PNG
Reply all
Reply to author
Forward
0 new messages