momentum scrolling a dg

The place to discuss anything and everything about running your LiveCode on Android

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

momentum scrolling a dg

Post by sturgis » Wed Jan 04, 2012 8:19 pm

Does anyone have some example code for momentum scrolling a datagrid? Scrolling by finger isn't bad, though its a little rough looking, but haven't got a momentum system to work yet.

Suggestions?

andyh1234
Posts: 442
Joined: Mon Aug 13, 2007 4:44 pm
Location: Eccles UK
Contact:

Re: momentum scrolling a dg

Post by andyh1234 » Thu Jan 05, 2012 2:49 pm

If you have Mobgui you can use the Android scroller there, its the only thing I've found that works well for me.

Its simply a group, you then put your data grid inside it and make the data grid resize to its full contents. The Mobgui control then takes care of the scrolling, data grid is just used for layout and input.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: momentum scrolling a dg

Post by sturgis » Thu Jan 05, 2012 3:53 pm

Hmm might have to try this.

For datagrids with small enough amounts of data it should be great. Is there a problem when using datagrids that have LOTS of rows? Just a curiosity question. For my current project this should be dandy.
Thanks!
andyh1234 wrote:If you have Mobgui you can use the Android scroller there, its the only thing I've found that works well for me.

Its simply a group, you then put your data grid inside it and make the data grid resize to its full contents. The Mobgui control then takes care of the scrolling, data grid is just used for layout and input.

andyh1234
Posts: 442
Joined: Mon Aug 13, 2007 4:44 pm
Location: Eccles UK
Contact:

Re: momentum scrolling a dg

Post by andyh1234 » Thu Jan 05, 2012 4:22 pm

Scrolling performance has never been a problem for me, the issue with the larger data grids (in my cases 200 lines+) has been the time it takes for the data grid to be populated as I understand it only usually populates the rows it considers visible, but by setting its size to show everything, everything has to be populated.

It really depends on how many elements there are as to how long this takes, but the key for me has been to make the search dynamic and limit the results sent to populate the data grid. Anything under 100 lines and the grid propagates instantly.

If you like, drop me a pm and Ill send you a link to an app I've written so you can try it on your device and see how the scroller is working compared to what you are currently using.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: momentum scrolling a dg

Post by sturgis » Thu Jan 05, 2012 4:42 pm

That would be cool, and yes please. I think for my current project the dg will always be well under 200 lines. Future projects maybe not (and yeah thats my concern with larger data-sets. Looking forward to trying your app!

Did they turn PM's back on?

strongbow
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 135
Joined: Mon Jul 31, 2006 1:39 am
Location: New Zealand, Australia, Germany, Japan
Contact:

Re: momentum scrolling a dg

Post by strongbow » Wed Jan 11, 2012 5:02 pm

You can also use the normal iosScroller to control a datagrid.

Just have to use the particular datagrid-specific attributes (like dgFormattedHeight etc) in order to set it up ok.

Then just catch the scroll events as usual and modify the DG VScroll and so on.

HTH

cheers

Alan

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: momentum scrolling a dg

Post by sturgis » Wed Jan 11, 2012 5:08 pm

This won't work on android though right? (the native ios scroller)

strongbow
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 135
Joined: Mon Jul 31, 2006 1:39 am
Location: New Zealand, Australia, Germany, Japan
Contact:

Re: momentum scrolling a dg

Post by strongbow » Wed Jan 11, 2012 6:37 pm

Right - sorry, didn't realise you were looking for an Android solution.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: momentum scrolling a dg

Post by sturgis » Wed Jan 11, 2012 7:41 pm

Np, didn't know the ios scroller stuff was implemented so ive got it filed away now in my noggin for future use, so thx much for pointing it out to me. I'll need it at some point!
strongbow wrote:Right - sorry, didn't realise you were looking for an Android solution.

Post Reply

Return to “Android Deployment”