V0.25 - android scroller

This is the place to discuss anything relating to MobGUI

Moderators: heatherlaine, kevinmiller, robinmiller, malte, splash21

Post Reply
splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

V0.25 - android scroller

Post by splash21 » Wed Nov 09, 2011 6:21 pm

The main change is a new general purpose scroller for android (although it should work just as well with iOS). It's a first draft, so I'm looking for feedback and suggestions - especially performance on real devices. Horizontal scrolling, vertical scrolling and both are supported with optional bounce. I've been testing on the android simulator (which is pretty slow!) and performance has been acceptable so far. There will no doubt be lots of room for improvement, but hopefully it's a good start.

Have fun!
LiveCode Development & Training : http://splash21.com

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

Re: V0.25 - android scroller

Post by andyh1234 » Mon Nov 14, 2011 3:03 pm

Ive tested this on the ZTE Blade running 2.3, and Samsung Galaxy Apollo running 2.2 and it works very well on both, id say it almost appears better than the scroller running on the iPhone 3 so ill give it a go on that as well and see if that is the case!

Andy

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

Re: V0.25 - android scroller

Post by andyh1234 » Fri Nov 18, 2011 5:29 pm

Just a quick update.

The scroller works well at scrolling, but there is an odd behaviour when you go back to a card that has a scroller on it.

For example, if you have a start card (1), then go to a sub card (2) with a scroller and a button. Button takes to back to card 1, then you go back to card 2 again, the scroller is no longer able to scroll right to the bottom or top.

Would it be possible to add a function to destroy the scrollers when the card is closed so they can be reset from scratch just like the first time you go to the card?

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

Re: V0.25 - android scroller

Post by andyh1234 » Fri Nov 18, 2011 5:49 pm

Sorry, the last post was probably as clear as mud!

Ive updated your demo stack to show the problem by adding a start card and uploaded it to...

http://byoni.on-rev.com/livecode/Scroll ... obDemo.zip

If you try this stack in either the iOS or Android emulator, click on the button on the front card to load the scroller and everything is good.

Click back to return to the first card, then the button again to return to the scroller and try using the A-Z bar at the side or scroll to see the problem, when you try to scroll the contacts will usually disappear until you scroll right down, its like the top is being set incorrectly.

Andy

splash21
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 369
Joined: Sun Dec 19, 2010 1:10 am
Location: UK
Contact:

Re: V0.25 - android scroller

Post by splash21 » Thu Nov 24, 2011 10:11 am

Thanks, Andy - I see what you mean! MobGUI is remembering the location of the scroller contents - which you may want, so they could reposition on orientation change, etc. You should be able to work around this by saving the vscroll of the scroller and the top of the field when the card closes and restoring those values when the card opens. I'll have another look and try to find a way that would be a bit friendlier :)
LiveCode Development & Training : http://splash21.com

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

Re: V0.25 - android scroller

Post by andyh1234 » Thu Nov 24, 2011 10:14 am

Yes, I thought that might be the case.

Unfortunately Im using the scroller on a card ive created for a psuedo picker, so the contents change each time its called.

Maybe setting the vscroll to 0 before the card closes, the disabling the frontscript will help, Ill try that!

Thanks again.

Andy

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

Re: V0.25 - android scroller

Post by andyh1234 » Thu Nov 24, 2011 10:21 am

Bingo!

The following code fixes the problem, thanks again for putting me on the right path!!

Code: Select all

on closeCard
   set the vscroll of grp "Scroller" to 0
   mobGUIScrollers false
end closeCard
Andy

BarrySumpter
Posts: 1201
Joined: Sun Apr 24, 2011 2:17 am

Re: V0.25 - android scroller

Post by BarrySumpter » Fri Nov 25, 2011 9:32 pm

Can't seem to get this demo to work on win32 or HTC HD2 physical device.
The "Open Scroller Card" button doesn't respond.
I wonder if this is for LC v5 only? As I am developing in LC v4.6.4.


Edit: LOL, yeah OK. Forgot how fun LC is.

Code: Select all

on touchEnd pId
   mobGUIUntouch the long id of me
   
   # LC5 : new visual effect syntax
   --lock screen for visual effect
   go card "ScrollerCard"
   
   wait for 0 millisecs with messages
   unlock screen with visual effect "push left very fast"
end touchEnd
All my best,
Barry G. Sumpter

Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.

Post Reply

Return to “MobGUI”