hey, maybe someone can help me to solve the proble...
# compose
a
hey, maybe someone can help me to solve the problem with combining Android xml layout with compose. Problem is that some fragments are compose some are xml, Main activity is done with xml and have CoordinatorLayout with CollapsingToolbarLayout. All xml only screens behaves normal, toolbar collapses on scroll, but the ones which are made with Compose are not working, toolbar is not collapsing. I assume it can not observe global scroll of compose content
a
I would migrate to
ComposeView
with
Scaffold
and
TopAppBar
like described here, instead of trying to make these two worlds work together: https://developer.android.com/develop/ui/compose/migrate/migration-scenarios/coordinator-layout#collapse-expand-toolbars
a
If you can’t, you’ll need to probably try using a nested scrolling connection on your composable that has scrolling
🚀 1
thank you color 1
Copy code
.nestedScroll(rememberNestedScrollInteropConnection()),
a
Thanks guys, secret was to add rememberNestedScrollInteropConnection() to top level view modifier: Modifier.nestedScroll(rememberNestedScrollInteropConnection()))
🎉 1
a
We have similar experiences in this. Currently working on a full app migration to compose navigation instead of XML, but still needed compatibility layers before
a
Same here, thanks again