Android - Gesture Detection (Swipe up/down) on particular view
Do this in your onCreate
method.
findViewById(R.id.tvOne).setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event){
return gestureScanner.onTouchEvent(event);
}
});
You can set OnTouchListener
s to individual TextView
s.
findViewById(R.id.tvOne).setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent event) {
// Your code here
}
}