Toolbar Coordinator Layout
This layout is responsible for handling toolbars. It is used in PdfActivity, but it can be added to any view group, for example to the root view of the custom activity.
Types
Link copied to clipboard
Layout parameters for ContextualToolbars added to ToolbarCoordinatorLayout.
Link copied to clipboard
interface OnContextualToolbarLifecycleListener
Listener for the lifecycle of the ContextualToolbar as it goes through the .
Link copied to clipboard
interface OnContextualToolbarMovementListener
Listener for ContextualToolbar movements inside the ToolbarCoordinatorLayout.
Link copied to clipboard
interface OnContextualToolbarPositionListener
Listener for ContextualToolbar position changes inside the .
Functions
Link copied to clipboard
Attach current contextual toolbar (if any) to the layout so it's unable to move.
Link copied to clipboard
Detach current contextual toolbar (if any) from the layout so it's able to move.
Link copied to clipboard
Sets the contextual toolbar to be displayed in the coordinator.
Link copied to clipboard
Gets the currently displayed contextual toolbar (if any).
Link copied to clipboard
Calculates inset that should be applied on views under currently displayed toolbar to correctly inset their content below toolbar.
Link copied to clipboard
Indicates whether the contextual toolbar is being currently displayed.
Link copied to clipboard
Called when the ContextualToolbar menu items have changed internally.
Link copied to clipboard
open fun onContextualToolbarPositionChanged(@NonNull toolbar: ContextualToolbar, @Nullable oldPosition: ToolbarCoordinatorLayout.LayoutParams.Position, @NonNull newPosition: ToolbarCoordinatorLayout.LayoutParams.Position)
Called when the ContextualToolbar position has changed.
Link copied to clipboard
Link copied to clipboard
Removes current contextual toolbar from the layout (if there is any).
Link copied to clipboard
Sets the color for possible position areas when the toolbar is being dragged.
Link copied to clipboard
Sets whether the main toolbar is enabled or not.
Link copied to clipboard
open fun setOnContextualToolbarLifecycleListener(@Nullable lifecycleListener: ToolbarCoordinatorLayout.OnContextualToolbarLifecycleListener)
Sets the listener for lifecycle changes of the ContextualToolbar as it goes through the ToolbarCoordinatorLayout - preparing, displaying, removing.
Link copied to clipboard
open fun setOnContextualToolbarMovementListener(@Nullable movementListener: ToolbarCoordinatorLayout.OnContextualToolbarMovementListener)
Sets the listener for ContextualToolbar movements within the layout.
Link copied to clipboard
open fun setOnContextualToolbarPositionListener(@Nullable positionListener: ToolbarCoordinatorLayout.OnContextualToolbarPositionListener)
Sets the listener for ContextualToolbar position within the layout.
Link copied to clipboard
open fun toggleMainToolbarVisibility(visible: Boolean, startDelayMs: Long, animationDurationMs: Long)
Toggles the visibility of the main toolbar.