Interface ToolbarCoordinatorLayoutController
-
- All Implemented Interfaces:
public interface ToolbarCoordinatorLayoutController
An interface to be implemented by ToolbarCoordinatorLayout through which other components are enabled to control the toolbar movements, animations, etc.
-
-
Method Summary
Modifier and Type Method Description abstract void
displayContextualToolbar(@NonNull() ContextualToolbar toolbar, boolean animate)
Sets the contextual toolbar to be displayed in the coordinator. abstract void
removeContextualToolbar(boolean animate)
Removes current contextual toolbar from the layout (if there is any). abstract void
detachContextualToolbar()
Detach current contextual toolbar (if any) from the layout so it's able to move. abstract void
attachContextualToolbar()
Attach current contextual toolbar (if any) to the layout so it's unable to move. abstract void
onContextualToolbarPositionChanged(@NonNull() ContextualToolbar toolbar, @Nullable() ToolbarCoordinatorLayout.LayoutParams.Position oldPosition, @NonNull() ToolbarCoordinatorLayout.LayoutParams.Position newPosition)
Called when the ContextualToolbar position has changed. abstract void
onContextualToolbarChanged(@NonNull() ContextualToolbar toolbar)
Called when the ContextualToolbar menu items have changed internally. -
-
Method Detail
-
displayContextualToolbar
abstract void displayContextualToolbar(@NonNull() ContextualToolbar toolbar, boolean animate)
Sets the contextual toolbar to be displayed in the coordinator. Only one contextual toolbar can be set, so if there is a previously added contextual toolbar, it will be removed.
- Parameters:
toolbar
- Toolbar to be set to the coordinator and displayed.animate
-true
to animate toolbar removal,false
otherwise.
-
removeContextualToolbar
abstract void removeContextualToolbar(boolean animate)
Removes current contextual toolbar from the layout (if there is any).
- Parameters:
animate
-true
to animate toolbar removal,false
otherwise.
-
detachContextualToolbar
abstract void detachContextualToolbar()
Detach current contextual toolbar (if any) from the layout so it's able to move.
-
attachContextualToolbar
abstract void attachContextualToolbar()
Attach current contextual toolbar (if any) to the layout so it's unable to move.
-
onContextualToolbarPositionChanged
abstract void onContextualToolbarPositionChanged(@NonNull() ContextualToolbar toolbar, @Nullable() ToolbarCoordinatorLayout.LayoutParams.Position oldPosition, @NonNull() ToolbarCoordinatorLayout.LayoutParams.Position newPosition)
Called when the ContextualToolbar position has changed.
- Parameters:
toolbar
- Toolbar which position has changed.oldPosition
- Old position, ornull
if toolbar has been just shown.newPosition
- New posiiton of the toolbar.
-
onContextualToolbarChanged
abstract void onContextualToolbarChanged(@NonNull() ContextualToolbar toolbar)
Called when the ContextualToolbar menu items have changed internally.
This will trigger a call to onPrepareContextualToolbar, giving users the chance to modify the toolbar - e.g. to apply a custom grouping rule or hide toolbar items.
- Parameters:
toolbar
- Toolbar that has changed.
-
-
-
-