Open technoir42 opened 6 years ago
Hi @technoir42
Unfortunately it's not possible at this moment. I tried the similar implementation, but realized it needs to access the package private members of the ViewHolder, which aren't exposed.
So I recommend to use FlexboxLayout at this moment.
Please let me know if something is not clear.
I'm trying to implement a custom
ItemDecoration
to assign offsets for each item (somewhat similar toFlexboxItemDecoration
). To calculate the offsets ingetItemOffsets
I need to know the relative position of the item in the current flex line.The problem is at the moment when
getItemOffsets
is called the currentFlexLine
is not added yet toFlexboxLayoutManager.getFlexLinesInternal()
and I've found no other way to get the relative position.Would it be possible to add the current
FlexLine
to list beforegetItemOffsets
gets called or provide some other way to obtain item position in a flex line?Just for illustration, this is kind of layout I'm trying to achieve: