use of androidx.core.view.ScrollingView in project SmoothRefreshLayout by dkzwm.
the class ScrollCompat method isScrollingView.
public static boolean isScrollingView(View view) {
if (view instanceof AbsListView || view instanceof ScrollView || view instanceof WebView) {
return true;
}
if (ViewCatcherUtil.isRecyclerView(view)) {
RecyclerView recyclerView = (RecyclerView) view;
RecyclerView.LayoutManager manager = recyclerView.getLayoutManager();
if (manager != null) {
if (manager instanceof LinearLayoutManager) {
LinearLayoutManager linearManager = ((LinearLayoutManager) manager);
return linearManager.getOrientation() == RecyclerView.VERTICAL;
} else if (manager instanceof StaggeredGridLayoutManager) {
StaggeredGridLayoutManager gridLayoutManager = (StaggeredGridLayoutManager) manager;
return gridLayoutManager.getOrientation() == RecyclerView.VERTICAL;
}
}
return true;
} else {
return view instanceof ScrollingView;
}
}
Aggregations