We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8ba335 commit cc3a5aeCopy full SHA for cc3a5ae
flexbox/src/main/java/com/google/android/flexbox/FlexboxLayoutManager.java
@@ -2876,7 +2876,8 @@ private void assignFromView(View anchor) {
2876
mPosition = getPosition(anchor);
2877
mAssignedFromSavedState = false;
2878
assert mFlexboxHelper.mIndexToFlexLine != null;
2879
- int flexLinePosition = mFlexboxHelper.mIndexToFlexLine[mPosition];
+ int flexLinePosition =
2880
+ mFlexboxHelper.mIndexToFlexLine[mPosition != NO_POSITION ? mPosition : 0];
2881
mFlexLinePosition = flexLinePosition != NO_POSITION ? flexLinePosition : 0;
2882
// It's likely that the view is the first item in a flex line, but if not get the
2883
// index of the first item in the same line because the calculation of the flex lines
0 commit comments