WearPreviewFontScales

@<Error class: unknown class>
annotation WearPreviewFontScales


WearPreviewFontScales is a multi-preview annotation for the Wear devices of following font scales

  • Fonts - Small: 0.94f
  • Fonts - Normal: 1f
  • Fonts - Medium: 1.06f
  • Fonts - Large: 1.12f
  • Fonts - Larger: 1.18f
  • Fonts - Largest: 1.24f

Font scales represent the scaling factor for fonts, relative to the base density scaling. Please note, the above list is not exhaustive. It previews the composables on a small round Wear device.

import androidx.compose.ui.res.painterResource
import androidx.wear.compose.material.CardDefaults
import androidx.wear.compose.material.MaterialTheme
import androidx.wear.compose.material.Text
import androidx.wear.compose.material.TitleCard

TitleCard(
    onClick = { /* Do something */ },
    title = { Text("TitleCard With an ImageBackground") },
    backgroundPainter =
        CardDefaults.imageWithScrimBackgroundPainter(
            backgroundImagePainter = painterResource(id = R.drawable.backgroundimage)
        ),
    contentColor = MaterialTheme.colors.onSurface,
    titleColor = MaterialTheme.colors.onSurface,
) {
    Text("Text coloured to stand out on the image")
}

Summary

Public constructors

Public constructors

WearPreviewFontScales

WearPreviewFontScales()