Skip to content

Commit

Permalink
Merge pull request #745 from koji-1009/improve_previews
Browse files Browse the repository at this point in the history
Rearrange preview annotation
  • Loading branch information
takahirom authored Oct 21, 2021
2 parents ba561d8 + 415cab2 commit e6e9981
Showing 1 changed file with 2 additions and 62 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -621,79 +621,19 @@ private val TimetableCategory.iconResId: Int
// region default preview

@Preview
@Composable
fun PreviewTimetableDetailScreen() {
AppThemeWithBackground {
CompositionLocalProvider(
provideTimetableDetailViewModelFactory { fakeTimetableDetailViewModel() },
) {
TimetableDetailScreen(
id = TimetableItemId("2"),
onNavigationIconClick = {},
)
}
}
}

// endregion

// region optional preview

@Preview(widthDp = 360)
@Composable
fun PreviewSmallTimetableDetailScreen() {
AppThemeWithBackground {
CompositionLocalProvider(
provideTimetableDetailViewModelFactory { fakeTimetableDetailViewModel() },
) {
TimetableDetailScreen(
id = TimetableItemId("2"),
onNavigationIconClick = {}
)
}
}
}

@Preview(device = Devices.NEXUS_7_2013)
@Composable
fun PreviewTabletTimetableDetailScreen() {
AppThemeWithBackground {
CompositionLocalProvider(
provideTimetableDetailViewModelFactory { fakeTimetableDetailViewModel() },
) {
TimetableDetailScreen(
id = TimetableItemId("2"),
onNavigationIconClick = {}
)
}
}
}

@Preview(device = Devices.NEXUS_10)
@Composable
fun PreviewLargeTabletTimetableDetailScreen() {
AppThemeWithBackground {
CompositionLocalProvider(
provideTimetableDetailViewModelFactory { fakeTimetableDetailViewModel() },
) {
TimetableDetailScreen(
id = TimetableItemId("2"),
onNavigationIconClick = {}
)
}
}
}

@Preview(showBackground = true, uiMode = Configuration.UI_MODE_NIGHT_YES)
@Composable
fun PreviewDarkTimetableDetailScreen() {
fun PreviewTimetableDetailScreen() {
AppThemeWithBackground {
CompositionLocalProvider(
provideTimetableDetailViewModelFactory { fakeTimetableDetailViewModel() },
) {
TimetableDetailScreen(
id = TimetableItemId("2"),
onNavigationIconClick = {}
onNavigationIconClick = {},
)
}
}
Expand Down

0 comments on commit e6e9981

Please sign in to comment.