0

I have a textview and I want it to be both scrollable and touchable. I have it set up like this:

 TextView myText = (TextView)findViewById(R.id.essayFormat);
 myText.setMovementMethod(new ScrollingMovementMethod());

Then I do a touch listener like this:

 myText.setOnTouchListener(new OnSwipeTouchListener() {
 });

Now it's swipeable but not scrollable up and down.

Some solutions I tried was putting the Textview inside a scrollview like this:

 <ScrollView
    android:id="@+id/content_scroll"
    android:layout_width="fill_parent"
    android:layout_height="70dp"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/title"
    android:fillViewport="true" 
    android:scrollbars="none">

<TextView
    android:id="@+id/essayFormat"
    android:layout_width="fill_parent"
    android:layout_height="70dp"
    android:layout_alignParentLeft="true"
    android:layout_alignParentRight="true"
    android:layout_below="@+id/title"
    android:clickable="true"
    android:fontFamily="Arial"
    android:maxLines="2"
    android:padding="10dp"
    android:scrollbars="vertical"
    android:textColor="#FFFFFF"
    android:textSize="16sp"
    android:textStyle="bold" 
    />
</ScrollView>

Any help is greatly appreciated!

user2779837
  • 301
  • 3
  • 15
  • http://stackoverflow.com/questions/1748977/making-textview-scrollable-in-android thats for scrollable – baron dune Sep 16 '13 at 18:26
  • You might want to try intercepting the touch event rather than consuming it : http://developer.android.com/reference/android/view/ViewGroup.html#onInterceptTouchEvent(android.view.MotionEvent) – Justin Jasmann Sep 16 '13 at 18:27
  • @JustinJasmann I did the onswipetouchlistener based on this thread http://stackoverflow.com/questions/4139288/android-how-to-handle-right-to-left-swipe-gestures . Could you tell me where I need to intercept it? – user2779837 Sep 16 '13 at 18:47

0 Answers0