GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 更新 readme · ftyangjun/SmartRefreshLayout@7957e42

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • app/src/main/res/layout
    • fragment_refresh_practive.xml
  • art
    • md_donationlist.md
  • refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout
    • SmartRefreshLayout.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎app/src/main/res/layout/fragment_refresh_practive.xml‎

Copy file name to clipboardExpand all lines: app/src/main/res/layout/fragment_refresh_practive.xml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
android:layout_height="match_parent"
2727
android:background="@android:color/white"
2828
android:overScrollMode="never"
29-
android:nestedScrollingEnabled="false"
3029
tools:listitem="@android:layout/simple_list_item_2"/>
3130
<com.scwang.smart.refresh.header.MaterialHeader
3231
android:layout_width="match_parent"
Collapse file

‎art/md_donationlist.md‎

Copy file name to clipboardExpand all lines: art/md_donationlist.md
+1Lines changed: 1 addition & 0 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
|昵称|日期|方式|留言|友情连接|
66
|:---:|:---:|:---:|:---:|:---:|
7+
|[pay_join]|2019-8-19|腾讯|👍~||
78
|[*一铭]|2019-8-9|阿里|请大佬一杯卡布奇诺?|👍👍👍|
89
|[未留名]|2019-7-31|微信|请大佬喝咖啡|👍👍👍👍👍👍|
910
|[pay_join]|2019-7-26|腾讯|👍||
Collapse file

‎refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java‎

Copy file name to clipboardExpand all lines: refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/SmartRefreshLayout.java
+19-27Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ public boolean dispatchTouchEvent(MotionEvent e) {
908908
mLastSpinner = 0;
909909
mTouchSpinner = mSpinner;
910910
mIsBeingDragged = false;
911-
// mEnableDisallowIntercept = false;
911+
mEnableDisallowIntercept = false;
912912
/*----------------------------------------------------*/
913913
mSuperDispatchTouchEvent = super.dispatchTouchEvent(e);
914914
if (mState == RefreshState.TwoLevel && mTouchY < 5 * thisView.getMeasuredHeight() / 6) {
@@ -924,7 +924,7 @@ public boolean dispatchTouchEvent(MotionEvent e) {
924924
float dx = touchX - mTouchX;
925925
float dy = touchY - mTouchY;
926926
mVelocityTracker.addMovement(e);//速度追踪
927-
if (!mIsBeingDragged /*&& !mEnableDisallowIntercept*/ && mDragDirection != 'h' && mRefreshContent != null) {//没有拖动之前,检测 canRefresh canLoadMore 来开启拖动
927+
if (!mIsBeingDragged && !mEnableDisallowIntercept && mDragDirection != 'h' && mRefreshContent != null) {//没有拖动之前,检测 canRefresh canLoadMore 来开启拖动
928928
if (mDragDirection == 'v' || (Math.abs(dy) >= mTouchSlop && Math.abs(dx) < Math.abs(dy))) {//滑动允许最大角度为45度
929929
mDragDirection = 'v';
930930
if (dy > 0 && (mSpinner < 0 || ((mEnableOverScrollDrag || mEnableRefresh) && mRefreshContent.canRefresh()))) {
@@ -1020,13 +1020,23 @@ public boolean dispatchTouchEvent(MotionEvent e) {
10201020
return super.dispatchTouchEvent(e);
10211021
}
10221022

1023-
// @Override
1024-
// public void requestDisallowInterceptTouchEvent(boolean b) {
1025-
// View target = mRefreshContent.getScrollableView();
1026-
// if ((Build.VERSION.SDK_INT >= 21 || !(target instanceof AbsListView)) && (/*target == null || */ViewCompat.isNestedScrollingEnabled(target))) {
1027-
// super.requestDisallowInterceptTouchEvent(b);
1028-
// }
1029-
// }
1023+
/**
1024+
* 这段代码来自谷歌官方的 SwipeRefreshLayout
1025+
* 主要是为了让老版本的 ListView 能平滑的下拉 而选择性的屏蔽 requestDisallowInterceptTouchEvent
1026+
* 应用场景已经在英文注释中解释清楚,大部分第三方下拉刷新库都保留了这段代码,本库也不例外
1027+
*/
1028+
@Override
1029+
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
1030+
// if this is a List < L or another view that doesn't support nested
1031+
// scrolling, ignore this request so that the vertical scroll event
1032+
// isn't stolen
1033+
View target = mRefreshContent.getScrollableView();
1034+
if ((android.os.Build.VERSION.SDK_INT >= 21 || !(target instanceof AbsListView))
1035+
&& (/*target == null || */ViewCompat.isNestedScrollingEnabled(target))) {
1036+
mEnableDisallowIntercept = disallowIntercept;
1037+
super.requestDisallowInterceptTouchEvent(disallowIntercept);
1038+
}
1039+
}
10301040

10311041
/**
10321042
* 在必要的时候 开始 Fling 模式
@@ -1103,24 +1113,6 @@ protected boolean interceptAnimatorByAction(int action) {
11031113
}
11041114
return reboundAnimator != null;
11051115
}
1106-
1107-
/*
1108-
* 这段代码来自谷歌官方的 SwipeRefreshLayout
1109-
* 应用场景已经在英文注释中解释清楚
1110-
* 大部分第三方下拉刷新库都保留了这段代码,本库也不例外
1111-
*/
1112-
@Override
1113-
public void requestDisallowInterceptTouchEvent(boolean disallowIntercept) {
1114-
// if this is a List < L or another view that doesn't support nested
1115-
// scrolling, ignore this request so that the vertical scroll event
1116-
// isn't stolen
1117-
View target = mRefreshContent.getScrollableView();
1118-
if ((android.os.Build.VERSION.SDK_INT >= 21 || !(target instanceof AbsListView))
1119-
&& (/*target == null || */ViewCompat.isNestedScrollingEnabled(target))) {
1120-
mEnableDisallowIntercept = disallowIntercept;
1121-
super.requestDisallowInterceptTouchEvent(disallowIntercept);
1122-
}
1123-
}
11241116
//</editor-fold>
11251117

11261118
//<editor-fold desc="状态更改 state changes">

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.