RemoteTextButtonDefaults

object RemoteTextButtonDefaults


Contains the default values used by RemoteTextButton.

Summary

Public functions

RemoteTextButtonShapes

Returns a RemoteTextButtonShapes with an animation between two RemoteCornerBasedShapes when pressed.

RemoteTextButtonColors

Returns a RemoteTextButtonColors for a filled tonal RemoteTextButton - by default, a muted colored background with a contrasting content color.

RemoteTextButtonColors
@Composable
@RemoteComposable
filledTonalTextButtonColors(
    containerColor: RemoteColor?,
    contentColor: RemoteColor?,
    disabledContainerColor: RemoteColor?,
    disabledContentColor: RemoteColor?
)

Returns a RemoteTextButtonColors for a filled tonal RemoteTextButton - by default, a muted colored background with a contrasting content color.

RemoteTextButtonShapes

Returns the default RemoteTextButtonShapes for a static RemoteTextButton.

RemoteTextButtonShapes

Returns a RemoteTextButtonShapes for a static RemoteTextButton.

RemoteTextButtonColors

Returns a RemoteTextButtonColors for a text button - by default, a transparent background with contrasting content color.

RemoteTextButtonColors
@Composable
@RemoteComposable
textButtonColors(
    containerColor: RemoteColor?,
    contentColor: RemoteColor?,
    disabledContainerColor: RemoteColor?,
    disabledContentColor: RemoteColor?
)

Returns a RemoteTextButtonColors for a text button - by default, a transparent background with contrasting content color.

Public properties

RemoteDp

The default size applied for buttons.

RemoteDp

The recommended size for a large button.

RemoteDp

The recommended size for a small button.

RemoteTextStyle

The default text style applied for buttons.

RemoteTextStyle

The recommended text style for a large button.

RemoteCornerBasedShape

Recommended pressed RemoteShape for RemoteTextButton.

RemoteRoundedCornerShape

Recommended RemoteShape for RemoteTextButton.

RemoteTextStyle

The recommended text style for a small button.

Public functions

animatedShapes

Added in 1.0.0-alpha16
@Composable
@RemoteComposable
fun animatedShapes(
    shape: RemoteCornerBasedShape = this.shape,
    pressedShape: RemoteCornerBasedShape = this.pressedShape
): RemoteTextButtonShapes

Returns a RemoteTextButtonShapes with an animation between two RemoteCornerBasedShapes when pressed.

The press animation requires both shapes to be RemoteRoundedCornerShapes. It is driven by touch events on the player, and is not shown by players that don't dispatch them.

Example of a text button animated when pressed:

import androidx.compose.remote.creation.compose.action.hostAction
import androidx.compose.remote.creation.compose.state.rf
import androidx.compose.remote.creation.compose.state.rs
import androidx.wear.compose.remote.material3.RemoteMaterialTheme
import androidx.wear.compose.remote.material3.RemoteText
import androidx.wear.compose.remote.material3.RemoteTextButton
import androidx.wear.compose.remote.material3.RemoteTextButtonDefaults

RemoteTextButton(
    onClick = hostAction("button_click".rs),
    modifier = modifier,
    shapes = RemoteTextButtonDefaults.animatedShapes(),
    colors =
        RemoteTextButtonDefaults.textButtonColors(
            containerColor = RemoteMaterialTheme.colorScheme.primary,
            contentColor = RemoteMaterialTheme.colorScheme.onPrimary,
            disabledContainerColor =
                RemoteMaterialTheme.colorScheme.primary.copy(alpha = 0.12f.rf),
            disabledContentColor = RemoteMaterialTheme.colorScheme.primary.copy(0.38f.rf),
        ),
) {
    RemoteText(text = "ABC".rs)
}
Parameters
shape: RemoteCornerBasedShape = this.shape

The normal shape of the RemoteTextButton.

pressedShape: RemoteCornerBasedShape = this.pressedShape

The pressed shape of the RemoteTextButton.

Returns
RemoteTextButtonShapes

a RemoteTextButtonShapes with the configured resting and pressed shapes

filledTonalTextButtonColors

Added in 1.0.0-alpha16
@Composable
@RemoteComposable
fun filledTonalTextButtonColors(): RemoteTextButtonColors

Returns a RemoteTextButtonColors for a filled tonal RemoteTextButton - by default, a muted colored background with a contrasting content color. If the button is disabled then the colors default to RemoteColorScheme.onSurface with suitable alpha values applied.

Example of a RemoteTextButton with filledTonalTextButtonColors:

import androidx.compose.remote.creation.compose.action.valueChangeAction
import androidx.compose.remote.creation.compose.state.MutableRemoteInt
import androidx.compose.remote.creation.compose.state.rs
import androidx.compose.runtime.remember
import androidx.wear.compose.remote.material3.RemoteText
import androidx.wear.compose.remote.material3.RemoteTextButton
import androidx.wear.compose.remote.material3.RemoteTextButtonDefaults

val tapCount = remember { MutableRemoteInt(0) }
val text = "+".rs + tapCount.toRemoteString()

RemoteTextButton(
    onClick = valueChangeAction(tapCount, tapCount + 1),
    modifier = modifier,
    colors = RemoteTextButtonDefaults.filledTonalTextButtonColors(),
) {
    RemoteText(text = text)
}

filledTonalTextButtonColors

Added in 1.0.0-alpha16
@Composable
@RemoteComposable
fun filledTonalTextButtonColors(
    containerColor: RemoteColor? = null,
    contentColor: RemoteColor? = null,
    disabledContainerColor: RemoteColor? = null,
    disabledContentColor: RemoteColor? = null
): RemoteTextButtonColors

Returns a RemoteTextButtonColors for a filled tonal RemoteTextButton - by default, a muted colored background with a contrasting content color. If the button is disabled then the colors default to RemoteColorScheme.onSurface with suitable alpha values applied.

Example of a RemoteTextButton with filledTonalTextButtonColors:

import androidx.compose.remote.creation.compose.action.valueChangeAction
import androidx.compose.remote.creation.compose.state.MutableRemoteInt
import androidx.compose.remote.creation.compose.state.rs
import androidx.compose.runtime.remember
import androidx.wear.compose.remote.material3.RemoteText
import androidx.wear.compose.remote.material3.RemoteTextButton
import androidx.wear.compose.remote.material3.RemoteTextButtonDefaults

val tapCount = remember { MutableRemoteInt(0) }
val text = "+".rs + tapCount.toRemoteString()

RemoteTextButton(
    onClick = valueChangeAction(tapCount, tapCount + 1),
    modifier = modifier,
    colors = RemoteTextButtonDefaults.filledTonalTextButtonColors(),
) {
    RemoteText(text = text)
}
Parameters
containerColor: RemoteColor? = null

the background color of this text button when enabled, or null to use the default (RemoteColorScheme.surfaceContainer).

contentColor: RemoteColor? = null

the content color of this text button when enabled, or null to use the default (RemoteColorScheme.onSurface).

disabledContainerColor: RemoteColor? = null

the background color of this text button when not enabled, or null to use the default (RemoteColorScheme.onSurface with 12% opacity).

disabledContentColor: RemoteColor? = null

the content color of this text button when not enabled, or null to use the default (RemoteColorScheme.onSurface with 38% opacity).

shapes

Added in 1.0.0-alpha16
@Composable
@RemoteComposable
fun shapes(): RemoteTextButtonShapes

Returns the default RemoteTextButtonShapes for a static RemoteTextButton.

Returns
RemoteTextButtonShapes

a RemoteTextButtonShapes with the default static shape

shapes

Added in 1.0.0-alpha16
@Composable
@RemoteComposable
fun shapes(shape: RemoteShape): RemoteTextButtonShapes

Returns a RemoteTextButtonShapes for a static RemoteTextButton.

Parameters
shape: RemoteShape

The normal shape of the RemoteTextButton.

Returns
RemoteTextButtonShapes

a RemoteTextButtonShapes with the given static shape

textButtonColors

Added in 1.0.0-alpha16
@Composable
@RemoteComposable
fun textButtonColors(): RemoteTextButtonColors

Returns a RemoteTextButtonColors for a text button - by default, a transparent background with contrasting content color. If the button is disabled then the colors default to RemoteColorScheme.onSurface with suitable alpha values applied.

Returns
RemoteTextButtonColors

a RemoteTextButtonColors with the default colors for a RemoteTextButton

textButtonColors

Added in 1.0.0-alpha16
@Composable
@RemoteComposable
fun textButtonColors(
    containerColor: RemoteColor? = null,
    contentColor: RemoteColor? = null,
    disabledContainerColor: RemoteColor? = null,
    disabledContentColor: RemoteColor? = null
): RemoteTextButtonColors

Returns a RemoteTextButtonColors for a text button - by default, a transparent background with contrasting content color. If the button is disabled then the colors default to RemoteColorScheme.onSurface with suitable alpha values applied.

Parameters
containerColor: RemoteColor? = null

The background color of this text button when enabled, or null to use the theme default.

contentColor: RemoteColor? = null

The content color of this text button when enabled, or null to use the theme default.

disabledContainerColor: RemoteColor? = null

The background color of this text button when not enabled, or null to use the theme default.

disabledContentColor: RemoteColor? = null

The content color of this text button when not enabled, or null to use the theme default.

Returns
RemoteTextButtonColors

a RemoteTextButtonColors with the configured colors for a RemoteTextButton

Public properties

DefaultButtonSize

Added in 1.0.0-alpha16
val DefaultButtonSize: RemoteDp

The default size applied for buttons.

LargeButtonSize

Added in 1.0.0-alpha16
val LargeButtonSize: RemoteDp

The recommended size for a large button.

SmallButtonSize

Added in 1.0.0-alpha16
val SmallButtonSize: RemoteDp

The recommended size for a small button.

defaultButtonTextStyle

val defaultButtonTextStyle: RemoteTextStyle

The default text style applied for buttons.

largeButtonTextStyle

val largeButtonTextStyle: RemoteTextStyle

The recommended text style for a large button.

pressedShape

val pressedShape: RemoteCornerBasedShape

Recommended pressed RemoteShape for RemoteTextButton.

smallButtonTextStyle

val smallButtonTextStyle: RemoteTextStyle

The recommended text style for a small button.