WearableRemoteInputExtender


class WearableRemoteInputExtender


Extender for Wear-specific extras for a RemoteInput instance.

For example, to create a RemoteInput that will allow free form input (e.g. voice input on Wear), but not show the Draw Emoji option:

import androidx.wear.input.wearableExtender

RemoteInput.Builder("resultKey")
    .setAllowFreeFormInput(true)
    .wearableExtender {
        disallowEmoji()
        setInputActionType(EditorInfo.IME_ACTION_GO)
    }.build()

Summary

Public constructors

Public functions

RemoteInput.Builder
get()

Returns the RemoteInput.Builder with set options.

WearableRemoteInputExtender
setEmojisAllowed(emojisAllowed: Boolean)

Adding extra to a RemoteInput for allowing or disallowing showing emoji-only options (e.g. the Draw Emoji option).

WearableRemoteInputExtender
setInputActionType(imeActionType: Int)

Adding specified input action type to a RemoteInput to modify the action type of the RemoteInput session (e.g. "send" or "search").

Public constructors

WearableRemoteInputExtender

Added in 1.2.0-alpha03
WearableRemoteInputExtender(remoteInput: RemoteInput.Builder)

Public functions

get

Added in 1.2.0-alpha03
fun get(): RemoteInput.Builder

Returns the RemoteInput.Builder with set options.

setEmojisAllowed

Added in 1.2.0-alpha03
fun setEmojisAllowed(emojisAllowed: Boolean): WearableRemoteInputExtender

Adding extra to a RemoteInput for allowing or disallowing showing emoji-only options (e.g. the Draw Emoji option).

If set to false, the Draw Emoji option will not be shown. If set to true or not set, the Draw Emoji option will be shown as long as the RemoteInput allows free form input.

Parameters
emojisAllowed: Boolean

Whether the emoji-only options is shown. If not set, it will be allowed.

setInputActionType

Added in 1.2.0-alpha03
fun setInputActionType(imeActionType: Int): WearableRemoteInputExtender

Adding specified input action type to a RemoteInput to modify the action type of the RemoteInput session (e.g. "send" or "search"). The default action type is "send."

Parameters
imeActionType: Int

Action type to be set on RemoteInput session. Should be one of the following values: EditorInfo.IME_ACTION_SEND, EditorInfo.IME_ACTION_SEARCH, EditorInfo.IME_ACTION_DONE, EditorInfo.IME_ACTION_GO. If not, send action will be set.