How to use Android Compose Scaffold AppBar CollapsedScrollBehavior with RecyclerView? - android

I am trying to implement the scaffold appBar collapsedScrollBehavior and it's working perfectly fine when the content is in compose like LazyColumn.
But in my use case, I am inflating the fragment with RecyclerView inside the Scaffold Content using Android Compose Interop APIs. Scaffold appBar is not collapsing/expanding when I am scrolling the RecyclerView which is inside the fragment.
I know it's a unique scenario and could found any documentation under Android Compose Interop APIs. Kindly let me know if there is anything I can try to make this work.

Related

Android, Jetpack Compose. How to customise SwipeRefresh for bottom refreshing?

I am writing a chat on Compose and need to refresh list of messages when swipe from bottom of screen.
Is should looks like standard SwipeRefresh, but reverse. Is it possible to customise SwipeRefresh for this purpose?

WebView content inside of bottom sheet of the ModalBottomSheetLayout is not scrollable

I am trying to implement WebView in a ModalBottomSheetLayout. Issue is that WebView content is not scrolling inside bottom sheet. It works fine in normal compose view. Couldn't find anything workable. Is there a way to make it working?

How to resize the whole composable inside navhost to wrap content while motion scene is in progress?

I am working on compose to create a similar behavior as the YouTube collapsable mini player. I can get the composable to collapse but could not resize the composable hosted inside the navhost which is why I am looking out for guidance or tips here.

Can LazyColumn work along with CoordinatorLayout?

I am migrating an app to Jetpack Compose and I have the following situation on a view/compose hybrid screen:
The layout root element is a CoordinatorLayout that has a top bar which is collapsible.
The content is a FragmentViewPager, and one of the pages is the Fragment I am migrating to Compose.
When I scroll the LazyColumn inside this fragment, the top bar won't collapse/expand.
My question is: Can I do something to make both pieces work together? i.e: When I scroll a LazyColumn, a CoordinatorLayout that contains it will make it's top bar collapse/expand.
It looks like the Compose Interop Android Documentation was recently updated with a subsection on Nested Scrolling With Views. At this time, Android CoordinatorLayout and Compose LazyColumn interop UX is not officially supported. The official Google Issue Tracker is here.

Using static fragments with CoordinatorLayout of the new Design Support Library

I've been experimenting with the new offerings of the library and I just can't wrap my head around customizing it the way I want.
I am taking as a reference this sample code: https://github.com/chrisbanes/cheesesquare
I have successfully managed to add a static fragment (contains some FrameLayout with recyclerView and additional empty views) as the child of the CoordinatorLayout, which works as expected when scrolling the (ugly) recycler view inside it.
The working gist and the result:
I am only trying to add one extra CardView above my fragment, which should also have the same effect on the toolbar when dragged upwards. I tried adding them both to a LinearLayout inside a NestedScrollView, together with other various combinations, of which none was successful. Whenever I tap on the cardview, they are displaced and never again in their own place. Moreover, dragging the cardview still fades out the toolbar, but nothing else happens.
The non-working gist and the result:
I came across a different issue using CoordinatorLayout as the container for my fragments: https://code.google.com/p/android/issues/detail?id=179600
It seems CoordinatorLayout has a number of issues with this use case. The solution is likely to use a FrameLayout instead to contain your fragment, then put the CoordinatorLayout as the top level container of your fragment's UI.

Categories

Resources