mirror of
https://github.com/android-password-store/Android-Password-Store
synced 2025-09-01 06:45:19 +00:00
feat(compose): add some multipreview annotations
This commit is contained in:
@@ -24,4 +24,5 @@ dependencies {
|
|||||||
api(libs.compose.material3)
|
api(libs.compose.material3)
|
||||||
api(libs.compose.ui.core)
|
api(libs.compose.ui.core)
|
||||||
implementation(libs.androidx.core.ktx)
|
implementation(libs.androidx.core.ktx)
|
||||||
|
implementation(libs.compose.ui.tooling)
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,22 @@
|
|||||||
|
package app.passwordstore.ui.compose.preview
|
||||||
|
|
||||||
|
import android.content.res.Configuration
|
||||||
|
import androidx.compose.ui.tooling.preview.Preview
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Multipreview annotation that represents light and dark themes. Add this annotation to a
|
||||||
|
* composable to render the both themes.
|
||||||
|
*/
|
||||||
|
@Preview(uiMode = Configuration.UI_MODE_NIGHT_NO, name = "Light theme")
|
||||||
|
@Preview(uiMode = Configuration.UI_MODE_NIGHT_YES, name = "Dark theme")
|
||||||
|
public annotation class ThemePreviews
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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")
|
||||||
|
public annotation class DevicePreviews
|
Reference in New Issue
Block a user