scrolling in iPad

328 views
Skip to first unread message

macagain

unread,
Aug 6, 2011, 9:17:12 PM8/6/11
to google-we...@googlegroups.com
What's the best or right way to do gwt apps that scroll properly on the iPad?  I.e. apps that are bigger than the browser window.  Scrollpanel does seem to work either.

I've tried some of the touch scroll panel widgets floating around, but they don't show the scroll bars, which of course confuses users.

i've seen the gwt wiki on gwt/iphone, but that dates from 1.4 and the original iphone.  Anyone know of a better guide?

Anyone done a gwt app for ipad?  would love to hear your experiences.

-r

CSchulz

unread,
Aug 6, 2011, 10:13:21 PM8/6/11
to google-we...@googlegroups.com
I'm in a similar boat. I found a scroll view that works but it's choppy and doesn't display the faded scroll bars on the right side. If you find anything let me know.

Gal Dolber

unread,
Aug 7, 2011, 5:33:42 PM8/7/11
to google-we...@googlegroups.com
ScrollPanel do work. What version of gwt are you using?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/-G-2M1M15fgJ.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.



--
Guit: Elegant, beautiful, modular and *production ready* gwt applications.

http://code.google.com/p/guit/




Jens

unread,
Aug 7, 2011, 5:36:35 PM8/7/11
to google-we...@googlegroups.com
iOS 5 will support a new CSS property called -webkit-overflow-scrolling. When setting the value "touch" and using it together with overflow:scroll you get native iOS scrolling on elements. This will be the best solution for iOS 5. For older iOS versions you can use ScrollPanel which supports touch scrolling since GWT 2.3 I think. Its not as nice as native scrolling but its better than nothing. 

redjhawk

unread,
Aug 7, 2011, 5:38:44 PM8/7/11
to Google Web Toolkit
To let a user do scrolling, you have to use a scrollpanel with any
widget with a size bigger than the parent scrollpanel.

I use a 'personalized' ScrollPanel with touch support
(TouchScrollPanel, at the end of this mail). That panel must fit the
mobile screen. Then, inside that panel, you have to insert any widget,
with the size desired. If that widget is bigger than the scrollPanel,
then you will be able to scroll.

GWT 2.3 already let the user to do vertical and horizontal scroll with
touch and mouse events. With GWT 2.2, you will have to do horizontal
scroll manually with touch events (detect onTouchStart,onTouchMove and
onTouchEnd):

void onTouchStart(TouchStartEvent event) {
startPoint = event.getChangedTouches().get(0).getClientX();
startScroll=scrollPanel.getHorizontalScrollPosition();
}

void onTouchMove(TouchMoveEvent event) {
int change = (startPoint-
event.getChangedTouches().get(0).getClientX());
scrollPanel.setHorizontalScrollPosition(startScroll+change);
event.preventDefault();
}

void onTouchEnd(TouchEndEvent event) {
startPoint=0;
startScroll = 0;
}


public class TouchableScrollPanel extends ScrollPanel implements
HasAllTouchHandlers {
@Override
public HandlerRegistration addTouchStartHandler(TouchStartHandler
handler) {
return addDomHandler(handler, TouchStartEvent.getType());
}
@Override
public HandlerRegistration addTouchMoveHandler(TouchMoveHandler
handler) {
return addDomHandler(handler, TouchMoveEvent.getType());
}
@Override
public HandlerRegistration addTouchEndHandler(TouchEndHandler
handler) {
return addDomHandler(handler, TouchEndEvent.getType());
}
@Override
public HandlerRegistration addTouchCancelHandler(TouchCancelHandler
handler) {
return addDomHandler(handler, TouchCancelEvent.getType());

macagain

unread,
Aug 11, 2011, 9:35:01 AM8/11/11
to google-we...@googlegroups.com
Thanks everyone who pointed out that it works in 2.3!  I was not aware of that or I'd have moved...
Reply all
Reply to author
Forward
0 new messages