liaohuqiu / android-Ultra-Pull-To-Refresh

Ultra Pull to Refresh for Android. Support all the views.
MIT License
9.58k stars 2.66k forks source link

CoordinatorLayout+AppBarLayout+CollapsingToolbarLayout+ViewPager问题 #283

Open douya40 opened 7 years ago

douya40 commented 7 years ago

CoordinatorLayout+AppBarLayout+CollapsingToolbarLayout+ViewPager 使用最新控件做上滑悬浮,当将列表上滑广告位消失。在做下拉,列表广告位消失,只有悬浮位置下拉刷新,出现显示不全问题

fzhengx commented 7 years ago

我的也是,CoordinatorLayout+AppBarLayout+下拉刷新(Recyclerview),上滑隐藏了toolbar后就滑不出来了 swiperefreshlayout不会出这种问题,大神快出来解决一下

bestbobgit commented 7 years ago

试试extends PtrFrameLayout implements NestedScrollingChild, NestedScrollingParent

zhangdongsheng2 commented 7 years ago

我用的这种方式 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;
        }
dkzwm commented 7 years ago

我基于该项目写了一个支持NestedScroll特性的下拉刷新库https://github.com/dkzwm/SmoothRefreshLayout ,你可以试用下。谢谢

oyty commented 6 years ago

@zhangdongsheng2 在此基础上还应加上ScrollableLayout的判断,不然还有事件冲突


            public boolean checkCanDoRefresh(PtrFrameLayout frame, View content, View header) {
                return checkContentCanBePulledDown && mScrollableLayout.canPtr();
           }