Use correct position for item decorator

It should use binding adapter to react to changes in binding order
(moving) properly.

Test: manual
Fixes: 184610254
Change-Id: I785f1746cdee4f03315d37b6b1f3335522e0eb17
This commit is contained in:
Fabian Kozynski
2021-04-06 09:27:09 -04:00
parent 6c63ebbb9e
commit 2f04a92bf4

View File

@@ -728,7 +728,7 @@ public class TileAdapter extends RecyclerView.Adapter<Holder> implements TileSta
GridLayoutManager lm = ((GridLayoutManager) parent.getLayoutManager());
SpanSizeLookup span = lm.getSpanSizeLookup();
ViewHolder holder = parent.getChildViewHolder(view);
int column = span.getSpanIndex(holder.getLayoutPosition(), lm.getSpanCount());
int column = span.getSpanIndex(holder.getBindingAdapterPosition(), lm.getSpanCount());
if (view instanceof TextView) {
super.getItemOffsets(outRect, view, parent, state);