liaoinstan / SpringView

🔥 A custom view pull to refresh,support ScrollView,ListView,RecyclerView,WebView and all another views, easy to use
Apache License 2.0
1.93k stars 355 forks source link

只有footer的时候手势滑动的时候出现错误 #91

Closed chunlovelv closed 4 years ago

chunlovelv commented 5 years ago

//回调自定义header/footer OnLimitDes接口 private void callbackOnLimitDes() { int scrollY = getScrollY(); if (scrollY < 0) { //下拉 if (Math.abs(scrollY) >= HEADER_LIMIT_HEIGHT && Math.abs(lastScrollY) < HEADER_LIMIT_HEIGHT) { if (headerHander != null) headerHander.onLimitDes(header, false); } else if (Math.abs(scrollY) <= HEADER_LIMIT_HEIGHT && Math.abs(lastScrollY) > HEADER_LIMIT_HEIGHT) { if (headerHander != null) headerHander.onLimitDes(header, true); } } else { //上拉 if (Math.abs(scrollY) >= FOOTER_LIMIT_HEIGHT && Math.abs(lastScrollY) < FOOTER_LIMIT_HEIGHT) { if (footerHander != null) footerHander.onLimitDes(footer, true); } else if (Math.abs(scrollY) <= FOOTER_LIMIT_HEIGHT && Math.abs(lastScrollY) > FOOTER_LIMIT_HEIGHT) { if (footerHander != null) footerHander.onLimitDes(footer, false); } } lastScrollY = scrollY; }

这是我修改之后的代码,你的源码里面上拉的时候判断标准也是用的HEADER_LIMIT_HEIGHT 这个值