ProcessTextKey

Class

Android
class ProcessTextKey
internal constructor(
    /**
     * There can be multiple PROCESS_TEXT items in the context menu and each of them has a different
     * id.
     */
    val id: Int
)

Key for context menu items added for the Android PROCESS_TEXT intent actions. You can use this key to filter the PROCESS_TEXT components by calling Modifier.filterTextContextMenuComponents.

Code Examples

FilterProcessTextItemsInTextContextMenu

@Composable
fun FilterProcessTextItemsInTextContextMenu() {
    val textFieldState = rememberTextFieldState()
    BasicTextField(
        state = textFieldState,
        modifier =
            Modifier.filterTextContextMenuComponents(
                filter = { component -> component.key is ProcessTextKey }
            ),
    )
}