TextToolbar


Interface for text-related toolbar.

Summary

Public functions

Unit

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

Cmn
Unit
showMenu(
    rect: Rect,
    onCopyRequested: (() -> Unit)?,
    onPasteRequested: (() -> Unit)?,
    onCutRequested: (() -> Unit)?,
    onSelectAllRequested: (() -> Unit)?
)

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

Cmn

Public properties

TextToolbarStatus

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

Cmn

Public functions

hide

fun hide(): Unit

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

showMenu

fun showMenu(
    rect: Rect,
    onCopyRequested: (() -> Unit)? = null,
    onPasteRequested: (() -> Unit)? = null,
    onCutRequested: (() -> Unit)? = null,
    onSelectAllRequested: (() -> Unit)? = null
): Unit

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

Parameters
rect: Rect

region of interest. The selected region around which the floating toolbar should show. This rect is in global coordinates system.

onCopyRequested: (() -> Unit)? = null

callback to copy text into ClipBoardManager.

onPasteRequested: (() -> Unit)? = null

callback to get text from ClipBoardManager and paste it.

onCutRequested: (() -> Unit)? = null

callback to cut text and copy the text into ClipBoardManager.

Public properties

status

val statusTextToolbarStatus

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