From b7892db59955b8e9a0a320d0a59c08c057f04ea1 Mon Sep 17 00:00:00 2001 From: Kevin Boulongne Date: Thu, 17 Oct 2024 14:14:37 +0200 Subject: [PATCH] feat: Add `@PreviewAllWindows` --- .../swisstransfer/ui/utils/MultiplePreview.kt | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/MultiplePreview.kt b/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/MultiplePreview.kt index 97dbec6b4..19b644a76 100644 --- a/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/MultiplePreview.kt +++ b/app/src/main/java/com/infomaniak/swisstransfer/ui/utils/MultiplePreview.kt @@ -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