Closed andanicalik closed 8 years ago
I'll look at the issue today when I get home (~15:00 UTC -8)
Just started to test this library and get into this problem too.
Seems related to having the recyclerview in a FrameLayout. Switching to a RelativeLayout fixed it, but support for FrameLayout would be better for performance and maybe there's impact too with CoordinatorLayout (Not tested yet).
The issue is that I can't put the scrollBar in there because it's a view of its own and obviously can't coexist with the recyclerView in a layout that only supports one child. The solution at the moment would be to wrap the recyclerView in a relativeLayout, which will work, though it is inelegant. I'll work on coming up with a better solution to support a wider variety of parent views since it's pretty limited atm.
Well after reading again the issue, mine is different :)
FrameLayout support multiple childs and the bar is visible it's just at left instead of right.
The solution with wrapping the content of the SwipeRefreshLayout
in a container works, but somehow this is disturbing the SwipeRefreshLayout
...
When I scroll up, everything works, but when i scroll down, it shows the refreshing view even if I'm not scrolled up and I can't scroll up anymore...
I'm quite sure the SwipeRefreshLayout
depends on it's one child scrolling behaviour and that's the source reason this is not working correctly
That's works for me :
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_refresh_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/reveal_notification">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fadeScrollbars="true"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:background="@color/search_bar"/>
</RelativeLayout>
</android.support.v4.widget.SwipeRefreshLayout>
AND
mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
if (linearLayoutManager.findFirstCompletelyVisibleItemPosition() == 0)
mSwipeRefreshLayout.setEnabled(true);
else
mSwipeRefreshLayout.setEnabled(false);
}
});
Same issue here.
Did you try my solution above ?
@samy-baili Yes - this saved me. :+1: But I'm hoping that this could be handled in the lib.
When my recyclerview in swiperefreshlayout scroll doesn't show. What can i do for solve ?