Skip to content

Commit

Permalink
fix: reduce crash on flexboxlayout changing on candidates update
Browse files Browse the repository at this point in the history
  • Loading branch information
WhiredPlanck committed Nov 21, 2024
1 parent 083d519 commit 4ed8d24
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class PagedCandidatesUi(
}
}
}
}.apply {
// We must do this to avoid ArrayIndexOutOfBoundsException
// https://github.com/google/flexbox-layout/issues/363#issuecomment-382949953
setHasStableIds(true)
}

private val candidatesLayoutManager =
Expand All @@ -75,6 +79,7 @@ class PagedCandidatesUi(
recyclerView {
visibility = View.GONE

itemAnimator = null
isFocusable = false
adapter = candidatesAdapter
layoutManager = candidatesLayoutManager
Expand Down

0 comments on commit 4ed8d24

Please sign in to comment.