Created
January 17, 2013 08:31
-
-
Save crossle/4554552 to your computer and use it in GitHub Desktop.
ScrollView contain a TextView who had a scrollbar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.content.Context; | |
import android.util.AttributeSet; | |
import android.view.MotionEvent; | |
import android.widget.ScrollView; | |
public class CustScrollView extends ScrollView { | |
public CustScrollView(Context context) { | |
super(context); | |
} | |
public CustScrollView(Context context, AttributeSet attrs) { | |
super(context, attrs); | |
} | |
public CustScrollView(Context context, AttributeSet attrs, int defStyle) { | |
super(context, attrs, defStyle); | |
} | |
@Override | |
public boolean onTouchEvent(MotionEvent ev) { | |
return super.onTouchEvent(ev); | |
} | |
@Override | |
public boolean onInterceptTouchEvent(MotionEvent ev) { | |
final int action = ev.getAction(); | |
if ((action & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_MOVE) { | |
return false; | |
} | |
return super.onInterceptTouchEvent(ev); | |
} | |
@Override | |
public boolean dispatchTouchEvent(MotionEvent ev) { | |
return super.dispatchTouchEvent(ev); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment