bgogetap / StickyHeaders

Easily add Sticky Headers to your RecyclerView
Apache License 2.0
521 stars 88 forks source link

It is possible use SwipeRefreshLayout as parent view #78

Closed davidHarush closed 6 years ago

davidHarush commented 6 years ago

it is possible to use SwipeRefreshLayout as parent view in addition to FrameLayout or use SwipeRefreshLayout?

Make sure the parent of the RecyclerView is a FrameLayout or CoordinatorLayout (this will be verified at Runtime)

Thanks...

bgogetap commented 6 years ago

SwipeRefreshLayout only supports one child, so this library could not work with it since the header is added as a child view of the RecyclerView's parent.

SwipeRefreshLayout still works just fine with the FrameLayout that hosts the RecyclerView put inside it:

SwipeRefreshLayout -FrameLayout --RecyclerView

davidHarush commented 6 years ago

Thanks, i wiil try it.

davidHarush commented 6 years ago

it's not working..

java.lang.IllegalArgumentException: RecyclerView parent must be either a FrameLayout or CoordinatorLayout at com.brandongogetap.stickyheaders.Preconditions.validateParentView(Preconditions.java:23) at com.brandongogetap.stickyheaders.StickyLayoutManager.onAttachedToWindow(StickyLayoutManager.java:123) at android.support.v7.widget.RecyclerView$LayoutManager.dispatchAttachedToWindow(RecyclerView.java:7739) . . .

from --> static void validateParentView(View recyclerView) at Preconditions

davidHarush commented 6 years ago

My mistake, seems to be working, Thanks