ScrollPane is sluggish on J2me devices

5 posts / 0 new
Last post
combes
combes's picture
Offline
Joined: 8 Nov 2011
Posts:
ScrollPane is sluggish on J2me devices

Hi,

I recently started work on a project using the Mosync platform and I think it's got a lot of great features. However, I was a bit unhappy about the MAUI framework as it only provides basic UI functionality. I recently had to use the community provided "ScrollPane" to providing scrolling label functionality in a class that displays a quite a bit of text (over 5000 characters).
However, when testing on J2me phones the scroll functions but is quite sluggish and relatively unresponsive. Has anyone else experienced this and is there a work around I can employ.

Thanks

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

Hi, I think that the basic problem will be displaying so much text. It will have to do a separate paint operation for each character, and for each scrolling increment, so that is a lot of work. It may be that a natively drawn label would be faster. Have a look at these widgets http://www.mosync.com/content/madrawtextw which may provide a much better experience.

combes
combes's picture
Offline
Joined: 8 Nov 2011
Posts:

Thanks Sam,

I suspected as much, but was hoping that there was some kind of work around. I'll have a look the link you provided.

combes
combes's picture
Offline
Joined: 8 Nov 2011
Posts:

Hi Sam,

I was thinking i could revamp the whole UI model by displaying the text in bits (one screen at a time) and implementing some swipe based transitions. To do this, I have to know dimensions of the bounding box of a particular length of text. I was looking at the methods in the font class, but the documentation did not sufficiently explain the workings of the class methods.

Could you direct me to any tutorial or sample code that would help.

thanks

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

The most useful code is probably the label widget. Have a look here, as it calculates the size required for the text it's being asked to display. https://github.com/MoSync/MoSync/blob/master/libs/MAUI/Label.cpp