Skip to content

Commit

Permalink
feat: Add @PreviewAllWindows
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinBoulongne committed Oct 17, 2024
1 parent 960d8b0 commit b7892db
Showing 1 changed file with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,48 @@ annotation class PreviewSmallWindow
device = "spec:id=reference_tablet,shape=Normal,width=1280,height=800,unit=dp,dpi=240",
)
annotation class PreviewLargeWindow

// Small + Large
@Preview(
name = "(1) Small window portrait light",
group = "SmallWindow",
)
@Preview(
name = "(2) Small window portrait dark",
group = "SmallWindow",
uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL,
)
@Preview(
name = "(3) Small window landscape light",
group = "SmallWindow",
device = "spec:parent=pixel_5,orientation=landscape",
)
@Preview(
name = "(4) Small window landscape dark",
group = "SmallWindow",
uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL,
device = "spec:parent=pixel_5,orientation=landscape",
)
@Preview(
name = "(1) Large window portrait light",
group = "LargeWindow",
device = "spec:width=1280dp,height=800dp,dpi=240,orientation=portrait",
)
@Preview(
name = "(2) Large window portrait dark",
group = "LargeWindow",
uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL,
device = "spec:width=1280dp,height=800dp,dpi=240,orientation=portrait",
)
@Preview(
name = "(3) Large window landscape light",
group = "LargeWindow",
device = "spec:id=reference_tablet,shape=Normal,width=1280,height=800,unit=dp,dpi=240",
)
@Preview(
name = "(4) Large window landscape dark",
group = "LargeWindow",
uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL,
device = "spec:id=reference_tablet,shape=Normal,width=1280,height=800,unit=dp,dpi=240",
)
annotation class PreviewAllWindows

0 comments on commit b7892db

Please sign in to comment.