Skip to content

修改手指按在屏幕上listView有抖动 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/me/maxwin/view/XListView.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,11 @@ public boolean onTouchEvent(MotionEvent ev) {
break;
case MotionEvent.ACTION_MOVE:
final float deltaY = ev.getRawY() - mLastY;

if (Math.abs(deltaY) < 10) {
return super.onTouchEvent(ev);
}

mLastY = ev.getRawY();
if (getFirstVisiblePosition() == 0
&& (mHeaderView.getVisiableHeight() > 0 || deltaY > 0)) {
Expand Down Expand Up @@ -303,7 +308,8 @@ public boolean onTouchEvent(MotionEvent ev) {
} else if (getLastVisiblePosition() == mTotalItemCount - 1) {
// invoke load more.
if (mEnablePullLoad
&& mFooterView.getBottomMargin() > PULL_LOAD_MORE_DELTA) {
&& mFooterView.getBottomMargin() > PULL_LOAD_MORE_DELTA
&& !mPullLoading) {
startLoadMore();
}
resetFooterHeight();
Expand Down