I am using a ScrollView, that has a scroll trigger, in unscrollable state, I would like to detect the possible scroll, but instead of scrolling the view i would like to do other things with this value.
@Override
public boolean onInterceptTouchEvent(MotionEvent event) {
if (!mScrollable) {
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:
y = event.getY();
case MotionEvent.ACTION_UP:
y = event.getY();
case MotionEvent.ACTION_MOVE:
double newY = event.getY();
double difY = y - newY;
mCallbacks.onScrollChanged((int) difY, false, false);
y = newY;
}
return false;
} else return super.onInterceptTouchEvent(event);
}
This code return difY as 0, if the cases return true, than ACTION_MOVE is not called at all.