I use recyclerView with LinearLayoutManager and I need to do something like this (one items over other)
I think that this can be done by overriding a few methods in LayoutManager, but i don't know which of them.
How i can to do that?
I use recyclerView with LinearLayoutManager and I need to do something like this (one items over other)
I think that this can be done by overriding a few methods in LayoutManager, but i don't know which of them.
How i can to do that?
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent,
RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
if (mDivider == null) {
return;
}
if (parent.getChildPosition(view) < 1) {
return;
}
if (getOrientation(parent) == LinearLayoutManager.VERTICAL) {
outRect.top = mDivider.getIntrinsicHeight();
} else {
outRect.left = mDivider.getIntrinsicWidth();
}
}
After some searching I found this solution, I hope it will help someone https://androiddevx.wordpress.com/2014/12/05/recycler-view-pre-cache-views/