Skip to content

Instantly share code, notes, and snippets.

@alorma
Last active March 19, 2024 14:48
Show Gist options
  • Save alorma/1f96b83689a8274a150110be1b691b06 to your computer and use it in GitHub Desktop.
Save alorma/1f96b83689a8274a150110be1b691b06 to your computer and use it in GitHub Desktop.
import android.content.res.Configuration
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.Wallpapers
@Retention(AnnotationRetention.BINARY)
@Target(
AnnotationTarget.ANNOTATION_CLASS,
AnnotationTarget.FUNCTION
)
@Preview(
apiLevel = 33,
name = "Light - No dynamic",
wallpaper = Wallpapers.NONE,
)
@Preview(
apiLevel = 33,
name = "Light - Red",
wallpaper = Wallpapers.RED_DOMINATED_EXAMPLE,
)
@Preview(
apiLevel = 33,
name = "Light - Blue",
wallpaper = Wallpapers.BLUE_DOMINATED_EXAMPLE,
)
@Preview(
apiLevel = 33,
name = "Light - Green",
wallpaper = Wallpapers.GREEN_DOMINATED_EXAMPLE,
)
@Preview(
apiLevel = 33,
name = "Light - Yellow",
wallpaper = Wallpapers.YELLOW_DOMINATED_EXAMPLE,
)
@Preview(
apiLevel = 33,
name = "Dark - No dynamic",
wallpaper = Wallpapers.NONE,
uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL
)
@Preview(
apiLevel = 33,
name = "Dark - Red",
wallpaper = Wallpapers.RED_DOMINATED_EXAMPLE,
uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL
)
@Preview(
apiLevel = 33,
name = "Dark - Blue",
wallpaper = Wallpapers.BLUE_DOMINATED_EXAMPLE,
uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL
)
@Preview(
apiLevel = 33,
name = "Dark - Green",
wallpaper = Wallpapers.GREEN_DOMINATED_EXAMPLE,
uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL
)
@Preview(
apiLevel = 33,
name = "Dark - Yellow",
wallpaper = Wallpapers.YELLOW_DOMINATED_EXAMPLE,
uiMode = Configuration.UI_MODE_NIGHT_YES or Configuration.UI_MODE_TYPE_NORMAL
)
annotation class SuperPreview
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment