Skip to content

Commit

Permalink
Fix max edge alignment for reverse layout
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensousa committed Sep 9, 2023
1 parent 12aa49b commit 95bd1d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ internal class ParentAlignmentCalculator {
}

private fun isLayoutIncomplete(): Boolean {
if (isEndUnknown || isStartUnknown) {
return false
}
return if (!reverseLayout) {
endEdge < size - paddingEnd
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ internal abstract class StructureEngineer(
if (startEdge >= layoutInfo.getStartAfterPadding() && preferKeylineOverEdge) {
return false
}
fixEndGap(startEdge, endEdge, endView, remainingScroll, recycler, state)
fixEndGap(startEdge, endEdge, startView, remainingScroll, recycler, state)
return true
} else if (layoutRequest.reverseLayout && startEdge >= layoutInfo.getStartAfterPadding()) {
if (endEdge <= layoutInfo.getEndAfterPadding() && preferKeylineOverEdge) {
Expand Down Expand Up @@ -680,7 +680,7 @@ internal abstract class StructureEngineer(
state: RecyclerView.State
) {
val distanceToStart = max(0, startEdge - layoutInfo.getStartAfterPadding())
layoutRequest.prepend(layoutInfo.getLayoutPositionOf(endView)) {
layoutRequest.append(layoutInfo.getLayoutPositionOf(endView)) {
setCheckpoint(endEdge)
setFillSpace(distanceToStart)
}
Expand Down

0 comments on commit 95bd1d1

Please sign in to comment.