Hi, progress report:
I nearly went mad, couldn't get my head around setting up the dreaded mobile scroller with my work ...
So I simplified it, simplified again, simplified once more, finally dropped all & started over with the very basics
- and finally got it running. What I have now:
- A simple text field for table display (listBehaviour, dontWrap, lockText, vScrollBar, tabStops),
in the desired size to fit on my card.
- The layer mode is "scrolling". No borders, no graphic effects. No script in it.
Loading 7K lines into it (> 300KB tab-CR CSV) works fine. It shows all data, scrolls smoothly, even mouseWheel works. With a formattedHeight above 210K px :) The same is displayed on Android, but is quite unusable yet.
Next Step: Dropping a mobile scroller on top. I already added this code to the card, now I call it from from a button:
Code: Select all
on mobScrollMake
set the vscrollbar of fld "data_fld" to false
set the acceleratedRendering of this stack to true
put the rect of fld "data_fld" of this cd into theScR
put 0,0,the width of field "data_fld",the formattedHeight of field "data_fld" into theCnR
put (the short name of this cd) & "TGScroll" into lName -- so it's unique (only 1 here)
if lName is in mobileControls() then
mobileControlDelete lName
end if
mobileControlCreate "scroller", lName
put the result into lScID
-- error checking omitted
mobileControlSet lScID, "rect", theScR
mobileControlSet lScID, "contentRect", theCnR
mobileControlSet lScID, "scrollingEnabled", true
mobileControlSet lScID, "vIndicator", true
mobileControlSet lScID, "vscroll", 1
mobileControlSet lScID, "visible", true
end mobScrollMake
on scrollerDidScroll hOffset, vOffset
set the vScroll of fld "data_fld" of this cd to vOffset
end scrollerDidScroll
And - runs like a charm!
Well, it takes some serious swiping to reach line 7000, but it's there. And the scrolling is beautifully smooth. Even on an antique MediaTab with Android 4.4 & 1GB RAM (left over test crap from a customer).
I don't know how much of the above is Voodoo. The "acceleratedRendering" is important for sure, w/o the scrolling works, but is rather slow.
Now, it's proven that we don't need a group to make a functional scrolling field for Android, as Richard suggested. A field that can display as many lines as RAM & CPU/GPU allows ;-)
I'll now slowly port back all of my other stuff, but it seems it can be done. ;-)))
When ready I'll post the demo here.
Have fun!