Charles Woodson
Charles Woodson

Reputation: 868

Android Jetpack Compose Coordinator Layout Equivalent

What is the best way to get the functionality of a CoordinatorLayout in Jetpack Compose?

I know that a Box is essentially a FrameLayout and CoordinatorLayout is a super-powered FrameLayout but is there a super-powered Box layout?

Upvotes: 3

Views: 6878

Answers (2)

JayeshJadhav
JayeshJadhav

Reputation: 11

Hey you can check the working of nested scroll over here:- https://developer.android.com/reference/kotlin/androidx/compose/ui/input/nestedscroll/package-summary In this if you have a full scroll list, i.e, you know that your list will have enough items to make it scrollable then use only nested scroll connection. But you have finite items and your list might have very few items, and sometimes it might not be scrollable, then in that case use nestedScrollConnection with nestedScrollDispatcher. With the second option, it implements drag as well as scroll for the list. So the drag will happen until your toolbar reaches its minimum height and then list will be scrollable only after that.

Upvotes: 0

emrah
emrah

Reputation: 140

I guess we need to use nestedScroll modifier. There is a Collapsing Toolbar Example on documentation page.

Upvotes: 4

Related Questions