android-Ultra-Pull-To-Refresh
android-Ultra-Pull-To-Refresh copied to clipboard
CoordinatorLayout+AppBarLayout+CollapsingToolbarLayout+ViewPager问题
CoordinatorLayout+AppBarLayout+CollapsingToolbarLayout+ViewPager 使用最新控件做上滑悬浮,当将列表上滑广告位消失。在做下拉,列表广告位消失,只有悬浮位置下拉刷新,出现显示不全问题
我的也是,CoordinatorLayout+AppBarLayout+下拉刷新(Recyclerview),上滑隐藏了toolbar后就滑不出来了 swiperefreshlayout不会出这种问题,大神快出来解决一下
试试extends PtrFrameLayout implements NestedScrollingChild, NestedScrollingParent
我用的这种方式 appBarLayout = (AppBarLayout) mView.findViewById(R.id.layout_appbar);
appBarLayout.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int verticalOffset) {
if (verticalOffset >= 0) {
checkContentCanBePulledDown = true;
} else {
checkContentCanBePulledDown = false;
}
}
});
@Override
public boolean checkCanDoRefresh(PtrFrameLayout frame, View content, View header) {
return checkContentCanBePulledDown;
}
我基于该项目写了一个支持NestedScroll特性的下拉刷新库https://github.com/dkzwm/SmoothRefreshLayout ,你可以试用下。谢谢
@zhangdongsheng2 在此基础上还应加上ScrollableLayout的判断,不然还有事件冲突
public boolean checkCanDoRefresh(PtrFrameLayout frame, View content, View header) {
return checkContentCanBePulledDown && mScrollableLayout.canPtr();
}