Created
November 20, 2016 06:51
-
-
Save enginebai/7c3f9affdadeb7cffd33f043b3c95cc6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
@Override | |
public boolean onTouchEvent(MotionEvent event) { | |
if (mEnabled) { | |
this.getParent().requestDisallowInterceptTouchEvent(true); | |
switch (event.getAction()) { | |
case MotionEvent.ACTION_DOWN: | |
if (mOnSwagPointsChangeListener != null) | |
mOnSwagPointsChangeListener.onStartTrackingTouch(this); | |
updateOnTouch(event); | |
break; | |
case MotionEvent.ACTION_MOVE: | |
updateOnTouch(event); | |
break; | |
case MotionEvent.ACTION_UP: | |
if (mOnSwagPointsChangeListener != null) | |
mOnSwagPointsChangeListener.onStopTrackingTouch(this); | |
setPressed(false); | |
this.getParent().requestDisallowInterceptTouchEvent(false); | |
break; | |
case MotionEvent.ACTION_CANCEL: | |
if (mOnSwagPointsChangeListener != null) | |
mOnSwagPointsChangeListener.onStopTrackingTouch(this); | |
setPressed(false); | |
this.getParent().requestDisallowInterceptTouchEvent(false); | |
break; | |
} | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment