Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

滑动冲突 #175

Open
921668753 opened this issue Jan 9, 2019 · 2 comments
Open

滑动冲突 #175

921668753 opened this issue Jan 9, 2019 · 2 comments

Comments

@921668753
Copy link

921668753 commented Jan 9, 2019

<cn.bingoogolapple.refreshlayout.BGARefreshLayout
android:id="@+id/mRefreshLayout"
style="@style/MatchMatch">
<android.support.v7.widget.RecyclerView
android:id="@+id/rv"
style="@style/MatchMatch"

                    android:overScrollMode="never"
                    android:paddingLeft="@dimen/dimen2"
                    android:paddingRight="@dimen/dimen2"
                    android:scrollbars="none"
                    tools:listitem="@layout/item_mystrategy" />


    </cn.bingoogolapple.refreshlayout.BGARefreshLayout>

下拉刷新的时候,会产生冲突,RecyclerView做瀑布流的时候未滑动到顶部,下拉就会刷新了

@921668753
Copy link
Author

StaggeredGridLayoutManager layoutManager = (StaggeredGridLayoutManager) manager;

            int[] out = layoutManager.findFirstCompletelyVisibleItemPositions(null);
            if (out[0] < 1 ) {
                return true;
            }

是由于这里判断错误导致的BGARefreshScrollingUtil 判断isRecyclerViewToTop是否到顶部导致的错误
建议在添加 if (out[0] < 1 && !recyclerView.canScrollVertically(-1)) {
return true;
}
完美解决问题

@many-cat
Copy link

many-cat commented Aug 3, 2020

当item未展示全时,执行isRecyclerViewToTop=true out[0]==-1,这样就造成了以上问题,将判断改为out[0]==0是不是就可以了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants