Recyclerview - Top item should overlap next item and so on
Asked Answered
G

0

3

I have set the negative margin for items like this:-

public class ItemDecorator extends RecyclerView.ItemDecoration {
    private final int mSpace;

    public ItemDecorator(int space) {
        this.mSpace = space;
    }

    @Override
    public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
        int position = parent.getChildAdapterPosition(view);
        if (position != 0)
            outRect.top = mSpace;
    }
}

This causes top item to stack lowest and next item after the top item overlaps it. I want top item to overlap its next item and so on.

Goren answered 2/10, 2015 at 11:19 Comment(6)
hey have you got any answer of this question, actually my requirement is same as this.Mixtec
i will share you shortly. i have asked it from my other account and got answer there.Goren
https://mcmap.net/q/271537/-recyclerview-overlap-items-bottom-to-topGoren
this has been done bro but need to overlapping when scroll. i need functionality like this [github.com/loopeer/CardStackView] .check this link and when we scroll all items overlapping to first item like card stack and so on.Mixtec
the link you shared is 404.Goren
sorry for that try this- github.com/loopeer/CardStackViewMixtec

© 2022 - 2024 — McMap. All rights reserved.