https://kotlinlang.org logo
#compose
Title
# compose
g

Gabriel Lasso

04/20/2022, 12:34 PM
I also want to migrate to Jetpack Compose, I created a component that is fixed at the bottom of screen and it has a section that expands on click. When I used it in a compose activity, it worked fine, but when I used the same component in a old activity using
ComposeView
inside a
ConstraintLayout
it began flickering when it is expanding or contracting. Anyone can help me? I created a minimal example of it happening here (video on README.md)
c

Csaba Szugyiczki

04/20/2022, 12:47 PM
I think the problem is that your ComposeView is resizing while the animation is running:
android:layout_height="wrap_content"
g

Gabriel Lasso

04/20/2022, 3:05 PM
@Csaba Szugyiczki it makes sense, but how can I fix that? I can't make the height constant...
c

Csaba Szugyiczki

04/20/2022, 3:09 PM
no idea, maybe you can try adding
android:animateLayoutChanges="true"
to the parent ViewGroup
g

Gabriel Lasso

04/20/2022, 4:46 PM
Well, it didn't work...
android:layout_height="0dp"
worked
c

Csaba Szugyiczki

04/21/2022, 7:03 AM
strange 🙂 but glad it solved for you
4 Views