Android-ObservableScrollView icon indicating copy to clipboard operation
Android-ObservableScrollView copied to clipboard

StaggeredGridLayoutManager ObservableRecyclerView

Open SamJonson opened this issue 8 years ago • 4 comments

Whether the ObservableRecyclerView support to use StaggeredGridLayoutManager?

SamJonson avatar Nov 23 '15 15:11 SamJonson

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?

ksoichiro avatar Nov 29 '15 14:11 ksoichiro

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.

SamJonson avatar Dec 02 '15 02:12 SamJonson

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.

ksoichiro avatar Dec 06 '15 04:12 ksoichiro

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.

eneim avatar Dec 06 '15 05:12 eneim