Buggy code:
public static final byte PTR_STATUS_COMPLETE = 4 ; private static final boolean DEBUG_LAYOUT = true ; public static boolean DEBUG = true ; private static int ID = 1 ; private static byte FLAG_AUTO_REFRESH_AT_ONCE = 1 ; private static byte FLAG_AUTO_REFRESH_BUT_LATER = 1 << 1 ; private static byte FLAG_ENABLE_NEXT_PTR_AT_ONCE = 1 << 2 ; private static byte FLAG_PIN_CONTENT = 1 << 3 ; private static byte MASK_AUTO_REFRESH = 3 ; protected final String LOG_TAG = "ptr-frame-" + ( ++ ( PtrFrameLayout . ID ) ) ; protected View mContent ; private int mHeaderId = 0 ; private int mContainerId = 0 ; private int mDurationToClose = 200 ; private int mDurationToCloseHeader = 1000 ; private boolean mKeepHeaderWhenRefresh = true ; private boolean mPullToRefresh = false ; private View mHeaderView ; private PtrUIHandlerHolder mPtrUIHandlerHolder = PtrUIHandlerHolder . create ( ) ; private PtrHandler mPtrHandler ; private PtrFrameLayout . ScrollChecker mScrollChecker ; private int mPagingTouchSlop ; private int mHeaderHeight ; private byte mStatus = PtrFrameLayout . PTR_STATUS_INIT ; private boolean mDisableWhenHorizontalMove = false ; private int mFlag = 0 ; private boolean mPreventForHorizontal = false ; private MotionEvent mDownEvent ; private MotionEvent mLastMoveEvent ; private PtrUIHandlerHook mRefreshCompleteHook ; private int mLoadingMinTime = 500 ; private long mLoadingStartTime = 0 ; private PtrIndicator mPtrIndicator ; private boolean mHasSendCancelEvent = false ; public PtrFrameLayout ( Context context ) { } public PtrFrameLayout ( Context context , AttributeSet attrs ) { } public PtrFrameLayout ( Context context , AttributeSet attrs , int defStyle ) { } @ Override protected void onFinishInflate ( ) { } @ Override protected void onMeasure ( int widthMeasureSpec , int heightMeasureSpec ) { } private void measureContentView ( View child , int parentWidthMeasureSpec , int parentHeightMeasureSpec ) { } @ Override protected void onLayout ( boolean flag , int i , int j , int k , int l ) { } private void layoutChildren ( ) { } public boolean dispatchTouchEventSupper ( MotionEvent e ) { } @ Override public boolean dispatchTouchEvent ( MotionEvent e ) { Log . e ( "zzzz" , ( "dispatchTouchEvent<seq2seq4repair_space>[MotionEvent]<seq2seq4repair_space>status<seq2seq4repair_space>--" + ( mStatus ) ) ) ; if ( ( ( mStatus ) == ( PtrFrameLayout . PTR_STATUS_COMPLETE ) ) || ( ( mStatus ) == ( PtrFrameLayout . PTR_STATUS_LOADING ) ) ) { return true ; } if ( ( ( ! ( isEnabled ( ) ) ) || ( ( mContent ) == null ) ) || ( ( mHeaderView ) == null ) ) { return dispatchTouchEventSupper ( e ) ; } int action = e . getAction ( ) ; switch ( action ) { case MotionEvent . ACTION_UP : case MotionEvent . ACTION_CANCEL : mPtrIndicator . onRelease ( ) ; if ( mPtrIndicator . hasLeftStartPosition ( ) ) { if ( PtrFrameLayout . DEBUG ) { PtrCLog . d ( LOG_TAG , "call<seq2seq4repair_space>onRelease<seq2seq4repair_space>when<seq2seq4repair_space>user<seq2seq4repair_space>release" ) ; } onRelease ( false ) ; if ( mPtrIndicator . hasMovedAfterPressedDown ( ) ) { sendCancelEvent ( ) ; return true ; } return dispatchTouchEventSupper ( e ) ; } else { return dispatchTouchEventSupper ( e ) ; } case MotionEvent . ACTION_DOWN : mHasSendCancelEvent = false ; mDownEvent = e ; mPtrIndicator . onPressDown ( e . getX ( ) , e . getY ( ) ) ; mScrollChecker . abortIfWorking ( ) ; mPreventForHorizontal = false ; if ( mPtrIndicator . hasLeftStartPosition ( ) ) { } else { dispatchTouchEventSupper ( e ) ; } return true ; case MotionEvent . ACTION_MOVE : mLastMoveEvent = e ; mPtrIndicator . onMove ( e . getX ( ) , e . getY ( ) ) ; float offsetX = mPtrIndicator . getOffsetX ( ) ; float offsetY = mPtrIndicator . getOffsetY ( ) ; <START_BUG> if ( ( ( mDisableWhenHorizontalMove ) && ( ! ( mPreventForHorizontal ) ) ) && ( ( ( Math . abs ( offsetX ) ) > ( mPagingTouchSlop ) ) || ( ( Math . abs ( offsetX ) ) > ( 3 * ( Math . abs ( offsetY ) ) ) ) ) ) { <END_BUG> if ( mPtrIndicator . isInStartPosition ( ) ) { mPreventForHorizontal = true ; } } if ( mPreventForHorizontal ) { return dispatchTouchEventSupper ( e ) ; } boolean moveDown = offsetY > 0 ; boolean moveUp = ! moveDown ; boolean canMoveUp = mPtrIndicator . hasLeftStartPosition ( ) ; if ( PtrFrameLayout . DEBUG ) { boolean canMoveDown = ( ( mPtrHandler ) != null ) && ( mPtrHandler . checkCanDoRefresh ( this , mContent , mHeaderView ) ) ; PtrCLog . v ( LOG_TAG , "ACTION_MOVE:<seq2seq4repair_space>offsetY:%s,<seq2seq4repair_space>mCurrentPos:<seq2seq4repair_space>%s,<seq2seq4repair_space>moveUp:<seq2seq4repair_space>%s,<seq2seq4repair_space>canMoveUp:<seq2seq4repair_space>%s,<seq2seq4repair_space>moveDown:<seq2seq4repair_space>%s:<seq2seq4repair_space>canMoveDown:<seq2seq4repair_space>%s" , offsetY , mPtrIndicator . getCurrentPosY ( ) , moveUp , canMoveUp , moveDown , canMoveDown ) ; } if ( ( moveDown && ( ( mPtrHandler ) != null ) ) && ( ! ( mPtrHandler . checkCanDoRefresh ( this , mContent , mHeaderView ) ) ) ) { return dispatchTouchEventSupper ( e ) ; } if ( ( moveUp && canMoveUp ) || moveDown ) { movePos ( offsetY ) ; return true ; } } return dispatchTouchEventSupper ( e ) ; } private void movePos ( float deltaY ) { } private void updatePos ( int change ) { } protected void onPositionChange ( boolean isInTouching , byte status , PtrIndicator mPtrIndicator ) { } @ SuppressWarnings ( "unused" ) public int getHeaderHeight ( ) { } private void onRelease ( boolean stayForLoading ) { } public void setRefreshCompleteHook ( PtrUIHandlerHook hook ) { } private void tryScrollBackToTop ( ) { } private void tryScrollBackToTopWhileLoading ( ) { } private void tryScrollBackToTopAfterComplete ( ) { } private void tryScrollBackToTopAbortRefresh ( ) { } private boolean tryToPerformRefresh ( ) { } private void performRefresh ( ) { } private boolean tryToNotifyReset ( ) { } protected void onPtrScrollAbort ( ) { } protected void onPtrScrollFinish ( ) { } public final void refreshComplete ( ) { } private void performRefreshComplete ( ) { }

Fix:
if ( ( ( mDisableWhenHorizontalMove ) && ( ! ( mPreventForHorizontal ) ) ) && ( ( ( Math . abs ( offsetX ) ) > ( mPagingTouchSlop ) ) && ( ( Math . abs ( offsetX ) ) > ( Math . abs ( offsetY ) ) ) ) ) {