Google is committed to advancing racial equity for Black communities. See how.

TextToolbar

interface TextToolbar
androidx.ui.core.texttoolbar.TextToolbar

Interface for text-related toolbar.

Summary

Public methods
abstract Unit

Hide the floating toolbar(post-M) or primary toolbar(pre-M).

abstract Unit
showCopyMenu(rect: Rect, onDeselectRequested: () -> Unit, onCopyRequested: () -> Unit)

Show the floating toolbar(post-M) or primary toolbar(pre-M) for copying text.

Properties
abstract TextToolbarStatus

Return the TextToolbarStatus to check if the toolbar is shown or hidden.

Public methods

hide

abstract fun hide(): Unit

Hide the floating toolbar(post-M) or primary toolbar(pre-M).

showCopyMenu

abstract fun showCopyMenu(
    rect: Rect,
    onDeselectRequested: () -> Unit,
    onCopyRequested: () -> Unit
): Unit

Show the floating toolbar(post-M) or primary toolbar(pre-M) for copying text.

Parameters
rect: Rect region of interest. The selected region around which the floating toolbar should show.
onDeselectRequested: () -> Unit callback to deselect after the floating toolbar is clicked.
onCopyRequested: () -> Unit callback to copy text into ClipBoardManager.

Properties

status

abstract val status: TextToolbarStatus

Return the TextToolbarStatus to check if the toolbar is shown or hidden.

Return
TextToolbarStatus of TextToolbar.