-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Refactor: Create PreviewThemeColorsSizes annotation
Created a new annotation `PreviewThemeColorsSizes` to combine `PreviewDynamicColors` and `PreviewScreen Sizes` for easier use in previews. This annotation also includes previews with different dynamic color wallpapers and dark mode.
- Loading branch information
jacobrein
committed
Sep 12, 2024
1 parent
a7cbd5b
commit eee2d77
Showing
3 changed files
with
25 additions
and
3 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
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
21 changes: 21 additions & 0 deletions
21
UIViews/src/main/java/com/programmersbox/uiviews/utils/ComposableWorkArounds.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 |
---|---|---|
@@ -1,2 +1,23 @@ | ||
package com.programmersbox.uiviews.utils | ||
|
||
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 | ||
import androidx.compose.ui.tooling.preview.PreviewLightDark | ||
import androidx.compose.ui.tooling.preview.PreviewScreenSizes | ||
import androidx.compose.ui.tooling.preview.Wallpapers.BLUE_DOMINATED_EXAMPLE | ||
import androidx.compose.ui.tooling.preview.Wallpapers.GREEN_DOMINATED_EXAMPLE | ||
import androidx.compose.ui.tooling.preview.Wallpapers.RED_DOMINATED_EXAMPLE | ||
import androidx.compose.ui.tooling.preview.Wallpapers.YELLOW_DOMINATED_EXAMPLE | ||
|
||
@PreviewLightDark | ||
@Preview(name = "Red", wallpaper = RED_DOMINATED_EXAMPLE, group = "dynamic_colors") | ||
@Preview(name = "Blue", wallpaper = BLUE_DOMINATED_EXAMPLE, group = "dynamic_colors") | ||
@Preview(name = "Green", wallpaper = GREEN_DOMINATED_EXAMPLE, group = "dynamic_colors") | ||
@Preview(name = "Yellow", wallpaper = YELLOW_DOMINATED_EXAMPLE, group = "dynamic_colors") | ||
@Preview(name = "Red Dark", wallpaper = RED_DOMINATED_EXAMPLE, uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, group = "dynamic_colors") | ||
@Preview(name = "Blue Dark", wallpaper = BLUE_DOMINATED_EXAMPLE, uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, group = "dynamic_colors") | ||
@Preview(name = "Green Dark", wallpaper = GREEN_DOMINATED_EXAMPLE, uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, group = "dynamic_colors") | ||
@Preview(name = "Yellow Dark", wallpaper = YELLOW_DOMINATED_EXAMPLE, uiMode = UI_MODE_NIGHT_YES or UI_MODE_TYPE_NORMAL, group = "dynamic_colors") | ||
@PreviewScreenSizes | ||
annotation class PreviewThemeColorsSizes |