First the main goal of my app is to create a terminal type program
without word wrap. The text "window" will be larger than the screen
and if the line of text printed is larger than the screen the user can
horizontally scroll over to see what is off the screen. Basically I
have a custom LinearLayout which implements OnGestureListener that
contains a child ListView. I am able to over ride the onScroll event
and get horizontal scrolling to work fine. The problem is with
vertical scrolling. When the user scrolls up or down I want the
ListView to do its normal vertical scrolling. It seems once I have
implemented the OnGestureListener in my LinearLayout class that the
child ListView no longer gets any events. How can I work around this?
Here is a link for the code of the example I am following:
http://nan-technicalblog.blogspot.com/2008/12/android-how-to-use-horizontal-scrolling.html
I have tried returning a false from the onScroll method and also
adding
if (distanceY != 0){
mListView.scrollBy(0, (int)distanceY);
}
What doesn't quite make sense to me in the code above is that when I
add that it seems like the entire child ListView slides around inside
of the LinearLayout window instead of scrolling its list. I can tell
this because I added alot more strings to the ListView and the
vertical scroll bar of the ListView does not move when sliding finger
up and down on the display however the current contents that it does
show slide around but there is no movement from the veritcal scroll
bar of the ListView and the strings that are currently out of range on
the ListView never appear. If I remove the implements
OnGestureListener and comment out the related @Override functions the
ListView behaves properly but of course there is no horizontal
scrolling. I'm sure that I am missing something really obvious. Thanks
for your time and any help you can give!
--
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en