A pattern I'm trying for compose previews ```@Comp...
# compose-wear
y
A pattern I'm trying for compose previews
Copy code
@Composable
fun MyAppThemePreview(
    round: Boolean = true,
    content: @Composable () -> Unit,
) {
    MyAppTheme {
        if (round) {
            Box(Modifier.fillMaxSize().background(Color.White)) {
            }
            Box(modifier = Modifier.fillMaxSize().clip(CircleShape).background(Color.DarkGray)) {
                content()
            }
        } else {
            Box(modifier = Modifier.fillMaxSize().background(Color.DarkGray)) {
                content()
            }
        }
    }
}
👍 2
j
preview doesn't support watch devices?
inside the annotation
y
This just gives it a hard circle border.
message has been deleted
Maybe I'm missing something, but was always a square display for me.
j
I think preview doesnt support wear devices
control click on @Preview annotation, then control click Devices.DEFAULT
and you can see there the devices supported
y
Not sure what lacking without support, obviously device shape and size, but It's useful to have anyway.
Copy code
@Preview(
    widthDp = 300,
    heightDp = 300,
    apiLevel = 26,
    uiMode = Configuration.UI_MODE_TYPE_WATCH,
)
j
We are looking at adding circular device support to studio preview in the future
👍🏻 1
👍 1