Skip to content

Commit

Permalink
修改默认 gapStrategy==GAP_HANDLING_NONE
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanCheen committed Nov 2, 2022
1 parent 2b690dc commit 725bae9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 725bae9

Please sign in to comment.