RemoteTextButtonSimpleSample
@Sampled
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
fun RemoteTextButtonSimpleSample(modifier: RemoteModifier = RemoteModifier) {
val tapCount = remember { MutableRemoteInt(0) }
val text = "+".rs + tapCount.toRemoteString()
RemoteTextButton(
onClick = valueChangeAction(tapCount, tapCount + 1),
modifier = modifier,
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 = text)
}
}
RemoteFilledTonalTextButtonSample
@Sampled
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
fun RemoteFilledTonalTextButtonSample(modifier: RemoteModifier = RemoteModifier) {
val tapCount = remember { MutableRemoteInt(0) }
val text = "+".rs + tapCount.toRemoteString()
RemoteTextButton(
onClick = valueChangeAction(tapCount, tapCount + 1),
modifier = modifier,
colors = RemoteTextButtonDefaults.filledTonalTextButtonColors(),
) {
RemoteText(text = text)
}
}
RemoteTextButtonWithCornerAnimationSample
@Sampled
@RemoteComposable
@Composable
@WearPreviewDevices
@PreviewWrapper(RemoteComponentPreviewWrapper::class)
fun RemoteTextButtonWithCornerAnimationSample(modifier: RemoteModifier = RemoteModifier) {
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)
}
}