diff --git a/flap/src/main/java/me/yifeiyuan/flap/widget/FlapIndexedStaggeredGridLayoutManager.java b/flap/src/main/java/me/yifeiyuan/flap/widget/FlapIndexedStaggeredGridLayoutManager.java index 5fd0659e..7670907a 100644 --- a/flap/src/main/java/me/yifeiyuan/flap/widget/FlapIndexedStaggeredGridLayoutManager.java +++ b/flap/src/main/java/me/yifeiyuan/flap/widget/FlapIndexedStaggeredGridLayoutManager.java @@ -154,9 +154,11 @@ public class FlapIndexedStaggeredGridLayoutManager extends RecyclerView.LayoutMa FlapIndexedStaggeredGridLayoutManager.LazySpanLookup mLazySpanLookup = new FlapIndexedStaggeredGridLayoutManager.LazySpanLookup(); /** + * 修改:默认改为 GAP_HANDLING_NONE * how we handle gaps in UI. */ - private int mGapStrategy = GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS; +// private int mGapStrategy = GAP_HANDLING_MOVE_ITEMS_BETWEEN_SPANS; + private int mGapStrategy = GAP_HANDLING_NONE; /** * Saved state needs this information to properly layout on restore. diff --git a/flap/src/main/java/me/yifeiyuan/flap/widget/FlapStaggeredGridLayoutManager.kt b/flap/src/main/java/me/yifeiyuan/flap/widget/FlapStaggeredGridLayoutManager.kt index 4741da30..e7a941aa 100644 --- a/flap/src/main/java/me/yifeiyuan/flap/widget/FlapStaggeredGridLayoutManager.kt +++ b/flap/src/main/java/me/yifeiyuan/flap/widget/FlapStaggeredGridLayoutManager.kt @@ -23,6 +23,10 @@ open class FlapStaggeredGridLayoutManager var supportsPredictiveItemAnimations = false + init { + gapStrategy = GAP_HANDLING_NONE + } + /** * Disable predictive animations. There is a bug in RecyclerView which causes views that * are being reloaded to pull invalid ViewHolders from the internal recycler stack if the