🌈 Create new beautiful Compose Gradients with our new wesite ->
Interface

TextToolbar

Interface for text-related toolbar.

Source set: Common
public interface TextToolbar

Interface for text-related toolbar.

Properties

status

Source set: Common
public val status: TextToolbarStatus

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

Return

TextToolbarStatus of TextToolbar.

Functions

showMenu

Source set: Common
public fun showMenu(
        rect: Rect,
        onCopyRequested: (() -> Unit)? = null,
        onPasteRequested: (() -> Unit)? = null,
        onCutRequested: (() -> Unit)? = null,
        onSelectAllRequested: (() -> Unit)? = null,
        onAutofillRequested: (() -> Unit)? = null,
    )

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

Parameters

rect region of interest. The selected region around which the floating toolbar should show. This rect is in global coordinates system.
onCopyRequested callback to copy text into ClipBoardManager. If null, the copy option will not be shown.
onPasteRequested callback to get text from ClipBoardManager and paste it. If null, the paste option will not be shown.
onCutRequested callback to cut text and copy the text into ClipBoardManager. If null, the cut option will not be shown.
onSelectAllRequested callback to select all the text content. If null, the select all option will not be shown.
onAutofillRequested callback to autofill the field. If null, the autofill option will not be shown.

showMenu

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

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

Parameters

rect region of interest. The selected region around which the floating toolbar should show. This rect is in global coordinates system.
onCopyRequested callback to copy text into ClipBoardManager. If null, the copy option will not be shown.
onPasteRequested callback to get text from ClipBoardManager and paste it. If null, the paste option will not be shown.
onCutRequested callback to cut text and copy the text into ClipBoardManager. If null, the cut option will not be shown.
onSelectAllRequested callback to select all the text content. If null, the select all option will not be shown.

hide

Source set: Common
public fun hide()

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