SwipeToLoadLayout icon indicating copy to clipboard operation
SwipeToLoadLayout copied to clipboard

A reusable pull-to-refresh and pull-to-loadmore widget

Results 48 SwipeToLoadLayout issues
Sort by recently updated
recently updated
newest added

1、添加[SwipeViewFactory](https://github.com/liyzay/SwipeToLoadLayout/blob/master/library/src/main/java/com/aspsine/swipetoloadlayout/SwipeViewFactory.java)接口,用于生成HeaderView和FooterView,需要自定义HeaderView和FooterView的话实现SwipeViewFactory接口再调用[setSwipeViewFactory](https://github.com/liyzay/SwipeToLoadLayout/blob/master/library/src/main/java/com/aspsine/swipetoloadlayout/SwipeToLoadLayout.java#L696)即可 2、添加内置的Google Style的HeaderView和FooterView(SwipeToLoadLayout默认使用[GoogleStyleSwipeViewFactory](https://github.com/liyzay/SwipeToLoadLayout/blob/master/library/src/main/java/com/aspsine/swipetoloadlayout/GoogleStyleSwipeViewFactory.java))

因为recyclerview本身是没有footerview这种东西的,footerview也是一项item,如果你的footerview是动态的话就会因为ViewCompat.canScrollVertically(this.mTargetView, 1)这个方法判断不正确而导致不能上拉加载

问题:在CoordinatorLayout中嵌套ViewPager,ViewPager的Fragment中使用SwipeToLoadLayout嵌套RecyclerView。向下拉RecyclerView列表时,当CoordinatorLayout的头部还没完全隐藏时,就已经启动下拉刷新状态(换成Google自带的SwipeRefreshLayout刷新控件则没有此问题,因为SwipeRefreshLayout实现了NestedScrollingParent和NestedScrollingChild接口,而SwipeToLoadLayout则没有实现这两个接口)。希望在下个版本中优化此问题,谢谢。

原来swipe_target 限定的比较死, 1.将swipe_target 分离成容器与touchView 2.加了一个是否点击在touchView的设置项

怎么嵌套CoordinatorLayout 显示不出来东西

swipe_target 可以换成 android:tag 这样android:id可以正常使用

@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mSwipeToLoadLayout.post(new Runnable() { @Override public void run() { // 上面调用mSwipeToLoadLayout正常,下面这行代码发生空指针异常 mSwipeToLoadLayout.setRefreshing(true); } }); }

正在刷新的状态下,reclycleview居然可以上滑

我对比最新版本1.0.4和旧版本1.0.2的isRefreshing(),旧版本接口实现如下(新版本少了mLoading做与运算): public boolean isRefreshing() { return SwipeToLoadLayout.STATUS.isRefreshing(this.mStatus) && this.mLoading; } 在我的项目中需要判断下拉刷新的状态,我是使用作者暴露出来的isRefreshing()接口进行判断的,刷新过程中isRefreshing()返回值为true,反之为false。版本1.0.2也是没问题的。但就在版本1.0.3后,只要下拉刷新完成,isRefreshing()返回值一直为true,即使我先设置swipeToLoadLayout.setRefreshing(false),再取值isRefreshing仍然返回true。 我看了版本1.0.3和版本1.0.2的代码逻辑变动较大,是作者引入bug了还是其他原因,希望解答,谢谢。

if (mTargetView==null){ switch (childNum){ case 1:{ mTargetView=getChildAt(0); break; } case 2:{ if (mFooterView!=null){ mTargetView=getChildAt(0); }else { mHeaderView=getChildAt(0); mTargetView=getChildAt(1); } break; } case 3:{ mHeaderView=getChildAt(0); mTargetView=getChildAt(1); mFooterView=getChildAt(2); break; } }