setRecyclerView

fun setRecyclerView(recyclerView: RecyclerView)

Attaches a RecyclerView to this floating layout container.

What Attaching Does

  • Scroll Integration: Registers the RecyclerView (cast as SeslScrollable) with FloatingScrollableManager to observe scroll events (onScrolled, onFastScrollStart, onFastScrollEnd).

  • Auto Show/Hide Transitions: Automatically animates the floating layout's alpha and visibility in response to scrolling content (e.g., hiding when scrolling down past a threshold, showing when scrolling up or idle).

  • Fast Scroll & Go-To-Top Handling: Intercepts fast scrolling events to manage the container's visibility and coordinate the "Go to Top" button state.

  • Blur Invalidation: Automatically triggers background blur target view invalidation as scrolling occurs.

  • Option Propagation: Applies scrollable options such as windowInsetBottom, manageGoToTopOffset, and manageFadingEdgeBottomOffset to FloatingScrollableManager.

Attachment Lifecycle Management

  • Weak Reference: Holds the RecyclerView instance via WeakReference to prevent memory leaks.

  • Window Detachment: Registers an OnAttachStateChangeListener on the RecyclerView. When the view is detached from the window (onViewDetachedFromWindow), clearFloatingScrollableView is called automatically.

  • Lifecycle Awareness: If the view's Context is a LifecycleOwner, a DefaultLifecycleObserver is registered to automatically detach the scrollable view upon onDestroy.

  • Re-binding Cleanup: Clears any existing scrollable view association before attaching the new instance.

Parameters

recyclerView

Target RecyclerView instance to attach.