RemoteMaterialTheme

Functions summary

Unit
@Composable
@RemoteComposable
RemoteMaterialTheme(
    colorScheme: RemoteColorScheme,
    typography: RemoteTypography,
    shapes: RemoteShapes,
    motionScheme: RemoteMotionScheme,
    content: @RemoteComposable @Composable () -> Unit
)

Material Theming refers to the customization of your Material Design app to better reflect your product’s brand.

Functions

@Composable
@RemoteComposable
fun RemoteMaterialTheme(
    colorScheme: RemoteColorScheme = RemoteMaterialTheme.colorScheme,
    typography: RemoteTypography = RemoteMaterialTheme.typography,
    shapes: RemoteShapes = RemoteMaterialTheme.shapes,
    motionScheme: RemoteMotionScheme = RemoteMaterialTheme.motionScheme,
    content: @RemoteComposable @Composable () -> Unit
): Unit

Material Theming refers to the customization of your Material Design app to better reflect your product’s brand.

Remote Material components such as RemoteButton and RemoteText use values provided here when retrieving default values.

All values may be set by providing this component with the RemoteColorScheme, RemoteShapes, RemoteTypography and RemoteMotionScheme attributes. Use this to configure the overall theme of elements within this RemoteMaterialTheme.

Any values that are not set will inherit the current value from the theme, falling back to the defaults if there is no parent RemoteMaterialTheme. This allows using a RemoteMaterialTheme at the top of your application, and then separate RemoteMaterialThemes for different screens / parts of your UI, overriding only the parts of the theme definition that need to change.

Example of customizing RemoteColorScheme colors within a RemoteMaterialTheme:

import androidx.compose.remote.creation.compose.action.hostAction
import androidx.compose.remote.creation.compose.state.rc
import androidx.compose.remote.creation.compose.state.rs
import androidx.compose.ui.graphics.Color
import androidx.wear.compose.remote.material3.RemoteButton
import androidx.wear.compose.remote.material3.RemoteMaterialTheme
import androidx.wear.compose.remote.material3.RemoteText

val customColors =
    RemoteMaterialTheme.colorScheme.copy(
        primary = Color(0xFF80CBC4).rc,
        onPrimary = Color(0xFF00332C).rc,
    )
RemoteMaterialTheme(colorScheme = customColors) {
    RemoteButton(onClick = hostAction("themed_click".rs), modifier = modifier) {
        RemoteText("Themed Button".rs)
    }
}
Parameters
colorScheme: RemoteColorScheme = RemoteMaterialTheme.colorScheme

A complete definition of the Material Color theme for this hierarchy

typography: RemoteTypography = RemoteMaterialTheme.typography

A set of text styles to be used as this hierarchy's typography system

shapes: RemoteShapes = RemoteMaterialTheme.shapes

A set of shapes to be used as this hierarchy's shape system

motionScheme: RemoteMotionScheme = RemoteMaterialTheme.motionScheme

A set of motion specs used to animate content for this hierarchy

content: @RemoteComposable @Composable () -> Unit

The content inheriting this theme