HideViewOnScrollBehavior

The Behavior for a View within a CoordinatorLayout to hide the view off of the edge of the screen when scrolling down, and show it when scrolling up.

Supports hiding the View off of three screen edges: EDGE_RIGHT, EDGE_BOTTOM, and EDGE_LEFT.

If Touch Exploration is enabled, the hide on scroll behavior should be disabled until Touch Exploration is disabled. Ensure that the content is not obscured due to disabling this behavior by adding padding to the content.

Constructors

Link copied to clipboard
constructor()
constructor(viewEdge: Int)
constructor(@NonNull context: Context, @Nullable attrs: AttributeSet)

Types

Link copied to clipboard
Interface definition for a listener to be notified when the bottom view scroll state changes.
Link copied to clipboard
Positions the scroll state can be set to.

Properties

Link copied to clipboard
val EDGE_BOTTOM: Int = 1
The sheet slides out from the bottom edge of the screen.
Link copied to clipboard
val EDGE_LEFT: Int = 2
The sheet slides out from the left edge of the screen.
Link copied to clipboard
val EDGE_RIGHT: Int = 0
The sheet slides out from the right edge of the screen.
Link copied to clipboard
State of the view when it's scrolled in.
Link copied to clipboard
State of the view when it's scrolled out.

Functions

Link copied to clipboard
Adds a listener to be notified of View scroll state changes.
Link copied to clipboard
Link copied to clipboard
open fun disableOnTouchExploration(disableOnTouchExploration: Boolean)
Sets whether or not to disable this behavior if touch exploration is enabled.
Link copied to clipboard
A utility function to get the HideViewOnScrollBehavior associated with the view.
Link copied to clipboard
Returns whether or not this behavior is disabled if touch exploration is enabled.
Link copied to clipboard
open fun isScrolledIn(): Boolean
Returns true if the current state is scrolled in.
Link copied to clipboard
Returns true if the current state is scrolled out.
Link copied to clipboard
open fun onLayoutChild(@NonNull parent: CoordinatorLayout, @NonNull child: V, layoutDirection: Int): Boolean
Link copied to clipboard
open fun onNestedScroll(@NonNull coordinatorLayout: CoordinatorLayout, @NonNull child: V, @NonNull target: View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, type: Int, @NonNull consumed: Array<Int>)
Link copied to clipboard
open fun onStartNestedScroll(@NonNull coordinatorLayout: CoordinatorLayout, @NonNull child: V, @NonNull directTargetChild: View, @NonNull target: View, nestedScrollAxes: Int, type: Int): Boolean
Link copied to clipboard
Link copied to clipboard
open fun setAdditionalHiddenOffset(@NonNull child: V, @Dimension offset: Int)
Sets an additional offset used to hide the view.
Link copied to clipboard
open fun setViewEdge(viewEdge: Int)
Link copied to clipboard
open fun slideIn(@NonNull child: V)
Performs an animation that will slide the child from its current position to be totally on the screen.
open fun slideIn(@NonNull child: V, animate: Boolean)
Slides the child with or without animation from its current position to be totally on the screen.
Link copied to clipboard
open fun slideOut(@NonNull child: V)
Performs an animation that will slide the child from it's current position to be totally off the screen.
open fun slideOut(@NonNull child: V, animate: Boolean)
Slides the child with or without animation from its current position to be totally off the screen.