GeezerVison is showing github.com — 修复二级刷新 不能使用普通布局作为内容的问题 · ftyangjun/SmartRefreshLayout@e15d3ab
File tree
Expand file treeCollapse file tree
Open diff view settings
refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: refresh-layout-kernel/src/main/java/com/scwang/smart/refresh/layout/util/SmartUtil.java +7Lines changed: 7 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
|
18 | 18 | import android.widget.ListView; |
19 | 19 | import android.widget.ScrollView; |
20 | 20 |
|
| 21 | +import com.scwang.smart.refresh.layout.api.RefreshComponent; |
21 | 22 | import com.scwang.smart.refresh.layout.kernel.R; |
22 | 23 |
|
23 | 24 | import static android.view.ViewGroup.LayoutParams.MATCH_PARENT; |
@@ -81,6 +82,9 @@ public static void scrollListBy(@NonNull AbsListView listView, int y) { |
81 | 82 | } |
82 | 83 |
|
83 | 84 | public static boolean isScrollableView(View view) { |
| 85 | + if (view instanceof RefreshComponent) { |
| 86 | + return false; |
| 87 | + } |
84 | 88 | return view instanceof AbsListView |
85 | 89 | || view instanceof ScrollView |
86 | 90 | || view instanceof ScrollingView |
@@ -89,6 +93,9 @@ public static boolean isScrollableView(View view) { |
89 | 93 | } |
90 | 94 |
|
91 | 95 | public static boolean isContentView(View view) { |
| 96 | + if (view instanceof RefreshComponent) { |
| 97 | + return false; |
| 98 | + } |
92 | 99 | return isScrollableView(view) |
93 | 100 | || view instanceof ViewPager |
94 | 101 | || view instanceof NestedScrollingParent; |
|