Android-ObservableScrollView
Android-ObservableScrollView copied to clipboard
StaggeredGridLayoutManager ObservableRecyclerView
Whether the ObservableRecyclerView support to use StaggeredGridLayoutManager?
I haven't tried but if the current ObservableRecyclerView cannot handle StaggeredGridLayoutManager, I'd like to make it support. Do you have any specific problems with StaggeredGridLayoutManager?
First of all Thanks for this open project. The function that i need just as the FlexibleSpaceWithImageWithViewPagerTabActivity in the open source projects. (The different fragments in the viewPager all use the RecyclerVie but with the different LayoutManager.it contains the StaggeredGridLayoutManager and LinearLayoutManager.) the problem just as bellow when i using the StaggeredGridLayoutManager and LinearLayoutManager: 1.the custom recyclerAdapter need to support the different rows base on the using StaggeredGridLayoutManager or LinearLayoutManager(it's easy,just as you have done); 2.the scrollY in ObservableRecyclerView, i can't sure it's accuracy.so i use the bellow method:
if (0 == mStatusBarHeight) {
mStatusBarHeight = ScreenUtils.getStatusBarHeight(mContext);
}
View firstView = getChildAt(0);
firstView.getLocationOnScreen(mScrollInfo);
int headerToTop = mStatusBarHeight - mScrollInfo[1];
if (mCallbacks != null) {
mCallbacks.onScrollChanged(headerToTop, firstScroll, dragging);
}
3.when you switch the viewPager,the slidingTab in the fragment that has less content will sliding to the wrong position. I support what i said may be not quite right. Also please see understanding. Finally, Thanks again for the open source project and your reply.
Thanks for your reply. Maybe the each items managed by StaggeredGridLayoutManager have different height, and ObservableRecyclerView can't handle that correctly, I think. I'll consider whether there is a solution for it.
Hm, Adapter in RecyclerView should not have any access to Layout measurement but the LayoutManager should do them, I suppose. So in any case you want to support those LayoutManager, consider to extends default layout manager and provide extended access.