Hi, We are migrating our app to compose. we find a...
# compose
l
Hi, We are migrating our app to compose. we find an issue about a
ComposeView
(basically a TextView) Inside a androidx
ConstraintLayout
inside a
ViewHolder
. We notice that when the
ViewHolder
is Recycled, the
ComposeView
is not resized. It means that for a multi line text, sometimes the
ComposeView
is too small (we lose line) or too big (unwanted margin). We tried
.disposeComposition()
inside the Adapter onRecycled, We tried
Copy code
setViewCompositionStrategy(
ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed
)
The only thing that worked is ti disable the Recycling
setMaxRecycledViews( 0 )
but we lose benefit of RecyclerView