feat: updates DevicePreviews.kt to use Devices constants

adaptive-previews-device-classes
Eric Schmidt 6 months ago
parent c5b604f72e
commit 5916a4c923

@ -17,13 +17,14 @@
package com.google.samples.apps.nowinandroid.core.ui
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.Devices
/**
* Multipreview annotation that represents various device sizes. Add this annotation to a composable
* to render various devices.
*/
@Preview(name = "phone", device = "spec:shape=Normal,width=360,height=640,unit=dp,dpi=480")
@Preview(name = "landscape", device = "spec:shape=Normal,width=640,height=360,unit=dp,dpi=480")
@Preview(name = "foldable", device = "spec:shape=Normal,width=673,height=841,unit=dp,dpi=480")
@Preview(name = "tablet", device = "spec:shape=Normal,width=1280,height=800,unit=dp,dpi=480")
@Preview(showBackground = true, name = "phone", device = Devices.PHONE)
@Preview(showBackground = true, name = "desktop", device = Devices.DESKTOP)
@Preview(showBackground = true, name = "foldable", device = Devices.FOLDABLE)
@Preview(showBackground = true, name = "tablet", device = Devices.TABLET)
annotation class DevicePreviews

Loading…
Cancel
Save