SeslImmersiveScrollBehavior

AppBarLayout.Behavior that coordinates "immersive scroll" between an AppBarLayout and the system bars (status/navigation bars) on Android R+.

When immersive scroll is enabled (via seslIsActivatedImmsersiveScroll), this behavior requests a WindowInsetsAnimationController from the WindowInsetsController and drives it based on AppBarLayout offset changes. This allows the app bar collapsing/expanding motion to be synchronized with showing/hiding system bars, and also translates any optional bottom overlay view (see setBottomView).

When immersive scroll is disabled

This class is a SESL/Samsung extension and relies on platform APIs such as WindowInsetsAnimationController.

Constructors

Link copied to clipboard
constructor(context: Context, attributeSet: AttributeSet)
Creates a new behavior instance.

Functions

Link copied to clipboard
Cancels any in-progress insets animation control request and finishes the controller.
Link copied to clipboard
Link copied to clipboard
Re-evaluates whether immersive scroll can run and applies any related configuration.
Link copied to clipboard
Finishes the current WindowInsetsAnimationController based on its current insets.
Link copied to clipboard
open fun forceRestoreWindowInset(forceRestore: Boolean)
Forces system bars to be shown if they are hidden or if the app bar is currently hidden.
Link copied to clipboard
Link copied to clipboard
open fun initImmViews(@NonNull coordinatorLayout: CoordinatorLayout, @NonNull appBarLayout: AppBarLayout)
Initializes references to the relevant views (decor/content/system bar backgrounds) and hooks offset/insets callbacks.
Link copied to clipboard
open fun isAppBarHide(): Boolean
Link copied to clipboard
Returns whether the device is using gesture navigation.
Link copied to clipboard
open fun layoutChild(@NonNull parent: CoordinatorLayout, @NonNull child: AppBarLayout, layoutDirection: Int)
Link copied to clipboard
Notifies the behavior that window insets have been applied/changed.
Link copied to clipboard
Notifies the behavior that the associated app bar has been detached.
Link copied to clipboard
open fun onInterceptTouchEvent(@NonNull coordinatorLayout: CoordinatorLayout, @NonNull appBarLayout: AppBarLayout, @NonNull motionEvent: MotionEvent): Boolean
Link copied to clipboard
open fun onMeasureChild(@NonNull parent: CoordinatorLayout, @NonNull child: AppBarLayout, parentWidthMeasureSpec: Int, widthUsed: Int, parentHeightMeasureSpec: Int, heightUsed: Int): Boolean
Link copied to clipboard
open fun onNestedPreScroll(parent: CoordinatorLayout, @NonNull child: AppBarLayout, target: View, dx: Int, dy: Int, consumed: Array<Int>, type: Int)
Link copied to clipboard
open fun onNestedScroll(@NonNull coordinatorLayout: CoordinatorLayout, @NonNull appBarLayout: AppBarLayout, @NonNull target: View, dxConsumed: Int, i2: Int, i3: Int, dyUnconsumed: Int, type: Int, @NonNull consumed: Array<Int>)
Link copied to clipboard
open fun onStartNestedScroll(@NonNull coordinatorLayout: CoordinatorLayout, @NonNull appBarLayout: AppBarLayout, @NonNull view: View, @NonNull view2: View, i: Int, i2: Int): Boolean
Link copied to clipboard
open fun onStopNestedScroll(coordinatorLayout: CoordinatorLayout, @NonNull appBarLayout: AppBarLayout, view: View, i: Int)
Link copied to clipboard
open fun release()
Releases transient references and callbacks.
Link copied to clipboard
open fun restoreTopAndBottom(animate: Boolean)
Restores (shows) the top and bottom areas after they have been hidden by immersive scroll.
Link copied to clipboard
open fun setAutoRestoreTopAndBottom(autoRestore: Boolean)
Enables/disables automatic restoration when system bars become controllable again.
Link copied to clipboard
open fun setBottomView(@Nullable view: View)
Sets an optional bottom overlay view that should translate together with the navigation bar.
Link copied to clipboard
Applies the default shown-state insets to the active WindowInsetsAnimationController.
Link copied to clipboard
open fun setNeedToCheckBottomViewMargin(checkBottomViewMargin: Boolean)
Controls whether the behavior should adjust the bottom view translation using current navigation bar insets when immersive scroll is disabled.
Link copied to clipboard
Restores decorFitsSystemWindows when immersive scroll has been detached/disabled.
Link copied to clipboard