Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FlexboxLayoutManager ROW NOWRAP, child layout top is wrong when RecyclerView has horizontal padding #603

Open
laishere opened this issue May 3, 2022 · 0 comments

Comments

@laishere
Copy link

laishere commented May 3, 2022

Issues and steps to reproduce

recyclerView.xml

<androidx.recyclerview.widget.RecyclerView
  android:layout_width="match_parent"
  android:layout_height="50dp"
  android:paddingHorizontal="14dp"
  />

item.xml

<TextView
  android:layout_width="wrap_content"
  android:layout_height="match_parent"
  android:gravity="bottom"
  android:text="@{title}"
  android:textSize="14sp"
  android:background="#f00"
  />

bug on release 3.0.0
FlexboxLayoutManager.java

// 1. line 1470
int childTop = layoutState.mOffset;

// 2. line 1745
mLayoutState.mOffset = anchorInfo.mCoordinate;

// 3. line 1138
anchorInfo.mCoordinate = mOrientationHelper.getStartAfterPadding()
                    + mPendingScrollPositionOffset;

The above code result in:

childTop = mOffset = mCoordinate = rv.paddingStart;

Expected behavior

childTop should be 0 at this case.

Version of the flexbox library

3.0.0

Link to code

As described above.

@laishere laishere changed the title FlexboxLayoutManager ROW NOWARP, child layout top is wrong when RecyclerView has horizontal padding FlexboxLayoutManager ROW NOWRAP, child layout top is wrong when RecyclerView has horizontal padding May 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant