diff --git a/config/images/1.png b/config/images/1.png new file mode 100644 index 000000000..237c9328e Binary files /dev/null and b/config/images/1.png differ diff --git a/config/images/2.png b/config/images/2.png new file mode 100644 index 000000000..727645f8c Binary files /dev/null and b/config/images/2.png differ diff --git a/config/images/6.png b/config/images/6.png new file mode 100644 index 000000000..3ca59145e Binary files /dev/null and b/config/images/6.png differ diff --git a/core/common/src/main/kotlin/org/michaelbel/movies/common/theme/AppTheme.kt b/core/common/src/main/kotlin/org/michaelbel/movies/common/theme/AppTheme.kt index ad4033b57..fa91ba7e1 100644 --- a/core/common/src/main/kotlin/org/michaelbel/movies/common/theme/AppTheme.kt +++ b/core/common/src/main/kotlin/org/michaelbel/movies/common/theme/AppTheme.kt @@ -10,11 +10,14 @@ sealed interface AppTheme { data object FollowSystem: AppTheme + data object Amoled: AppTheme + companion object { val VALUES: List = listOf( NightNo, NightYes, - FollowSystem + FollowSystem, + Amoled ) fun transform(name: String): AppTheme { @@ -22,6 +25,7 @@ sealed interface AppTheme { NightNo.toString() -> NightNo NightYes.toString() -> NightYes FollowSystem.toString() -> FollowSystem + Amoled.toString() -> Amoled else -> throw InvalidThemeException } } diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/ApiKeyBox.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/ApiKeyBox.kt index 538dfe21b..38f24986c 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/ApiKeyBox.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/ApiKeyBox.kt @@ -11,9 +11,11 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import org.michaelbel.movies.ui.R import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -28,7 +30,7 @@ fun ApiKeyBox( Text( text = stringResource(R.string.error_api_key_null), style = MaterialTheme.typography.bodyLarge.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) } @@ -42,7 +44,20 @@ private fun ApiKeyBoxPreview() { modifier = Modifier .fillMaxWidth() .padding(vertical = 16.dp) - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun ApiKeyBoxAmoledPreview() { + AmoledTheme { + ApiKeyBox( + modifier = Modifier + .fillMaxWidth() + .padding(vertical = 16.dp) + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/NotificationBottomSheet.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/NotificationBottomSheet.kt index df4a2b05e..ca0d78245 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/NotificationBottomSheet.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/NotificationBottomSheet.kt @@ -21,6 +21,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -33,12 +34,14 @@ import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import org.michaelbel.movies.ui.R import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.ktx.appNotificationSettingsIntent import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -96,8 +99,8 @@ fun NotificationBottomSheet( contentDescription = MoviesContentDescription.None, modifier = Modifier.graphicsLayer( transformOrigin = TransformOrigin( - pivotFractionX = 0.5f, - pivotFractionY = 0.0f, + pivotFractionX = 0.5F, + pivotFractionY = 0.0F, ), rotationZ = value ), @@ -110,7 +113,7 @@ fun NotificationBottomSheet( modifier = Modifier.padding(start = 16.dp, top = 16.dp, end = 16.dp), textAlign = TextAlign.Center, style = MaterialTheme.typography.titleLarge.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) @@ -119,7 +122,7 @@ fun NotificationBottomSheet( modifier = Modifier.padding(start = 16.dp, top = 8.dp, end = 16.dp), textAlign = TextAlign.Center, style = MaterialTheme.typography.bodyMedium.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) @@ -135,6 +138,9 @@ fun NotificationBottomSheet( } } }, + colors = ButtonDefaults.buttonColors( + containerColor = MaterialTheme.colorScheme.surfaceTint + ), modifier = Modifier.padding(top = 16.dp, bottom = 32.dp) ) { Text( @@ -149,7 +155,22 @@ fun NotificationBottomSheet( private fun NotificationBottomSheetPreview() { MoviesTheme { NotificationBottomSheet( - modifier = Modifier.fillMaxWidth(), + modifier = Modifier + .fillMaxWidth() + .background(MaterialTheme.colorScheme.primaryContainer), + onBottomSheetHide = {} + ) + } +} + +@Composable +@Preview +private fun NotificationBottomSheetAmoledPreview() { + AmoledTheme { + NotificationBottomSheet( + modifier = Modifier + .fillMaxWidth() + .background(MaterialTheme.colorScheme.primaryContainer), onBottomSheetHide = {} ) } diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/BackIcon.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/BackIcon.kt index b641bc07f..aebdc9b91 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/BackIcon.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/BackIcon.kt @@ -8,9 +8,11 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -36,7 +38,18 @@ private fun BackIconPreview() { MoviesTheme { BackIcon( onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.background) + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun BackIconAmoledPreview() { + AmoledTheme { + BackIcon( + onClick = {}, + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/CloseIcon.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/CloseIcon.kt index 6c3dcbc8e..e5ece4e02 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/CloseIcon.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/CloseIcon.kt @@ -8,9 +8,11 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -36,7 +38,18 @@ private fun CloseIconPreview() { MoviesTheme { CloseIcon( onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.background) + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun CloseIconAmoledPreview() { + AmoledTheme { + CloseIcon( + onClick = {}, + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/DownloadIcon.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/DownloadIcon.kt index 6e5eec40e..fa974b7a4 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/DownloadIcon.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/DownloadIcon.kt @@ -8,9 +8,11 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -36,7 +38,18 @@ fun DownloadIconPreview() { MoviesTheme { DownloadIcon( onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.background) + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun DownloadIconAmoledPreview() { + AmoledTheme { + DownloadIcon( + onClick = {}, + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/PasswordIcon.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/PasswordIcon.kt index 8c6f14766..8364f9423 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/PasswordIcon.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/PasswordIcon.kt @@ -1,17 +1,20 @@ package org.michaelbel.movies.ui.compose.iconbutton +import androidx.compose.foundation.Image import androidx.compose.foundation.background -import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.BooleanPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -24,9 +27,10 @@ fun PasswordIcon( onClick = onClick, modifier = modifier ) { - Icon( + Image( imageVector = if (state) MoviesIcons.Visibility else MoviesIcons.VisibilityOff, - contentDescription = stringResource(if (state) MoviesContentDescription.PasswordIcon else MoviesContentDescription.PasswordOffIcon) + contentDescription = stringResource(if (state) MoviesContentDescription.PasswordIcon else MoviesContentDescription.PasswordOffIcon), + colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onPrimaryContainer) ) } } @@ -40,7 +44,21 @@ private fun PasswordIconPreview( PasswordIcon( state = state, onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.background) + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun PasswordIconAmoledPreview( + @PreviewParameter(BooleanPreviewParameterProvider::class) state: Boolean +) { + AmoledTheme { + PasswordIcon( + state = state, + onClick = {}, + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SearchIcon.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SearchIcon.kt index 615a75b51..248379cc7 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SearchIcon.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SearchIcon.kt @@ -8,9 +8,11 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -36,7 +38,18 @@ private fun SearchIconPreview() { MoviesTheme { SearchIcon( onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.background) + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun SearchIconAmoledPreview() { + AmoledTheme { + SearchIcon( + onClick = {}, + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SettingsIcon.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SettingsIcon.kt index 74e3dd399..39aadf4a1 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SettingsIcon.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SettingsIcon.kt @@ -8,9 +8,11 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -36,7 +38,18 @@ private fun SettingsIconPreview() { MoviesTheme { SettingsIcon( onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.background) + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun SettingsIconAmoledPreview() { + AmoledTheme { + SettingsIcon( + onClick = {}, + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/ShareIcon.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/ShareIcon.kt index 781450066..eb9f8f7e0 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/ShareIcon.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/ShareIcon.kt @@ -13,6 +13,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import org.michaelbel.movies.persistence.database.entity.MovieDb import org.michaelbel.movies.persistence.database.ktx.url @@ -21,6 +22,7 @@ import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.MovieDbPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -63,7 +65,20 @@ private fun ShareIconPreview( MoviesTheme { ShareIcon( url = movie.url, - modifier = Modifier.background(MaterialTheme.colorScheme.background) + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun ShareIconAmoledPreview( + @PreviewParameter(MovieDbPreviewParameterProvider::class) movie: MovieDb +) { + AmoledTheme { + ShareIcon( + url = movie.url, + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/UpdateIcon.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/UpdateIcon.kt index 569ad8a89..4d934bfce 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/UpdateIcon.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/UpdateIcon.kt @@ -8,9 +8,11 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -36,7 +38,18 @@ private fun UpdateIconPreview() { MoviesTheme { UpdateIcon( onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.background) + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun UpdateIconAmoledPreview() { + AmoledTheme { + UpdateIcon( + onClick = {}, + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/VoiceIcon.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/VoiceIcon.kt index 7c342256c..e8c113efa 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/VoiceIcon.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/iconbutton/VoiceIcon.kt @@ -12,9 +12,11 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -63,7 +65,18 @@ fun VoiceIconPreview() { MoviesTheme { VoiceIcon( onInputText = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.background) + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +fun VoiceIconAmoledPreview() { + AmoledTheme { + VoiceIcon( + onInputText = {}, + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumn.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumn.kt index e13bc635a..d04236038 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumn.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumn.kt @@ -17,6 +17,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout @@ -31,6 +32,7 @@ import org.michaelbel.movies.ui.ktx.context import org.michaelbel.movies.ui.ktx.isErrorOrEmpty import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.MoviePreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -118,4 +120,21 @@ private fun MovieColumnPreview( .background(MaterialTheme.colorScheme.inversePrimary) ) } +} + +@Composable +@Preview +private fun MovieColumnAmoledPreview( + @PreviewParameter(MoviePreviewParameterProvider::class) movie: MovieDb +) { + AmoledTheme { + MovieColumn( + movie = movie, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 16.dp, vertical = 4.dp) + .clip(MaterialTheme.shapes.small) + .background(MaterialTheme.colorScheme.inversePrimary) + ) + } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRow.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRow.kt index 27324ad26..a7529a9b1 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRow.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRow.kt @@ -17,6 +17,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout @@ -31,6 +32,7 @@ import org.michaelbel.movies.ui.ktx.context import org.michaelbel.movies.ui.ktx.isErrorOrEmpty import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.MoviePreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -119,4 +121,21 @@ private fun MovieRowPreview( .background(MaterialTheme.colorScheme.inversePrimary) ) } +} + +@Composable +@Preview +private fun MovieRowAmoledPreview( + @PreviewParameter(MoviePreviewParameterProvider::class) movie: MovieDb +) { + AmoledTheme { + MovieRow( + movie = movie, + modifier = Modifier + .fillMaxWidth() + .padding(horizontal = 16.dp, vertical = 4.dp) + .clip(MaterialTheme.shapes.small) + .background(MaterialTheme.colorScheme.inversePrimary) + ) + } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.kt index ad73d671b..6027eef80 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.kt @@ -15,6 +15,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension @@ -22,6 +23,7 @@ import org.michaelbel.movies.ui.R import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -66,7 +68,7 @@ fun PageFailure( }, textAlign = TextAlign.Center, style = MaterialTheme.typography.bodyMedium.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) @@ -96,7 +98,19 @@ private fun PageFailurePreview() { PageFailure( modifier = Modifier .fillMaxSize() - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun PageFailureAmoledPreview() { + AmoledTheme { + PageFailure( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.kt index ecdf6b83d..e9de70aa5 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.kt @@ -14,6 +14,7 @@ import androidx.compose.foundation.lazy.staggeredgrid.StaggeredGridCells import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import org.michaelbel.movies.common.appearance.FeedView import org.michaelbel.movies.network.model.MovieResponse @@ -25,9 +26,12 @@ import org.michaelbel.movies.ui.ktx.isPortrait import org.michaelbel.movies.ui.placeholder.PlaceholderHighlight import org.michaelbel.movies.ui.placeholder.material3.fade import org.michaelbel.movies.ui.placeholder.placeholder +import org.michaelbel.movies.ui.preview.DeviceLandscapePreview import org.michaelbel.movies.ui.preview.DeviceLandscapePreviews import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.preview.DeviceUserLandscapePreviews import org.michaelbel.movies.ui.preview.DeviceUserPreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -151,7 +155,19 @@ private fun PageLoadingColumnPreview() { PageLoadingColumn( modifier = Modifier .fillMaxSize() - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun PageLoadingColumnAmoledPreview() { + AmoledTheme { + PageLoadingColumn( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.primaryContainer) ) } } @@ -163,19 +179,43 @@ private fun PageLoadingGridPreview() { PageLoadingGrid( modifier = Modifier .fillMaxSize() - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) ) } } @Composable -@DeviceUserPreviews +@DeviceLandscapePreview +private fun PageLoadingGridAmoledPreview() { + AmoledTheme { + PageLoadingGrid( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@DeviceUserLandscapePreviews private fun PageLoadingStaggeredGridPreview() { MoviesTheme { PageLoadingStaggeredGrid( modifier = Modifier .fillMaxSize() - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@DeviceUserPreviews +private fun PageLoadingStaggeredGridAmoledPreview() { + AmoledTheme { + PageLoadingStaggeredGrid( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PagingFailureBox.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PagingFailureBox.kt index d9720e4cf..8b9cb250a 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PagingFailureBox.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PagingFailureBox.kt @@ -11,9 +11,11 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import org.michaelbel.movies.ui.R import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -28,7 +30,7 @@ fun PagingFailureBox( Text( text = stringResource(R.string.retry), style = MaterialTheme.typography.bodyLarge.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) } @@ -42,7 +44,20 @@ private fun PagingFailureBoxPreview() { modifier = Modifier .fillMaxWidth() .height(100.dp) - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun PagingFailureBoxAmoledPreview() { + AmoledTheme { + PagingFailureBox( + modifier = Modifier + .fillMaxWidth() + .height(100.dp) + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PagingLoadingBox.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PagingLoadingBox.kt index 906fa9908..7dc86696f 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PagingLoadingBox.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/page/PagingLoadingBox.kt @@ -10,8 +10,10 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -35,7 +37,20 @@ private fun PagingLoadingBoxPreview() { modifier = Modifier .fillMaxWidth() .height(100.dp) - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun PagingLoadingBoxAmoledPreview() { + AmoledTheme { + PagingLoadingBox( + modifier = Modifier + .fillMaxWidth() + .height(100.dp) + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/DeviceLandscapePreview.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/DeviceLandscapePreview.kt new file mode 100644 index 000000000..e698bed3c --- /dev/null +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/DeviceLandscapePreview.kt @@ -0,0 +1,9 @@ +package org.michaelbel.movies.ui.preview + +import androidx.compose.ui.tooling.preview.Preview + +@Preview( + widthDp = 800, + heightDp = 360 +) +annotation class DeviceLandscapePreview \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/DeviceUserLandscapePreviews.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/DeviceUserLandscapePreviews.kt new file mode 100644 index 000000000..85228e6cb --- /dev/null +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/DeviceUserLandscapePreviews.kt @@ -0,0 +1,26 @@ +package org.michaelbel.movies.ui.preview + +import android.content.res.Configuration +import androidx.compose.ui.tooling.preview.Preview + +@Preview( + name = "Day", + uiMode = Configuration.UI_MODE_NIGHT_NO +) +@Preview( + name = "Night", + uiMode = Configuration.UI_MODE_NIGHT_YES +) +@Preview( + name = "Day Landscape", + uiMode = Configuration.UI_MODE_NIGHT_NO, + widthDp = 800, + heightDp = 360 +) +@Preview( + name = "Night Landscape", + uiMode = Configuration.UI_MODE_NIGHT_YES, + widthDp = 800, + heightDp = 360 +) +annotation class DeviceUserLandscapePreviews \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/DeviceUserPreviews.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/DeviceUserPreviews.kt index c182a9e97..5012541f7 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/DeviceUserPreviews.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/DeviceUserPreviews.kt @@ -1,25 +1,9 @@ package org.michaelbel.movies.ui.preview -import android.content.res.Configuration import androidx.compose.ui.tooling.preview.Preview +@Preview @Preview( - name = "Day", - uiMode = Configuration.UI_MODE_NIGHT_NO -) -@Preview( - name = "Night", - uiMode = Configuration.UI_MODE_NIGHT_YES -) -@Preview( - name = "Day Landscape", - uiMode = Configuration.UI_MODE_NIGHT_NO, - widthDp = 800, - heightDp = 360 -) -@Preview( - name = "Night Landscape", - uiMode = Configuration.UI_MODE_NIGHT_YES, widthDp = 800, heightDp = 360 ) diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/provider/MovieDbPreviewParameterProvider.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/provider/MovieDbPreviewParameterProvider.kt index 6add6814e..e1a759500 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/provider/MovieDbPreviewParameterProvider.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/preview/provider/MovieDbPreviewParameterProvider.kt @@ -11,11 +11,7 @@ class MovieDbPreviewParameterProvider: PreviewParameterProvider { dateAdded = System.currentTimeMillis(), position = 0, movieId = 438148, - overview = """Queen Ramonda, Shuri, M’Baku, Okoye and the Dora Milaje fight to protect - their nation from intervening world powers in the wake of King T’Challa’s death. - As the Wakandans strive to embrace their next chapter, the heroes must band - together with the help of War Dog Nakia and Everett Ross and forge a new path for - the kingdom of Wakanda.""", + overview = """Queen Ramonda, Shuri, M’Baku, Okoye and the Dora Milaje fight to protect their nation from intervening world powers in the wake of King T’Challa’s death. As the Wakandans strive to embrace their next chapter, the heroes must band together with the help of War Dog Nakia and Everett Ross and forge a new path for the kingdom of Wakanda.""", posterPath = "", backdropPath = "", releaseDate = "2022-11-09", diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/theme/Colors.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/theme/Colors.kt index 89b3b4bcc..0d9f91df6 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/theme/Colors.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/theme/Colors.kt @@ -4,14 +4,32 @@ import androidx.compose.material3.darkColorScheme import androidx.compose.material3.lightColorScheme import androidx.compose.ui.graphics.Color +@Suppress("unused") +private val tmdbPrimary = Color(0xFF01D277) + +@Suppress("unused") +private val tmdbSecondary = Color(0xFF081C24) + +private val amoledSurface = Color(0xFF141414) + /** Light default theme color scheme. */ val LightColorScheme = lightColorScheme() /** Dark default theme color scheme. */ val DarkColorScheme = darkColorScheme() -@Suppress("unused") -private val tmdbPrimary = Color(0xFF01D277) - -@Suppress("unused") -private val tmdbSecondary = Color(0xFF081C24) \ No newline at end of file +val AmoledColorScheme = darkColorScheme( + primary = Color.White, + onPrimary = Color.White, + primaryContainer = Color.Black, + onPrimaryContainer = Color.White, + inversePrimary = amoledSurface, + secondary = Color.White, + onSecondaryContainer = Color.White, + surfaceTint = amoledSurface, + onSurface = Color.White, + surfaceVariant = amoledSurface, + onSurfaceVariant = Color.White, + error = Color.White, + outline = Color.White +) \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/theme/Theme.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/theme/Theme.kt index 2a050ee40..bea5c6c1c 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/theme/Theme.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/theme/Theme.kt @@ -64,6 +64,12 @@ fun MoviesTheme( statusBarDarkContentEnabled = !darkTheme ) } + AppTheme.Amoled -> { + ComposeTheme( + colorScheme = AmoledColorScheme, + statusBarDarkContentEnabled = false + ) + } } val systemUiController: SystemUiController = rememberSystemUiController() @@ -79,4 +85,20 @@ fun MoviesTheme( content = content ) } +} + +@Composable +fun AmoledTheme( + content: @Composable () -> Unit +) { + MaterialTheme( + colorScheme = AmoledColorScheme, + shapes = MoviesShapes, + typography = MoviesTypography + ) { + CompositionLocalProvider( + LocalRippleTheme provides MoviesRippleTheme, + content = content + ) + } } \ No newline at end of file diff --git a/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountCountryBox.kt b/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountCountryBox.kt index 1c57783b3..ba5a5c400 100644 --- a/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountCountryBox.kt +++ b/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountCountryBox.kt @@ -14,10 +14,12 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -59,4 +61,17 @@ private fun AccountCountryBoxPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } +} + +@Composable +@Preview +private fun AccountCountryBoxAmoledPreview() { + AmoledTheme { + AccountCountryBox( + country = "Finland", + modifier = Modifier + .fillMaxWidth() + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt b/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt index a5eca4d39..44415fa82 100644 --- a/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt +++ b/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme @@ -19,6 +20,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ChainStyle import androidx.constraintlayout.compose.ConstraintLayout @@ -35,6 +37,7 @@ import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.ktx.isPortrait import org.michaelbel.movies.ui.ktx.lettersTextFontSizeLarge import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -55,7 +58,7 @@ fun AccountRoute( } @Composable -internal fun AccountScreenContent( +private fun AccountScreenContent( account: AccountDb, loading: Boolean, onBackClick: () -> Unit, @@ -141,7 +144,7 @@ internal fun AccountScreenContent( text = account.name, overflow = TextOverflow.Ellipsis, style = MaterialTheme.typography.bodyLarge.copy( - color = MaterialTheme.colorScheme.primary + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) } @@ -180,6 +183,9 @@ internal fun AccountScreenContent( bottom.linkTo(parent.bottom, 16.dp) }, enabled = !loading, + colors = ButtonDefaults.buttonColors( + containerColor = MaterialTheme.colorScheme.surfaceTint + ), contentPadding = PaddingValues(horizontal = 24.dp) ) { if (loading) { @@ -215,4 +221,25 @@ private fun AccountScreenContentPreview() { onLogoutClick = {} ) } +} + +@Composable +@Preview +private fun AccountScreenContentAmoledPreview() { + AmoledTheme { + AccountScreenContent( + account = AccountDb( + accountId = 0, + avatarUrl = "", + language = "", + country = "Finland", + name = "Michael Bely", + adult = true, + username = "michaelbel" + ), + loading = false, + onBackClick = {}, + onLogoutClick = {} + ) + } } \ No newline at end of file diff --git a/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountToolbar.kt b/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountToolbar.kt index 3b4ce6420..4f265be3e 100644 --- a/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountToolbar.kt +++ b/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountToolbar.kt @@ -10,9 +10,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.account_impl.R import org.michaelbel.movies.ui.compose.iconbutton.CloseIcon import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -51,4 +53,15 @@ private fun AccountToolbarPreview() { onNavigationIconClick = {} ) } +} + +@Composable +@Preview +private fun AccountToolbarAmoledPreview() { + AmoledTheme { + AccountToolbar( + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer), + onNavigationIconClick = {} + ) + } } \ No newline at end of file diff --git a/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthLinksBox.kt b/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthLinksBox.kt index 111a6a6cd..68bd40d3e 100644 --- a/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthLinksBox.kt +++ b/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthLinksBox.kt @@ -16,10 +16,12 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import org.michaelbel.movies.auth_impl.R import org.michaelbel.movies.ui.ktx.clickableWithoutRipple import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -49,7 +51,7 @@ fun AuthLinksBox( .padding(vertical = 16.dp) .clickableWithoutRipple { onTermsOfUseClick() }, style = MaterialTheme.typography.bodyMedium.copy( - color = MaterialTheme.colorScheme.primary + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) @@ -67,7 +69,7 @@ fun AuthLinksBox( .padding(vertical = 16.dp) .clickableWithoutRipple { onPrivacyPolicyClick() }, style = MaterialTheme.typography.bodyMedium.copy( - color = MaterialTheme.colorScheme.primary + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) } @@ -84,4 +86,16 @@ private fun AuthLinksBoxPreview() { modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } +} + +@Composable +@Preview +private fun AuthLinksBoxAmoledPreview() { + AmoledTheme { + AuthLinksBox( + onTermsOfUseClick = {}, + onPrivacyPolicyClick = {}, + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt b/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt index efc56bb27..0048851c5 100644 --- a/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt +++ b/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt @@ -15,6 +15,7 @@ import androidx.compose.foundation.text.KeyboardActions import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Button +import androidx.compose.material3.ButtonDefaults import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme @@ -36,6 +37,7 @@ import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.PasswordVisualTransformation import androidx.compose.ui.text.input.VisualTransformation +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension @@ -55,6 +57,9 @@ import org.michaelbel.movies.ui.compose.iconbutton.PasswordIcon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.ktx.clickableWithoutRipple import org.michaelbel.movies.ui.ktx.isPortrait +import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme +import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun AuthRoute( @@ -275,6 +280,9 @@ internal fun AuthScreenContent( end.linkTo(parent.end, 16.dp) }, enabled = username.isNotEmpty() && password.isNotEmpty() && !loading, + colors = ButtonDefaults.buttonColors( + containerColor = MaterialTheme.colorScheme.surfaceTint + ), contentPadding = PaddingValues(horizontal = 24.dp) ) { if (loading) { @@ -338,4 +346,32 @@ internal fun AuthScreenContent( } ) } +} + +@Composable +@DevicePreviews +private fun AuthScreenContentPreview() { + MoviesTheme { + AuthScreenContent( + error = null, + loading = false, + onBackClick = {}, + onSignInClick = { _,_ -> }, + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun AuthScreenContentAmoledPreview() { + AmoledTheme { + AuthScreenContent( + error = null, + loading = false, + onBackClick = {}, + onSignInClick = { _,_ -> }, + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthToolbar.kt b/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthToolbar.kt index e0c919f79..1f2976938 100644 --- a/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthToolbar.kt +++ b/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthToolbar.kt @@ -10,9 +10,11 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.auth_impl.R import org.michaelbel.movies.ui.compose.iconbutton.CloseIcon import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -51,4 +53,15 @@ private fun AuthToolbarPreview() { onNavigationIconClick = {} ) } +} + +@Composable +@Preview +private fun AuthToolbarAmoledPreview() { + AmoledTheme { + AuthToolbar( + modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer), + onNavigationIconClick = {} + ) + } } \ No newline at end of file diff --git a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsContent.kt b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsContent.kt index 251a94d38..e5b7ee231 100644 --- a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsContent.kt +++ b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsContent.kt @@ -19,6 +19,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout @@ -37,6 +38,7 @@ import org.michaelbel.movies.ui.placeholder.material3.fade import org.michaelbel.movies.ui.placeholder.placeholder import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.MovieDbPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -168,7 +170,23 @@ private fun DetailsContentPreview( DetailsContent( modifier = Modifier .fillMaxSize() - .background(MaterialTheme.colorScheme.background), + .background(MaterialTheme.colorScheme.primaryContainer), + movie = movie, + onNavigateToGallery = {} + ) + } +} + +@Composable +@Preview +private fun DetailsContentAmoledPreview( + @PreviewParameter(MovieDbPreviewParameterProvider::class) movie: MovieDb +) { + AmoledTheme { + DetailsContent( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.primaryContainer), movie = movie, onNavigateToGallery = {} ) diff --git a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsFailure.kt b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsFailure.kt index 37bca016c..687c59565 100644 --- a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsFailure.kt +++ b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsFailure.kt @@ -9,6 +9,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension @@ -16,6 +17,7 @@ import org.michaelbel.movies.details_impl.R import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -52,7 +54,7 @@ fun DetailsFailure( }, textAlign = TextAlign.Center, style = MaterialTheme.typography.bodyMedium.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) } @@ -65,7 +67,19 @@ private fun DetailsFailurePreview() { DetailsFailure( modifier = Modifier .fillMaxSize() - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun DetailsFailureAmoledPreview() { + AmoledTheme { + DetailsFailure( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.kt b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.kt index 3a92671c3..e9b04c683 100644 --- a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.kt +++ b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.kt @@ -5,8 +5,10 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.persistence.database.entity.MovieDb import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -28,7 +30,19 @@ private fun DetailsLoadingPreview() { DetailsLoading( modifier = Modifier .fillMaxSize() - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun DetailsLoadingAmoledPreview() { + AmoledTheme { + DetailsLoading( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsScreenContent.kt b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsScreenContent.kt index db09e8782..f7f7ede40 100644 --- a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsScreenContent.kt +++ b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsScreenContent.kt @@ -1,5 +1,6 @@ package org.michaelbel.movies.details.ui +import androidx.compose.foundation.background import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding @@ -12,6 +13,8 @@ import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.input.nestedscroll.nestedScroll +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import java.net.UnknownHostException @@ -24,7 +27,12 @@ import org.michaelbel.movies.network.connectivity.NetworkStatus import org.michaelbel.movies.network.connectivity.ktx.isAvailable import org.michaelbel.movies.network.ktx.isFailure import org.michaelbel.movies.network.ktx.throwable +import org.michaelbel.movies.persistence.database.entity.MovieDb import org.michaelbel.movies.ui.ktx.displayCutoutWindowInsets +import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.preview.provider.MovieDbPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme +import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun DetailsRoute( @@ -103,4 +111,42 @@ private fun DetailsScreenContent( } } } +} + +@Composable +@DevicePreviews +private fun DetailsScreenContentPreview( + @PreviewParameter(MovieDbPreviewParameterProvider::class) movie: MovieDb +) { + MoviesTheme { + DetailsScreenContent( + onBackClick = {}, + onNavigateToGallery = {}, + detailsState = ScreenState.Content(movie), + networkStatus = NetworkStatus.Available, + onRetry = {}, + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun DetailsScreenContentAmoledPreview( + @PreviewParameter(MovieDbPreviewParameterProvider::class) movie: MovieDb +) { + AmoledTheme { + DetailsScreenContent( + onBackClick = {}, + onNavigateToGallery = {}, + detailsState = ScreenState.Content(movie), + networkStatus = NetworkStatus.Available, + onRetry = {}, + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsToolbar.kt b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsToolbar.kt index ec0e15b52..f1afed1e1 100644 --- a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsToolbar.kt +++ b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsToolbar.kt @@ -12,12 +12,14 @@ import androidx.compose.material3.TopAppBarScrollBehavior import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import org.michaelbel.movies.ui.compose.iconbutton.BackIcon import org.michaelbel.movies.ui.compose.iconbutton.ShareIcon import org.michaelbel.movies.ui.ktx.displayCutoutWindowInsets import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.TitlePreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -80,4 +82,20 @@ private fun DetailsToolbarPreview( modifier = Modifier.statusBarsPadding() ) } +} + +@Composable +@Preview +private fun DetailsToolbarAmoledPreview( + @PreviewParameter(TitlePreviewParameterProvider::class) title: String +) { + AmoledTheme { + DetailsToolbar( + movieTitle = title, + movieUrl = null, + onNavigationIconClick = {}, + topAppBarScrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(), + modifier = Modifier.statusBarsPadding() + ) + } } \ No newline at end of file diff --git a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedEmpty.kt b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedEmpty.kt index d07b9691a..2cab31ceb 100644 --- a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedEmpty.kt +++ b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedEmpty.kt @@ -9,6 +9,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension @@ -16,6 +17,7 @@ import org.michaelbel.movies.feed_impl.R import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -52,7 +54,7 @@ fun FeedEmpty( }, textAlign = TextAlign.Center, style = MaterialTheme.typography.bodyMedium.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) } @@ -65,7 +67,19 @@ private fun FeedEmptyPreview() { FeedEmpty( modifier = Modifier .fillMaxSize() - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun FeedEmptyAmoledPreview() { + AmoledTheme { + FeedEmpty( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt index 2afa710bb..cdeb1ed3c 100644 --- a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt +++ b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt @@ -16,6 +16,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import org.michaelbel.movies.feed_impl.R @@ -31,6 +32,7 @@ import org.michaelbel.movies.ui.ktx.displayCutoutWindowInsets import org.michaelbel.movies.ui.ktx.lettersTextFontSizeSmall import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.BooleanPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -123,4 +125,25 @@ private fun FeedToolbarPreview( modifier = Modifier.statusBarsPadding() ) } +} + +@Composable +@Preview +private fun FeedToolbarAmoledPreview( + @PreviewParameter(BooleanPreviewParameterProvider::class) visible: Boolean +) { + AmoledTheme { + FeedToolbar( + title = stringResource(R.string.feed_title_now_playing), + account = AccountDb.Empty, + isUpdateIconVisible = visible, + onSearchIconClick = {}, + onAccountIconClick = {}, + onAuthIconClick = {}, + onUpdateIconClick = {}, + onSettingsIconClick = {}, + topAppBarScrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(), + modifier = Modifier.statusBarsPadding() + ) + } } \ No newline at end of file diff --git a/feature/gallery-impl/src/main/kotlin/org/michaelbel/movies/gallery/ui/GalleryLoading.kt b/feature/gallery-impl/src/main/kotlin/org/michaelbel/movies/gallery/ui/GalleryLoading.kt index 17bb0e2b5..a096df591 100644 --- a/feature/gallery-impl/src/main/kotlin/org/michaelbel/movies/gallery/ui/GalleryLoading.kt +++ b/feature/gallery-impl/src/main/kotlin/org/michaelbel/movies/gallery/ui/GalleryLoading.kt @@ -7,7 +7,9 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -32,4 +34,14 @@ private fun GalleryLoadingPreview() { modifier = Modifier.fillMaxSize() ) } +} + +@Composable +@Preview +private fun GalleryLoadingAmoledPreview() { + AmoledTheme { + GalleryLoading( + modifier = Modifier.fillMaxSize() + ) + } } \ No newline at end of file diff --git a/feature/gallery-impl/src/main/kotlin/org/michaelbel/movies/gallery/ui/GalleryScreenContent.kt b/feature/gallery-impl/src/main/kotlin/org/michaelbel/movies/gallery/ui/GalleryScreenContent.kt index d35565da8..c73f29efa 100644 --- a/feature/gallery-impl/src/main/kotlin/org/michaelbel/movies/gallery/ui/GalleryScreenContent.kt +++ b/feature/gallery-impl/src/main/kotlin/org/michaelbel/movies/gallery/ui/GalleryScreenContent.kt @@ -41,6 +41,7 @@ import androidx.compose.ui.platform.LocalHapticFeedback import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension @@ -63,6 +64,9 @@ import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.compose.iconbutton.BackIcon import org.michaelbel.movies.ui.compose.iconbutton.DownloadIcon import org.michaelbel.movies.ui.ktx.displayCutoutWindowInsets +import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme +import org.michaelbel.movies.ui.theme.MoviesTheme import org.michaelbel.movies.work.DownloadImageWorker @Composable @@ -330,4 +334,32 @@ private fun LoopHorizontalPager( content(index) } ) +} + +@Composable +@DevicePreviews +private fun GalleryScreenContentPreview() { + MoviesTheme { + GalleryScreenContent( + movieImages = emptyList(), + workInfo = null, + onBackClick = {}, + onDownloadClick = {}, + modifier = Modifier.fillMaxSize() + ) + } +} + +@Composable +@Preview +private fun GalleryScreenContentAmoledPreview() { + AmoledTheme { + GalleryScreenContent( + movieImages = emptyList(), + workInfo = null, + onBackClick = {}, + onDownloadClick = {}, + modifier = Modifier.fillMaxSize() + ) + } } \ No newline at end of file diff --git a/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchEmpty.kt b/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchEmpty.kt index 8a37ebe82..09c27aaa4 100644 --- a/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchEmpty.kt +++ b/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchEmpty.kt @@ -9,6 +9,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension @@ -16,6 +17,7 @@ import org.michaelbel.movies.search_impl.R import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -52,7 +54,7 @@ fun SearchEmpty( }, textAlign = TextAlign.Center, style = MaterialTheme.typography.bodyMedium.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) } @@ -65,7 +67,19 @@ private fun SearchEmptyPreview() { SearchEmpty( modifier = Modifier .fillMaxSize() - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun SearchEmptyAmoledPreview() { + AmoledTheme { + SearchEmpty( + modifier = Modifier + .fillMaxSize() + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchHistoryHeader.kt b/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchHistoryHeader.kt index 32d72e9af..09676e041 100644 --- a/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchHistoryHeader.kt +++ b/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchHistoryHeader.kt @@ -10,11 +10,13 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension import org.michaelbel.movies.search_impl.R import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -38,7 +40,7 @@ fun SearchHistoryHeader( }, textAlign = TextAlign.Start, style = MaterialTheme.typography.bodyMedium.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) @@ -68,7 +70,21 @@ private fun SearchHistoryHeaderPreview() { modifier = Modifier .fillMaxWidth() .height(48.dp) - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun SearchHistoryHeaderAmoledPreview() { + AmoledTheme { + SearchHistoryHeader( + onClearButtonClick = {}, + modifier = Modifier + .fillMaxWidth() + .height(48.dp) + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git "a/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchRe\321\201entResult.kt" "b/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchRe\321\201entResult.kt" index 2da8422f4..21d61571b 100644 --- "a/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchRe\321\201entResult.kt" +++ "b/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchRe\321\201entResult.kt" @@ -11,6 +11,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout @@ -21,6 +22,7 @@ import org.michaelbel.movies.ui.compose.iconbutton.CloseIcon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.MoviePreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -61,7 +63,7 @@ fun SearchRecentResult( overflow = TextOverflow.Ellipsis, maxLines = 1, style = MaterialTheme.typography.bodyMedium.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) @@ -90,7 +92,24 @@ private fun SearchRecentResultPreview( modifier = Modifier .fillMaxWidth() .height(48.dp) - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun SearchRecentResultAmoledPreview( + @PreviewParameter(MoviePreviewParameterProvider::class) movie: MovieDb +) { + AmoledTheme { + SearchRecentResult( + text = movie.title, + onRemoveClick = {}, + modifier = Modifier + .fillMaxWidth() + .height(48.dp) + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchSuggestion.kt b/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchSuggestion.kt index 894603165..a27535d21 100644 --- a/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchSuggestion.kt +++ b/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchSuggestion.kt @@ -12,11 +12,13 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import org.michaelbel.movies.persistence.database.entity.SuggestionDb import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.SuggestionDbPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -49,7 +51,23 @@ private fun SearchSuggestionPreview( modifier = Modifier .fillMaxWidth() .height(52.dp) - .background(MaterialTheme.colorScheme.background) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun SearchSuggestionAmoledPreview( + @PreviewParameter(SuggestionDbPreviewParameterProvider::class) suggestions: List +) { + AmoledTheme { + SearchSuggestion( + text = suggestions.first().title, + modifier = Modifier + .fillMaxWidth() + .height(52.dp) + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchToolbar.kt b/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchToolbar.kt index 913ef0f13..1a1d6eead 100644 --- a/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchToolbar.kt +++ b/feature/search-impl/src/main/kotlin/org/michaelbel/movies/search/ui/SearchToolbar.kt @@ -19,6 +19,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import org.michaelbel.movies.persistence.database.entity.MovieDb @@ -29,8 +30,8 @@ import org.michaelbel.movies.ui.compose.iconbutton.CloseIcon import org.michaelbel.movies.ui.compose.iconbutton.VoiceIcon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews -import org.michaelbel.movies.ui.preview.provider.MoviePreviewParameterProvider import org.michaelbel.movies.ui.preview.provider.SuggestionDbPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -167,11 +168,11 @@ private fun SearchToolbarPreview( } @Composable -@DevicePreviews -private fun SearchToolbarPreview2( - @PreviewParameter(MoviePreviewParameterProvider::class) movies: List +@Preview +private fun SearchToolbarAmoledPreview( + @PreviewParameter(SuggestionDbPreviewParameterProvider::class) suggestions: List ) { - MoviesTheme { + AmoledTheme { SearchToolbar( query = "Napoleon", onQueryChange = {}, @@ -181,9 +182,9 @@ private fun SearchToolbarPreview2( onBackClick = {}, onCloseClick = {}, onInputText = {}, - suggestions = emptyList(), + suggestions = suggestions, onSuggestionClick = {}, - searchHistoryMovies = movies, + searchHistoryMovies = emptyList(), onHistoryMovieClick = {}, onHistoryMovieRemoveClick = {}, onClearHistoryClick = {} diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ktx/SystemThemeKtx.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ktx/SystemThemeKtx.kt index 0ce5cbcb9..e182e3438 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ktx/SystemThemeKtx.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ktx/SystemThemeKtx.kt @@ -10,4 +10,5 @@ internal val AppTheme.themeText: String is AppTheme.NightNo -> stringResource(R.string.settings_theme_light) is AppTheme.NightYes -> stringResource(R.string.settings_theme_dark) is AppTheme.FollowSystem -> stringResource(R.string.settings_theme_system) + is AppTheme.Amoled -> stringResource(R.string.settings_theme_amoled) } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/AppIconBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/AppIconBox.kt index 43f89ec5c..6e9690314 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/AppIconBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/AppIconBox.kt @@ -14,6 +14,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ChainStyle @@ -27,6 +28,7 @@ import org.michaelbel.movies.ui.appicon.isEnabled import org.michaelbel.movies.ui.ktx.context import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.IconAliasPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -100,4 +102,19 @@ private fun AppIconBoxPreview( .background(iconAlias.backgroundColor(context)) ) } +} + +@Composable +@Preview +private fun AppIconBoxAmoledPreview( + @PreviewParameter(IconAliasPreviewParameterProvider::class) iconAlias: IconAlias +) { + AmoledTheme { + AppIconBox( + iconAlias = iconAlias, + modifier = Modifier + .clip(RoundedCornerShape(8.dp)) + .background(iconAlias.backgroundColor(context)) + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsAppIconBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsAppIconBox.kt index 40e351a4e..e773595a7 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsAppIconBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsAppIconBox.kt @@ -11,6 +11,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension @@ -19,6 +20,7 @@ import org.michaelbel.movies.settings_impl.R import org.michaelbel.movies.ui.appicon.IconAlias import org.michaelbel.movies.ui.appicon.setIcon import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -112,4 +114,17 @@ private fun SettingsAppIconBoxPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } +} + +@Composable +@Preview +private fun SettingsAppIconBoxAmoledPreview() { + AmoledTheme { + SettingsAppIconBox( + onAppIconChanged = {}, + modifier = Modifier + .fillMaxWidth() + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsAppearanceBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsAppearanceBox.kt index 709e94013..9d8f29c49 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsAppearanceBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsAppearanceBox.kt @@ -14,6 +14,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout @@ -23,6 +24,7 @@ import org.michaelbel.movies.settings.ktx.feedViewText import org.michaelbel.movies.settings_impl.R import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.AppearancePreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -101,4 +103,21 @@ private fun SettingsAppearanceBoxPreview( .background(MaterialTheme.colorScheme.primaryContainer) ) } +} + +@Composable +@Preview +private fun SettingsAppearanceBoxAmoledPreview( + @PreviewParameter(AppearancePreviewParameterProvider::class) feedView: FeedView +) { + AmoledTheme { + SettingsAppearanceBox( + currentFeedView = feedView, + onFeedViewSelect = {}, + modifier = Modifier + .fillMaxWidth() + .height(52.dp) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsAppearanceDialog.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsAppearanceDialog.kt index afb1f7faa..386e9d396 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsAppearanceDialog.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsAppearanceDialog.kt @@ -21,6 +21,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import org.michaelbel.movies.common.appearance.FeedView @@ -30,6 +31,7 @@ import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.AppearancePreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -111,7 +113,7 @@ private fun SettingAppearanceDialogContent( onClick = null, colors = RadioButtonDefaults.colors( selectedColor = MaterialTheme.colorScheme.primary, - unselectedColor = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.6F) + unselectedColor = MaterialTheme.colorScheme.onPrimaryContainer.copy(alpha = 0.6F) ), modifier = Modifier.padding(start = 16.dp) ) @@ -120,7 +122,7 @@ private fun SettingAppearanceDialogContent( text = feedView.feedViewText, modifier = Modifier.padding(start = 8.dp), style = MaterialTheme.typography.bodyLarge.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) } @@ -140,4 +142,18 @@ private fun SettingsAppearanceDialogPreview( onDismissRequest = {} ) } +} + +@Composable +@Preview +private fun SettingsAppearanceDialogAmoledPreview( + @PreviewParameter(AppearancePreviewParameterProvider::class) feeView: FeedView +) { + AmoledTheme { + SettingsAppearanceDialog( + currentFeedView = feeView, + onFeedViewSelect = {}, + onDismissRequest = {} + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsDynamicColorsBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsDynamicColorsBox.kt index e145389e5..5d0744fa2 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsDynamicColorsBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsDynamicColorsBox.kt @@ -5,11 +5,13 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Switch +import androidx.compose.material3.SwitchDefaults import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout @@ -17,6 +19,7 @@ import androidx.constraintlayout.compose.Dimension import org.michaelbel.movies.settings_impl.R import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.BooleanPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -56,7 +59,10 @@ fun SettingsDynamicColorsBox( end.linkTo(parent.end, 16.dp) bottom.linkTo(parent.bottom) } - .testTag("Switch") + .testTag("Switch"), + colors = SwitchDefaults.colors( + checkedTrackColor = MaterialTheme.colorScheme.surfaceTint + ) ) } } @@ -75,4 +81,20 @@ private fun SettingsDynamicColorsBoxPreview( .background(MaterialTheme.colorScheme.primaryContainer) ) } +} + +@Composable +@Preview +private fun SettingsDynamicColorsBoxAmoledPreview( + @PreviewParameter(BooleanPreviewParameterProvider::class) isEnabled: Boolean +) { + AmoledTheme { + SettingsDynamicColorsBox( + isDynamicColorsEnabled = isEnabled, + modifier = Modifier + .fillMaxWidth() + .height(52.dp) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageBox.kt index a8cb74d34..66cd5ab1b 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageBox.kt @@ -14,6 +14,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout @@ -23,6 +24,7 @@ import org.michaelbel.movies.settings.ktx.languageText import org.michaelbel.movies.settings_impl.R import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.LanguagePreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -101,4 +103,21 @@ private fun SettingsLanguageBoxPreview( .background(MaterialTheme.colorScheme.primaryContainer) ) } +} + +@Composable +@Preview +private fun SettingsLanguageBoxAmoledPreview( + @PreviewParameter(LanguagePreviewParameterProvider::class) language: AppLanguage +) { + AmoledTheme { + SettingsLanguageBox( + currentLanguage = language, + onLanguageSelect = {}, + modifier = Modifier + .fillMaxWidth() + .height(52.dp) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageDialog.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageDialog.kt index eec469a96..1e5e73c1e 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageDialog.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageDialog.kt @@ -22,6 +22,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import org.michaelbel.movies.common.localization.model.AppLanguage @@ -31,6 +32,7 @@ import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.LanguagePreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -112,7 +114,7 @@ private fun SettingLanguageDialogContent( onClick = null, colors = RadioButtonDefaults.colors( selectedColor = MaterialTheme.colorScheme.primary, - unselectedColor = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.6F) + unselectedColor = MaterialTheme.colorScheme.onPrimaryContainer.copy(alpha = 0.6F) ), modifier = Modifier.padding(start = 16.dp) ) @@ -121,7 +123,7 @@ private fun SettingLanguageDialogContent( text = language.languageText, modifier = Modifier.padding(start = 8.dp), style = MaterialTheme.typography.bodyLarge.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) } @@ -141,4 +143,18 @@ private fun SettingLanguageDialogPreview( onDismissRequest = {} ) } +} + +@Composable +@Preview +private fun SettingLanguageDialogAmoledPreview( + @PreviewParameter(LanguagePreviewParameterProvider::class) language: AppLanguage +) { + AmoledTheme { + SettingLanguageDialog( + currentLanguage = language, + onLanguageSelect = {}, + onDismissRequest = {} + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsMovieListBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsMovieListBox.kt index 5cfd393af..d4f6882e4 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsMovieListBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsMovieListBox.kt @@ -14,6 +14,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout @@ -23,6 +24,7 @@ import org.michaelbel.movies.settings.ktx.listText import org.michaelbel.movies.settings_impl.R import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.MovieListPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -101,4 +103,21 @@ private fun SettingsMovieListBoxPreview( .background(MaterialTheme.colorScheme.primaryContainer) ) } +} + +@Composable +@Preview +private fun SettingsMovieListBoxAmoledPreview( + @PreviewParameter(MovieListPreviewParameterProvider::class) movieList: MovieList +) { + AmoledTheme { + SettingsMovieListBox( + currentMovieList = movieList, + onMovieListSelect = {}, + modifier = Modifier + .fillMaxWidth() + .height(52.dp) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsMovieListDialog.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsMovieListDialog.kt index ecb8e09a9..fb9ec22da 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsMovieListDialog.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsMovieListDialog.kt @@ -21,6 +21,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import org.michaelbel.movies.common.list.MovieList @@ -30,6 +31,7 @@ import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.MovieListPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -117,7 +119,7 @@ private fun SettingMovieListDialogContent( onClick = null, colors = RadioButtonDefaults.colors( selectedColor = MaterialTheme.colorScheme.primary, - unselectedColor = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.6F) + unselectedColor = MaterialTheme.colorScheme.onPrimaryContainer.copy(alpha = 0.6F) ), modifier = Modifier.padding(start = 16.dp) ) @@ -126,7 +128,7 @@ private fun SettingMovieListDialogContent( text = movieList.listText, modifier = Modifier.padding(start = 8.dp), style = MaterialTheme.typography.bodyLarge.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) } @@ -146,4 +148,18 @@ private fun SettingsMovieListDialogPreview( onDismissRequest = {} ) } +} + +@Composable +@Preview +private fun SettingsMovieListDialogAmoledPreview( + @PreviewParameter(MovieListPreviewParameterProvider::class) movieList: MovieList +) { + AmoledTheme { + SettingsMovieListDialog( + currentMovieList = movieList, + onMovieListSelect = {}, + onDismissRequest = {} + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsPostNotificationsBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsPostNotificationsBox.kt index f093d4a49..3d6910f1b 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsPostNotificationsBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsPostNotificationsBox.kt @@ -4,12 +4,10 @@ import android.Manifest import android.app.Activity import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.result.contract.ActivityResultContracts -import androidx.compose.foundation.background import androidx.compose.foundation.clickable -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Switch +import androidx.compose.material3.SwitchDefaults import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -27,13 +25,11 @@ import org.michaelbel.movies.common.ktx.notificationManager import org.michaelbel.movies.settings_impl.R import org.michaelbel.movies.ui.ktx.appNotificationSettingsIntent import org.michaelbel.movies.ui.lifecycle.OnResume -import org.michaelbel.movies.ui.preview.DevicePreviews -import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun SettingsPostNotificationsBox( - modifier: Modifier = Modifier, - onShowPermissionSnackbar: () -> Unit + onShowPermissionSnackbar: () -> Unit, + modifier: Modifier = Modifier ) { val context = LocalContext.current val notificationManager = context.notificationManager @@ -104,21 +100,10 @@ fun SettingsPostNotificationsBox( end.linkTo(parent.end, 16.dp) bottom.linkTo(parent.bottom) } - .testTag("Switch") - ) - } -} - -@Composable -@DevicePreviews -private fun SettingsPostNotificationsBoxPreview() { - MoviesTheme { - SettingsPostNotificationsBox( - modifier = Modifier - .fillMaxWidth() - .height(52.dp) - .background(MaterialTheme.colorScheme.primaryContainer), - onShowPermissionSnackbar = {} + .testTag("Switch"), + colors = SwitchDefaults.colors( + checkedTrackColor = MaterialTheme.colorScheme.surfaceTint + ) ) } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsReviewBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsReviewBox.kt index fa36c64f7..8d9fe9e91 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsReviewBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsReviewBox.kt @@ -9,11 +9,13 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension import org.michaelbel.movies.settings_impl.R import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -54,4 +56,17 @@ private fun SettingsReviewBoxPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } +} + +@Composable +@Preview +private fun SettingsReviewBoxAmoledPreview() { + AmoledTheme { + SettingsReviewBox( + modifier = Modifier + .fillMaxWidth() + .height(52.dp) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsRtlBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsRtlBox.kt index e10056deb..3898841a3 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsRtlBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsRtlBox.kt @@ -5,11 +5,13 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Switch +import androidx.compose.material3.SwitchDefaults import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout @@ -17,6 +19,7 @@ import androidx.constraintlayout.compose.Dimension import org.michaelbel.movies.settings_impl.R import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.BooleanPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -56,7 +59,10 @@ fun SettingsRtlBox( end.linkTo(parent.end, 16.dp) bottom.linkTo(parent.bottom) } - .testTag("Switch") + .testTag("Switch"), + colors = SwitchDefaults.colors( + checkedTrackColor = MaterialTheme.colorScheme.surfaceTint + ) ) } } @@ -75,4 +81,20 @@ private fun SettingsRtlBoxPreview( .background(MaterialTheme.colorScheme.primaryContainer) ) } +} + +@Composable +@Preview +private fun SettingsRtlBoxAmoledPreview( + @PreviewParameter(BooleanPreviewParameterProvider::class) isEnabled: Boolean +) { + AmoledTheme { + SettingsRtlBox( + isRtlEnabled = isEnabled, + modifier = Modifier + .fillMaxWidth() + .height(52.dp) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsScreenContent.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsScreenContent.kt index 7fed87cbb..1dc822d92 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsScreenContent.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsScreenContent.kt @@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.navigationBarsPadding import androidx.compose.foundation.layout.windowInsetsPadding +import androidx.compose.foundation.layout.wrapContentHeight import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.rememberLazyListState import androidx.compose.material3.MaterialTheme @@ -26,6 +27,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.LayoutDirection import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel @@ -42,6 +44,9 @@ import org.michaelbel.movies.settings_impl.R import org.michaelbel.movies.ui.ktx.appNotificationSettingsIntent import org.michaelbel.movies.ui.ktx.clickableWithoutRipple import org.michaelbel.movies.ui.ktx.displayCutoutWindowInsets +import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme +import org.michaelbel.movies.ui.theme.MoviesTheme import org.michaelbel.movies.ui.R as UiR @Composable @@ -247,10 +252,8 @@ private fun SettingsScreenContent( item { if (isPostNotificationsFeatureEnabled) { SettingsPostNotificationsBox( - modifier = Modifier - .fillMaxWidth() - .height(52.dp), - onShowPermissionSnackbar = onShowPermissionSnackbar + onShowPermissionSnackbar = onShowPermissionSnackbar, + modifier = Modifier.fillMaxWidth().height(52.dp) ) } } @@ -272,4 +275,68 @@ private fun SettingsScreenContent( } } } +} + +@Composable +@DevicePreviews +private fun SettingsScreenContentPreview() { + MoviesTheme { + SettingsScreenContent( + onBackClick = {}, + currentLanguage = AppLanguage.English, + onLanguageSelect = {}, + currentTheme = AppTheme.NightNo, + onThemeSelect = {}, + currentFeedView = FeedView.FeedList, + onFeedViewSelect = {}, + currentMovieList = MovieList.NowPlaying, + onMovieListSelect = {}, + isDynamicColorsFeatureEnabled = true, + dynamicColors = true, + onSetDynamicColors = {}, + isRtlEnabled = true, + onEnableRtlChanged = {}, + isRtlFeatureEnabled = true, + isPostNotificationsFeatureEnabled = true, + isPlayServicesAvailable = true, + onRequestReview = {}, + appVersionData = AppVersionData.Empty, + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } +} + +@Composable +@Preview +private fun SettingsScreenContentAmoledPreview() { + AmoledTheme { + SettingsScreenContent( + onBackClick = {}, + currentLanguage = AppLanguage.English, + onLanguageSelect = {}, + currentTheme = AppTheme.NightNo, + onThemeSelect = {}, + currentFeedView = FeedView.FeedList, + onFeedViewSelect = {}, + currentMovieList = MovieList.NowPlaying, + onMovieListSelect = {}, + isDynamicColorsFeatureEnabled = true, + dynamicColors = true, + onSetDynamicColors = {}, + isRtlEnabled = true, + onEnableRtlChanged = {}, + isRtlFeatureEnabled = true, + isPostNotificationsFeatureEnabled = true, + isPlayServicesAvailable = true, + onRequestReview = {}, + appVersionData = AppVersionData.Empty, + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeBox.kt index bb68aaa34..f9eb6430c 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeBox.kt @@ -14,6 +14,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout @@ -23,6 +24,7 @@ import org.michaelbel.movies.settings.ktx.themeText import org.michaelbel.movies.settings_impl.R import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.ThemePreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -101,4 +103,21 @@ private fun SettingsThemeBoxPreview( .background(MaterialTheme.colorScheme.primaryContainer) ) } +} + +@Composable +@Preview +private fun SettingsThemeBoxAmoledPreview( + @PreviewParameter(ThemePreviewParameterProvider::class) theme: AppTheme +) { + AmoledTheme { + SettingsThemeBox( + currentTheme = theme, + onThemeSelect = {}, + modifier = Modifier + .fillMaxWidth() + .height(52.dp) + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeDialog.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeDialog.kt index 199fa2622..ca93e860c 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeDialog.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeDialog.kt @@ -22,6 +22,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import org.michaelbel.movies.common.theme.AppTheme @@ -31,6 +32,7 @@ import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.ThemePreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -112,7 +114,7 @@ private fun SettingThemeDialogContent( onClick = null, colors = RadioButtonDefaults.colors( selectedColor = MaterialTheme.colorScheme.primary, - unselectedColor = MaterialTheme.colorScheme.onBackground.copy(alpha = 0.6F) + unselectedColor = MaterialTheme.colorScheme.onPrimaryContainer.copy(alpha = 0.6F) ), modifier = Modifier.padding(start = 16.dp) ) @@ -121,7 +123,7 @@ private fun SettingThemeDialogContent( text = theme.themeText, modifier = Modifier.padding(start = 8.dp), style = MaterialTheme.typography.bodyLarge.copy( - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) ) } @@ -141,4 +143,18 @@ private fun SettingThemeDialogPreview( onDismissRequest = {} ) } +} + +@Composable +@Preview +private fun SettingThemeDialogAmoledPreview( + @PreviewParameter(ThemePreviewParameterProvider::class) theme: AppTheme +) { + AmoledTheme { + SettingThemeDialog( + currentTheme = theme, + onThemeSelect = {}, + onDismissRequest = {} + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsToolbar.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsToolbar.kt index f0eea71c9..d543cbf55 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsToolbar.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsToolbar.kt @@ -12,10 +12,12 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.tooling.preview.Preview import org.michaelbel.movies.settings_impl.R import org.michaelbel.movies.ui.compose.iconbutton.BackIcon import org.michaelbel.movies.ui.ktx.displayCutoutWindowInsets import org.michaelbel.movies.ui.preview.DevicePreviews +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -61,4 +63,15 @@ private fun SettingsToolbarPreview() { onNavigationIconClick = {} ) } +} + +@Composable +@Preview +private fun SettingsToolbarAmoledPreview() { + AmoledTheme { + SettingsToolbar( + modifier = Modifier.statusBarsPadding(), + onNavigationIconClick = {} + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBox.kt index aa0e18f93..72c2c91b5 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBox.kt @@ -11,6 +11,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource +import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ChainStyle @@ -22,6 +23,7 @@ import org.michaelbel.movies.ui.accessibility.MoviesContentDescription import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.VersionPreviewParameterProvider +import org.michaelbel.movies.ui.theme.AmoledTheme import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -141,4 +143,20 @@ private fun SettingsVersionBoxPreview( .background(MaterialTheme.colorScheme.primaryContainer) ) } +} + +@Composable +@Preview +private fun SettingsVersionBoxAmoledPreview( + @PreviewParameter(VersionPreviewParameterProvider::class) appVersionData: AppVersionData +) { + AmoledTheme { + SettingsVersionBox( + appVersionData = appVersionData, + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() + .background(MaterialTheme.colorScheme.primaryContainer) + ) + } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/res/values-ru/strings.xml b/feature/settings-impl/src/main/res/values-ru/strings.xml index 26f1eb991..d7f07d5b6 100644 --- a/feature/settings-impl/src/main/res/values-ru/strings.xml +++ b/feature/settings-impl/src/main/res/values-ru/strings.xml @@ -4,6 +4,7 @@ По умолчанию Светлая Темная + Amoled Цвета обоев Уведомления Оценить приложение diff --git a/feature/settings-impl/src/main/res/values/strings.xml b/feature/settings-impl/src/main/res/values/strings.xml index 9e642a264..a4cd96579 100644 --- a/feature/settings-impl/src/main/res/values/strings.xml +++ b/feature/settings-impl/src/main/res/values/strings.xml @@ -4,6 +4,7 @@ Follow System Light Dark + Amoled Dynamic Colors Notifications Review diff --git a/instant/src/main/java/org/michaelbel/movies/dynamic/InstantMainActivity.kt b/instant/src/main/java/org/michaelbel/movies/dynamic/InstantMainActivity.kt index 9bdf5f91d..ea5b2bebf 100644 --- a/instant/src/main/java/org/michaelbel/movies/dynamic/InstantMainActivity.kt +++ b/instant/src/main/java/org/michaelbel/movies/dynamic/InstantMainActivity.kt @@ -25,7 +25,7 @@ internal class InstantMainActivity: ComponentActivity() { ) { Text( text = "Hello Movies Instant App!", - color = MaterialTheme.colorScheme.onBackground + color = MaterialTheme.colorScheme.onPrimaryContainer ) } } diff --git a/readme.md b/readme.md index 181566880..b882dc042 100644 --- a/readme.md +++ b/readme.md @@ -51,6 +51,7 @@ TMDB_API_KEY=your_own_tmdb_api_key - [x] CompileSDK 34 - [x] [Material3](https://m3.material.io) - [x] [Dark Theme](https://d.android.com/develop/ui/views/theming/darktheme) +- [x] Amoled Theme - [x] [Material You Dynamic Colors](https://d.android.com/develop/ui/views/theming/dynamic-colors) - [x] [Themed App Icon](https://d.android.com/develop/ui/views/launch/icon_design_adaptive) - [x] [Kotlin](https://d.android.com/kotlin)