java - Android Scroll Text in TextSwitcher -


i have texswitcher add 2 text views (created dynamically using textview class). switching between child text views using gesture detector. when text large fit in current viewable area, scrolling doesn't work textswitcher.

when tried using settextmovement method of child text views, textswitcher stopped listening horizontal swipe gestures.

has been successful in showing scrollable text views inside textswitcher.

i solved problem creating own textswitcher.

public class myownswitcher extends viewswitcher {     public myownswitcher (context context) {         super(context);     }      public myownswitcher (context context, attributeset attrs) {         super(context, attrs);     } } 

i moved "ontouchevent"-method new class. had override "onintercepttouchevent"-method that:

@override public boolean onintercepttouchevent(motionevent ev) {     ontouchevent(ev);     return super.onintercepttouchevent(ev); } 

i had move of fields , variables activity new class. can use methods of activity with:

activity ac = (activity) this.getcontext(); 

that should return activity.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -