SmartRefreshLayout icon indicating copy to clipboard operation
SmartRefreshLayout copied to clipboard

PullUpCanceled或自动刷新PullDownToRefresh执行动画过程中,触摸子View时存在getParent().requestDisallowInterceptTouchEvent(true)会触发interceptAnimatorByAction取消动画被打断,导致无法恢复默认状态

Open libin1993 opened this issue 9 months ago • 0 comments

/** * 在动画执行时,触摸屏幕,打断动画,转为拖动状态 * @param action MotionEvent * @return 是否成功打断 */ protected boolean interceptAnimatorByAction(int action) { if (action == MotionEvent.ACTION_DOWN) { if (reboundAnimator != null) { if (mState.isFinishing || mState == RefreshState.TwoLevelReleased || mState == RefreshState.RefreshReleased || mState == RefreshState.LoadReleased) { return true;//完成动画和打开动画不能被打断 } if (mState == RefreshState.PullDownCanceled) { mKernel.setState(RefreshState.PullDownToRefresh); } else if (mState == RefreshState.PullUpCanceled) { mKernel.setState(RefreshState.PullUpToLoad); } reboundAnimator.setDuration(0);//cancel会触发End调用,可以判断0来确定是否被cancel reboundAnimator.cancel();//会触发 cancel 和 end 调用 reboundAnimator = null; } animationRunnable = null; } return reboundAnimator != null; }

libin1993 avatar Mar 20 '25 05:03 libin1993