-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
UI: Add multipreview annotation ComponentPreviewLightDark (#70)
- Loading branch information
1 parent
2cea9e9
commit d9d8f4b
Showing
2 changed files
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...system/src/main/kotlin/xyz/ksharma/krail/design/system/preview/MultiPreviewAnnotations.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package xyz.ksharma.krail.design.system.preview | ||
|
||
import android.content.res.Configuration.UI_MODE_NIGHT_YES | ||
import android.content.res.Configuration.UI_MODE_TYPE_NORMAL | ||
import androidx.compose.ui.tooling.preview.Preview | ||
|
||
/** | ||
* A MultiPreview annotation for displaying a component using light and dark themes. | ||
*/ | ||
@Retention(AnnotationRetention.BINARY) | ||
@Target( | ||
AnnotationTarget.ANNOTATION_CLASS, | ||
AnnotationTarget.FUNCTION | ||
) | ||
@Preview(name = "Light", showBackground = true) | ||
@Preview(name = "Dark", uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, showBackground = true) | ||
annotation class ComponentPreviewLightDark |