Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ import com.example.jetlagged.ui.theme.JetLaggedTheme
import com.example.jetlagged.ui.util.MultiDevicePreview

@OptIn(ExperimentalLayoutApi::class)
@MultiDevicePreview
@Composable
fun JetLaggedScreen(
modifier: Modifier = Modifier,
Expand Down Expand Up @@ -126,3 +125,11 @@ fun JetLaggedScreen(
}
}
}

@MultiDevicePreview
@Composable
private fun JetLaggedScreenPreview() {
JetLaggedTheme {
JetLaggedScreen()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import com.example.jetlagged.ui.theme.JetLaggedTheme
import com.example.jetlagged.ui.theme.SmallHeadingStyle
import com.example.jetlagged.ui.theme.TitleStyle

@Preview
@Composable
fun HeartRateCard(
Comment on lines 41 to 42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Moving the @Preview annotation here and creating a separate preview function is a good way to ensure the composable is rendered with the JetLaggedTheme in the IDE.

modifier: Modifier = Modifier,
Expand Down Expand Up @@ -77,3 +76,11 @@ fun HeartRateCard(
}
}
}

@Preview
@Composable
private fun HeartRateCardPreview() {
JetLaggedTheme {
HeartRateCard()
}
}