views:

159

answers:

1

Hello I am trying to make a terminal type app that is wider than the actual android screen. A listview is great except that I don't want the text to wrap. If the text is wider than the screen I want it to print the full text and then the user can scroll over horizontally if they want to see what was printed off the screen. Just FYI this is for ascii type tables. I have followed this example:

http://nan-technicalblog.blogspot.com/2008/12/android-how-to-use-horizontal-scrolling.html

It works great as far as horizontal text goes it does exactly what I want but I am unable to get the ListView inside the custom LinearLayout to actually scroll veritcally. I have tried passing the Y coordinates from the onScroll method to mListView such as:

mListView.scrollBy(0, distanceY);

but that seems to move the custom LinearLayout window instead of just scrolling the ListView. I can tell that the ListView is not scrolling because the window moves without the vertical scroll bar of the ListView moving. Everything just slides around. Any help would be much appreciated.

A: 

Ok this one also took me about a week in my spare time to figure out. I had to change the supplied code for dispatchTouchEvent to this:

 public boolean dispatchTouchEvent(MotionEvent ev){
     mGestureDetector.onTouchEvent(ev);
     mListView.onTouchEvent(ev);
     return true;
 }

Also changed onScroll to return false just for good measure.

ThePosey