From 6f58df75f353773fb2e62b36a7bbe2af9921a8c3 Mon Sep 17 00:00:00 2001 From: SpiritCroc Date: Sun, 31 Oct 2021 19:06:54 +0100 Subject: [PATCH] [TMP] BetterLinearLayoutManager: debug initial anchor Change-Id: I81e5df345c14ab345a2fd1f7494e7f680d6889d4 --- .../recyclerview/widget/BetterLinearLayoutManager.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vector/src/main/java/de/spiritcroc/recyclerview/widget/BetterLinearLayoutManager.java b/vector/src/main/java/de/spiritcroc/recyclerview/widget/BetterLinearLayoutManager.java index dc8e385afd..5668e4cfe2 100644 --- a/vector/src/main/java/de/spiritcroc/recyclerview/widget/BetterLinearLayoutManager.java +++ b/vector/src/main/java/de/spiritcroc/recyclerview/widget/BetterLinearLayoutManager.java @@ -43,6 +43,8 @@ import static androidx.recyclerview.widget.RecyclerView.VERTICAL; import java.util.List; +import timber.log.Timber; + /** * A {@link RecyclerView.LayoutManager} implementation which provides * similar functionality to {@link android.widget.ListView}. @@ -911,6 +913,7 @@ public class BetterLinearLayoutManager extends LinearLayoutManager implements final int boundsStart = mOrientationHelper.getStartAfterPadding(); final int boundsEnd = mOrientationHelper.getEndAfterPadding(); anchorInfo.mCoordinate = (int) ((boundsEnd - boundsStart) * mPreferredAnchorPlacement); + Timber.i("Set preferred anchor to " + mPreferredAnchorPosition + " - " + anchorInfo.mCoordinate); // If all visible views are removed in 1 pass, reference child might be out of bounds. // If that is the case, offset it back to 0 so that we use these pre-layout children.