FloatingToolbarLayout

open class FloatingToolbarLayout @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : FloatingTopLayout

Floating toolbar layout container integrating a Toolbar and optional action mode bar.

Manages item projection backgrounds, title alpha transitions synchronized with AppBarLayout states, and selection view animations.

Parameters

context

The Context the view is running in.

attrs

The attributes of the XML tag inflating the view.

defStyleAttr

Default style attribute for styling.

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

FloatingAware implementation for FloatingToolbarLayout that inspects toolbar nav buttons, custom views, and menu views to place item projection background bounds.

Link copied to clipboard

CoordinatorLayout Behavior for FloatingToolbarLayout managing scroll events and title alpha transitions.

Properties

Link copied to clipboard
open override var floatingAware: FloatingAware?

Custom FloatingAware implementation providing reference views and bounds insets for item projection. Ensure that the relevant reference views are already visible when invoking this.

Link copied to clipboard

true if action mode is currently active and visible.

Link copied to clipboard
open override val logTag: String
Link copied to clipboard

The child Toolbar view managed by this layout.

Functions

Link copied to clipboard

Registers a view ID whose alpha is synchronized with the toolbar title alpha.

Link copied to clipboard

Forces hiding a specific projection background type.

Link copied to clipboard
open override fun addView(child: View?, index: Int, params: ViewGroup.LayoutParams?)

Handles adding child views, ensuring Toolbar configuration and projection view setup.

Link copied to clipboard
open override fun applyHeightToAvailBounds()

Empty override as toolbar layout bounds are managed via scrollable options.

Link copied to clipboard
open override fun applyScrollableViewOptions()

Configures scrollable bounds and offsets for attached scrollable views.

Link copied to clipboard

Returns the inflated action mode bar view if available.

Link copied to clipboard
open override fun getBehavior(): CoordinatorLayout.Behavior<*>

Returns the CoordinatorLayout behavior managing scroll and app bar offset events.

Link copied to clipboard
fun isStateToHideCondition(floatingScrollableView: View, coordinatorLayout: CoordinatorLayout): Boolean

Determines if scrollable view state allows app bar hide transitions.

Link copied to clipboard
open override fun needInvalidateBlurViews(): Boolean

Checks if blur views require invalidation based on toolbar and projection view alpha.

Link copied to clipboard
open override fun onAppBarOffsetChanged(appBarLayout: AppBarLayout, verticalOffset: Int)

Reacts to AppBarLayout scroll offset changes to update top/bottom fading edges and title alpha.

Link copied to clipboard

Unregisters a custom title view ID.

Link copied to clipboard

Restores visibility for a hidden projection background type.

Link copied to clipboard
open override fun setPaddingForElevation()

Empty override as toolbar elevation padding is handled by child items.

Link copied to clipboard
fun startTitleAlphaAnimation(show: Boolean, immediately: Boolean = false)

Animates the toolbar title and custom title views' alpha.

Link copied to clipboard

Evaluates current AppBarLayout collapse offset and updates title alpha accordingly.