diff --git a/androidApp/build.gradle.kts b/androidApp/build.gradle.kts index 3d3a7e02c..ed10758b6 100644 --- a/androidApp/build.gradle.kts +++ b/androidApp/build.gradle.kts @@ -171,7 +171,6 @@ dependencies { testImplementation(libs.bundles.junit.android) androidTestImplementation(libs.bundles.test.espresso.android) androidTestImplementation(libs.bundles.test.ext.junit.android) - androidTestImplementation(libs.bundles.compose.ui.test.android) androidTestImplementation(libs.bundles.benchmark.android) debugImplementation(libs.bundles.leakcanary.android) lintChecks(libs.lint.checks) diff --git a/androidApp/src/main/kotlin/org/michaelbel/sandbox/KotlinSandbox.kt b/androidApp/src/main/kotlin/org/michaelbel/sandbox/KotlinSandbox.kt deleted file mode 100644 index dfc821145..000000000 --- a/androidApp/src/main/kotlin/org/michaelbel/sandbox/KotlinSandbox.kt +++ /dev/null @@ -1,20 +0,0 @@ -package org.michaelbel.sandbox - -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.channels.ReceiveChannel -import kotlinx.coroutines.channels.consumeEach -import kotlinx.coroutines.channels.produce -import kotlinx.coroutines.runBlocking - -fun main() = runBlocking { - fun CoroutineScope.getUsers(): ReceiveChannel = produce { - val users = listOf("Tom", "Bob", "Sam") - for (user in users) { - send(user) - } - } - - getUsers().consumeEach { - it - } -} \ No newline at end of file diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts index 08cf8cc09..221b53e35 100644 --- a/core/ui/build.gradle.kts +++ b/core/ui/build.gradle.kts @@ -44,6 +44,7 @@ kotlin { jvmMain.dependencies { api(compose.desktop.common) api(compose.desktop.currentOs) + api(libs.bundles.compose.desktop) } } diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/NotificationBottomSheet.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/NotificationBottomSheet.kt index 179f600a3..b433540ef 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/NotificationBottomSheet.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/NotificationBottomSheet.kt @@ -39,15 +39,13 @@ 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.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview +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.MoviesTheme -import org.michaelbel.movies.ui.R @Composable fun NotificationBottomSheet( @@ -156,8 +154,8 @@ fun NotificationBottomSheet( } } +@Preview @Composable -@DevicePreviews private fun NotificationBottomSheetPreview() { MoviesTheme { NotificationBottomSheet( @@ -167,19 +165,4 @@ private fun NotificationBottomSheetPreview() { onDismissRequest = {} ) } -} - -@Composable -@Preview -private fun NotificationBottomSheetAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - NotificationBottomSheet( - modifier = Modifier - .fillMaxWidth() - .background(MaterialTheme.colorScheme.primaryContainer), - onDismissRequest = {} - ) - } } \ No newline at end of file diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/VoiceIcon.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/VoiceIcon.kt index 351a17842..75c90d8e5 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/VoiceIcon.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/VoiceIcon.kt @@ -12,11 +12,9 @@ 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.common.theme.AppTheme +import org.jetbrains.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.MoviesTheme @Composable @@ -61,8 +59,8 @@ fun VoiceIcon( } } +@Preview @Composable -@DevicePreviews private fun VoiceIconPreview() { MoviesTheme { VoiceIcon( @@ -70,17 +68,4 @@ private fun VoiceIconPreview() { modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -@Preview -private fun VoiceIconAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - VoiceIcon( - onInputText = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.android.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.android.kt index 2f053d52d..13063b863 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.android.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.android.kt @@ -23,14 +23,12 @@ import androidx.compose.ui.Alignment 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 org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview +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.MoviesTheme -import org.michaelbel.movies.ui.R @Composable fun PageFailure( @@ -79,8 +77,8 @@ fun PageFailure( } } +@Preview @Composable -@DevicePreviews private fun PageFailurePreview() { MoviesTheme { PageFailure( @@ -89,18 +87,4 @@ private fun PageFailurePreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -@Preview -private fun PageFailureAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PageFailure( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.android.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.android.kt index 67a360cda..9db6e493c 100644 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.android.kt +++ b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.android.kt @@ -14,10 +14,9 @@ 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.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.common.appearance.FeedView -import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.network.model.MovieResponse import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.compose.movie.MovieColumn @@ -27,11 +26,6 @@ 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.MoviesTheme @Composable @@ -148,8 +142,8 @@ private fun PageLoadingStaggeredGrid( } } +@Preview @Composable -@DevicePreviews private fun PageLoadingColumnPreview() { MoviesTheme { PageLoadingColumn( @@ -160,22 +154,8 @@ private fun PageLoadingColumnPreview() { } } -@Composable @Preview -private fun PageLoadingColumnAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PageLoadingColumn( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } -} - @Composable -@DeviceLandscapePreviews private fun PageLoadingGridPreview() { MoviesTheme { PageLoadingGrid( @@ -186,22 +166,8 @@ private fun PageLoadingGridPreview() { } } +@Preview @Composable -@DeviceLandscapePreview -private fun PageLoadingGridAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PageLoadingGrid( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } -} - -@Composable -@DeviceUserLandscapePreviews private fun PageLoadingStaggeredGridPreview() { MoviesTheme { PageLoadingStaggeredGrid( @@ -210,18 +176,4 @@ private fun PageLoadingStaggeredGridPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -@DeviceUserPreviews -private fun PageLoadingStaggeredGridAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PageLoadingStaggeredGrid( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DeviceLandscapePreview.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DeviceLandscapePreview.kt deleted file mode 100644 index e698bed3c..000000000 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DeviceLandscapePreview.kt +++ /dev/null @@ -1,9 +0,0 @@ -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/androidMain/kotlin/org/michaelbel/movies/ui/preview/DeviceLandscapePreviews.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DeviceLandscapePreviews.kt deleted file mode 100644 index 6b74e196a..000000000 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DeviceLandscapePreviews.kt +++ /dev/null @@ -1,18 +0,0 @@ -package org.michaelbel.movies.ui.preview - -import android.content.res.Configuration -import androidx.compose.ui.tooling.preview.Preview - -@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 DeviceLandscapePreviews \ No newline at end of file diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DevicePreviews.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DevicePreviews.kt deleted file mode 100644 index b87e3e56b..000000000 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DevicePreviews.kt +++ /dev/null @@ -1,14 +0,0 @@ -package org.michaelbel.movies.ui.preview - -import android.content.res.Configuration -import androidx.compose.ui.tooling.preview.Preview - -@Preview( - name = "Day theme", - uiMode = Configuration.UI_MODE_NIGHT_NO -) -@Preview( - name = "Night theme", - uiMode = Configuration.UI_MODE_NIGHT_YES -) -annotation class DevicePreviews \ No newline at end of file diff --git a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DeviceUserLandscapePreviews.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DeviceUserLandscapePreviews.kt deleted file mode 100644 index 85228e6cb..000000000 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DeviceUserLandscapePreviews.kt +++ /dev/null @@ -1,26 +0,0 @@ -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/androidMain/kotlin/org/michaelbel/movies/ui/preview/DeviceUserPreviews.kt b/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DeviceUserPreviews.kt deleted file mode 100644 index 5012541f7..000000000 --- a/core/ui/src/androidMain/kotlin/org/michaelbel/movies/ui/preview/DeviceUserPreviews.kt +++ /dev/null @@ -1,10 +0,0 @@ -package org.michaelbel.movies.ui.preview - -import androidx.compose.ui.tooling.preview.Preview - -@Preview -@Preview( - widthDp = 800, - heightDp = 360 -) -annotation class DeviceUserPreviews \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/AccountAvatar.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/AccountAvatar.kt index 1f488ba54..a5d3b9ebd 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/AccountAvatar.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/AccountAvatar.kt @@ -18,6 +18,7 @@ import coil3.compose.LocalPlatformContext import coil3.request.ImageRequest import coil3.request.crossfade import org.jetbrains.compose.resources.stringResource +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.persistence.database.ktx.letters import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon @@ -58,8 +59,8 @@ fun AccountAvatar( } } +@Preview @Composable -/*@DevicePreviews*/ private fun AccountAvatarPreview( /*@PreviewParameter(AccountPreviewParameterProvider::class)*/ account: AccountPojo ) { diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/ApiKeyBox.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/ApiKeyBox.kt index c87476826..37020e874 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/ApiKeyBox.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/ApiKeyBox.kt @@ -10,7 +10,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.strings.MoviesStrings import org.michaelbel.movies.ui.theme.MoviesTheme @@ -26,8 +26,8 @@ fun ApiKeyBox( ) } +@Preview @Composable -/*@DevicePreviews*/ private fun ApiKeyBoxPreview() { MoviesTheme { ApiKeyBox( @@ -37,19 +37,4 @@ private fun ApiKeyBoxPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun ApiKeyBoxAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - ApiKeyBox( - modifier = Modifier - .fillMaxWidth() - .padding(vertical = 16.dp) - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/SwitchCheckIcon.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/SwitchCheckIcon.kt index 4fe7c02c9..c464dda32 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/SwitchCheckIcon.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/SwitchCheckIcon.kt @@ -7,7 +7,7 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.material3.SwitchDefaults import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.theme.MoviesTheme @@ -23,22 +23,12 @@ fun SwitchCheckIcon( ) } +@Preview @Composable -/*@DevicePreviews*/ private fun SwitchCheckIconPreview() { MoviesTheme { SwitchCheckIcon( modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun SwitchCheckIconAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - SwitchCheckIcon() - } } \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/BackIcon.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/BackIcon.kt index d53c9f8a5..effd78b6a 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/BackIcon.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/BackIcon.kt @@ -9,7 +9,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.ColorFilter import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.theme.MoviesTheme @@ -32,8 +32,8 @@ fun BackIcon( } } +@Preview @Composable -/*@DevicePreviews*/ private fun BackIconPreview() { MoviesTheme { BackIcon( @@ -41,17 +41,4 @@ private fun BackIconPreview() { modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun BackIconAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - BackIcon( - onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/CloseIcon.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/CloseIcon.kt index dc441db61..b45846c9a 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/CloseIcon.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/CloseIcon.kt @@ -8,7 +8,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.theme.MoviesTheme @@ -30,8 +30,8 @@ fun CloseIcon( } } +@Preview @Composable -/*@DevicePreviews*/ private fun CloseIconPreview() { MoviesTheme { CloseIcon( @@ -39,17 +39,4 @@ private fun CloseIconPreview() { modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun CloseIconAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - CloseIcon( - onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/DownloadIcon.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/DownloadIcon.kt index 58bac4969..b9378c9d1 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/DownloadIcon.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/DownloadIcon.kt @@ -8,7 +8,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.theme.MoviesTheme @@ -30,8 +30,8 @@ fun DownloadIcon( } } +@Preview @Composable -/*@DevicePreviews*/ private fun DownloadIconPreview() { MoviesTheme { DownloadIcon( @@ -39,17 +39,4 @@ private fun DownloadIconPreview() { modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun DownloadIconAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - DownloadIcon( - onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/PasswordIcon.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/PasswordIcon.kt index 4a6d42adb..2aef54072 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/PasswordIcon.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/PasswordIcon.kt @@ -8,7 +8,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.theme.MoviesTheme @@ -31,8 +31,8 @@ fun PasswordIcon( } } +@Preview @Composable -/*@DevicePreviews*/ private fun PasswordIconPreview( /*@PreviewParameter(BooleanPreviewParameterProvider::class)*/ state: Boolean ) { @@ -43,20 +43,4 @@ private fun PasswordIconPreview( modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun PasswordIconAmoledPreview( - /*@PreviewParameter(BooleanPreviewParameterProvider::class)*/ state: Boolean -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PasswordIcon( - state = state, - onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SearchIcon.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SearchIcon.kt index ce39e473c..34ada374d 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SearchIcon.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SearchIcon.kt @@ -8,7 +8,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.theme.MoviesTheme @@ -30,8 +30,8 @@ fun SearchIcon( } } +@Preview @Composable -/*@DevicePreviews*/ private fun SearchIconPreview() { MoviesTheme { SearchIcon( @@ -39,17 +39,4 @@ private fun SearchIconPreview() { modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun SearchIconAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - SearchIcon( - onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SettingsIcon.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SettingsIcon.kt index b91942da0..c22f45184 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SettingsIcon.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/SettingsIcon.kt @@ -8,7 +8,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.theme.MoviesTheme @@ -30,8 +30,8 @@ fun SettingsIcon( } } +@Preview @Composable -/*@DevicePreviews*/ private fun SettingsIconPreview() { MoviesTheme { SettingsIcon( @@ -39,17 +39,4 @@ private fun SettingsIconPreview() { modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun SettingsIconAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - SettingsIcon( - onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/ShareIcon.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/ShareIcon.kt index af11838b5..4ce652b9a 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/ShareIcon.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/iconbutton/ShareIcon.kt @@ -9,7 +9,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.ColorFilter import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.ktx.url import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon @@ -35,8 +35,8 @@ fun ShareIcon( } } +@Preview @Composable -/*@DevicePreviews*/ private fun ShareIconPreview( /*@PreviewParameter(MovieDbPreviewParameterProvider::class)*/ movie: MoviePojo ) { @@ -47,20 +47,4 @@ private fun ShareIconPreview( modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun ShareIconAmoledPreview( - /*@PreviewParameter(MovieDbPreviewParameterProvider::class)*/ movie: MoviePojo -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - ShareIcon( - url = movie.url, - onShareClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumn.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumn.kt index cbc2e52bb..27e0093b7 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumn.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumn.kt @@ -26,7 +26,7 @@ import coil3.request.crossfade import movies.core.ui.generated.resources.Res import movies.core.ui.generated.resources.no_image import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.network.config.formatPosterImage import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon @@ -100,6 +100,7 @@ internal fun MovieColumn( } } +@Preview @Composable private fun MovieColumnPreview( /*@PreviewParameter(MoviePreviewParameterProvider::class)*/ movie: MoviePojo @@ -114,22 +115,4 @@ private fun MovieColumnPreview( .background(MaterialTheme.colorScheme.inversePrimary) ) } -} - -@Composable -private fun MovieColumnAmoledPreview( - /*@PreviewParameter(MoviePreviewParameterProvider::class)*/ movie: MoviePojo -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - 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/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumnDesktop.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumnDesktop.kt index b9c2439d4..51326965f 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumnDesktop.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieColumnDesktop.kt @@ -28,6 +28,7 @@ import coil3.request.crossfade import movies.core.ui.generated.resources.Res import movies.core.ui.generated.resources.no_image import org.jetbrains.compose.resources.stringResource +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.network.config.formatPosterImage import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon @@ -101,6 +102,7 @@ internal fun MovieColumnDesktop( } } +@Preview @Composable private fun MovieColumnDesktopPreview( /*@PreviewParameter(MoviePreviewParameterProvider::class)*/ movie: MoviePojo diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRow.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRow.kt index 02608f07b..dc7a891d3 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRow.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRow.kt @@ -24,7 +24,7 @@ import coil3.compose.LocalPlatformContext import coil3.request.ImageRequest import coil3.request.crossfade import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.network.config.formatBackdropImage import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon @@ -100,6 +100,7 @@ internal fun MovieRow( } } +@Preview @Composable private fun MovieRowPreview( /*@PreviewParameter(MoviePreviewParameterProvider::class)*/ movie: MoviePojo @@ -114,22 +115,4 @@ private fun MovieRowPreview( .background(MaterialTheme.colorScheme.inversePrimary) ) } -} - -@Composable -private fun MovieRowAmoledPreview( - /*@PreviewParameter(MoviePreviewParameterProvider::class)*/ movie: MoviePojo -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - 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/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRowDesktop.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRowDesktop.kt index 1095b6d5b..c5f0e0d14 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRowDesktop.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/movie/MovieRowDesktop.kt @@ -26,6 +26,7 @@ import coil3.compose.LocalPlatformContext import coil3.request.ImageRequest import coil3.request.crossfade import org.jetbrains.compose.resources.stringResource +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.network.config.formatBackdropImage import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon @@ -101,6 +102,7 @@ internal fun MovieRowDesktop( } } +@Preview @Composable private fun MovieRowDesktopPreview( /*@PreviewParameter(MoviePreviewParameterProvider::class)*/ movie: MoviePojo diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/page/PagingFailureBox.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/page/PagingFailureBox.kt index 25dfccb2e..8ed3c7d04 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/page/PagingFailureBox.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/page/PagingFailureBox.kt @@ -12,7 +12,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.strings.MoviesStrings import org.michaelbel.movies.ui.theme.MoviesTheme @@ -32,8 +32,8 @@ internal fun PagingFailureBox( } } +@Preview @Composable -/*@DevicePreviews*/ private fun PagingFailureBoxPreview() { MoviesTheme { PagingFailureBox( @@ -43,19 +43,4 @@ private fun PagingFailureBoxPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun PagingFailureBoxAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PagingFailureBox( - modifier = Modifier - .fillMaxWidth() - .height(100.dp) - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/page/PagingLoadingBox.kt b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/page/PagingLoadingBox.kt index 955039732..0ddf8ac54 100644 --- a/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/page/PagingLoadingBox.kt +++ b/core/ui/src/commonMain/kotlin/org/michaelbel/movies/ui/compose/page/PagingLoadingBox.kt @@ -11,7 +11,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -27,8 +27,8 @@ internal fun PagingLoadingBox( } } +@Preview @Composable -/*@DevicePreviews*/ private fun PagingLoadingBoxPreview() { MoviesTheme { PagingLoadingBox( @@ -38,19 +38,4 @@ private fun PagingLoadingBoxPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun PagingLoadingBoxAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PagingLoadingBox( - modifier = Modifier - .fillMaxWidth() - .height(100.dp) - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.ios.kt b/core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.ios.kt index 851125346..1d528635d 100644 --- a/core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.ios.kt +++ b/core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.ios.kt @@ -19,7 +19,7 @@ import androidx.compose.ui.unit.dp import movies.core.ui.generated.resources.Res import movies.core.ui.generated.resources.error_loading import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.theme.MoviesTheme @@ -52,8 +52,8 @@ fun PageFailure( } } +@Preview @Composable -/*@DevicePreviews*/ private fun PageFailurePreview() { MoviesTheme { PageFailure( @@ -62,18 +62,4 @@ private fun PageFailurePreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun PageFailureAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PageFailure( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.ios.kt b/core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.ios.kt index a89d8203b..9db6e493c 100644 --- a/core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.ios.kt +++ b/core/ui/src/iosMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.ios.kt @@ -15,8 +15,8 @@ import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.common.appearance.FeedView -import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.network.model.MovieResponse import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.compose.movie.MovieColumn @@ -142,8 +142,8 @@ private fun PageLoadingStaggeredGrid( } } +@Preview @Composable -/*@DevicePreviews*/ private fun PageLoadingColumnPreview() { MoviesTheme { PageLoadingColumn( @@ -154,22 +154,8 @@ private fun PageLoadingColumnPreview() { } } +@Preview @Composable -/*@Preview*/ -private fun PageLoadingColumnAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PageLoadingColumn( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } -} - -@Composable -/*@DeviceLandscapePreviews*/ private fun PageLoadingGridPreview() { MoviesTheme { PageLoadingGrid( @@ -180,22 +166,8 @@ private fun PageLoadingGridPreview() { } } +@Preview @Composable -/*@DeviceLandscapePreview*/ -private fun PageLoadingGridAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PageLoadingGrid( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } -} - -@Composable -/*@DeviceUserLandscapePreviews*/ private fun PageLoadingStaggeredGridPreview() { MoviesTheme { PageLoadingStaggeredGrid( @@ -204,18 +176,4 @@ private fun PageLoadingStaggeredGridPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@DeviceUserPreviews*/ -private fun PageLoadingStaggeredGridAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PageLoadingStaggeredGrid( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.desktop.kt b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.desktop.kt index 851125346..75f10cc03 100644 --- a/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.desktop.kt +++ b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageFailure.desktop.kt @@ -1,5 +1,6 @@ package org.michaelbel.movies.ui.compose.page +import androidx.compose.desktop.ui.tooling.preview.Preview import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column @@ -19,7 +20,6 @@ import androidx.compose.ui.unit.dp import movies.core.ui.generated.resources.Res import movies.core.ui.generated.resources.error_loading import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.theme.MoviesTheme @@ -52,8 +52,8 @@ fun PageFailure( } } +@Preview @Composable -/*@DevicePreviews*/ private fun PageFailurePreview() { MoviesTheme { PageFailure( @@ -62,18 +62,4 @@ private fun PageFailurePreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun PageFailureAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PageFailure( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.desktop.kt b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.desktop.kt index 7d37bc3b9..a6e3e6e20 100644 --- a/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.desktop.kt +++ b/core/ui/src/jvmMain/kotlin/org/michaelbel/movies/ui/compose/page/PageLoading.desktop.kt @@ -1,5 +1,6 @@ package org.michaelbel.movies.ui.compose.page +import androidx.compose.desktop.ui.tooling.preview.Preview import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.PaddingValues @@ -16,7 +17,6 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import org.michaelbel.movies.common.appearance.FeedView -import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.network.model.MovieResponse import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.compose.movie.MovieColumnDesktop @@ -141,8 +141,8 @@ private fun PageLoadingStaggeredGrid( } } +@Preview @Composable -/*@DevicePreviews*/ private fun PageLoadingColumnPreview() { MoviesTheme { PageLoadingColumn( @@ -153,22 +153,8 @@ private fun PageLoadingColumnPreview() { } } +@Preview @Composable -/*@Preview*/ -private fun PageLoadingColumnAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PageLoadingColumn( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } -} - -@Composable -/*@DeviceLandscapePreviews*/ private fun PageLoadingGridPreview() { MoviesTheme { PageLoadingGrid( @@ -179,22 +165,8 @@ private fun PageLoadingGridPreview() { } } +@Preview @Composable -/*@DeviceLandscapePreview*/ -private fun PageLoadingGridAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PageLoadingGrid( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } -} - -@Composable -/*@DeviceUserLandscapePreviews*/ private fun PageLoadingStaggeredGridPreview() { MoviesTheme { PageLoadingStaggeredGrid( @@ -203,18 +175,4 @@ private fun PageLoadingStaggeredGridPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@DeviceUserPreviews*/ -private fun PageLoadingStaggeredGridAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - PageLoadingStaggeredGrid( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountCountryBox.kt b/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountCountryBox.kt index 90168f931..663768270 100644 --- a/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountCountryBox.kt +++ b/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountCountryBox.kt @@ -15,7 +15,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.theme.MoviesTheme @@ -46,8 +46,8 @@ internal fun AccountCountryBox( } } +@Preview @Composable -/*@DevicePreviews*/ private fun AccountCountryBoxPreview() { MoviesTheme { AccountCountryBox( @@ -57,19 +57,4 @@ private fun AccountCountryBoxPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun AccountCountryBoxAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - AccountCountryBox( - country = "Finland", - modifier = Modifier - .fillMaxWidth() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt b/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt index 77e2b5ed6..fb0494fa5 100644 --- a/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt +++ b/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt @@ -23,7 +23,7 @@ import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension import org.jetbrains.compose.resources.painterResource import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.compose.AccountAvatar @@ -174,8 +174,8 @@ internal fun AccountScreenContent( } } +@Preview @Composable -/*@DevicePreviews*/ private fun AccountScreenContentPreview() { MoviesTheme { AccountScreenContent( @@ -193,27 +193,4 @@ private fun AccountScreenContentPreview() { onLogoutClick = {} ) } -} - -@Composable -/*@Preview*/ -private fun AccountScreenContentAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - AccountScreenContent( - account = AccountPojo( - 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/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountToolbar.kt b/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountToolbar.kt index 14a9bfec6..f9b320d5a 100644 --- a/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountToolbar.kt +++ b/feature/account-impl/src/commonMain/kotlin/org/michaelbel/movies/account/ui/AccountToolbar.kt @@ -13,7 +13,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextOverflow import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.compose.iconbutton.CloseIcon import org.michaelbel.movies.ui.strings.MoviesStrings import org.michaelbel.movies.ui.theme.MoviesTheme @@ -41,8 +41,8 @@ internal fun AccountToolbar( ) } +@Preview @Composable -/*@DevicePreviews*/ private fun AccountToolbarPreview() { MoviesTheme { AccountToolbar( @@ -50,17 +50,4 @@ private fun AccountToolbarPreview() { onNavigationIconClick = {} ) } -} - -@Composable -/*@Preview*/ -private fun AccountToolbarAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - AccountToolbar( - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer), - onNavigationIconClick = {} - ) - } } \ No newline at end of file diff --git a/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthLinksBox.kt b/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthLinksBox.kt index 5542622bb..a117f927a 100644 --- a/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthLinksBox.kt +++ b/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthLinksBox.kt @@ -17,7 +17,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.unit.dp import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.ktx.clickableWithoutRipple import org.michaelbel.movies.ui.strings.MoviesStrings import org.michaelbel.movies.ui.theme.MoviesTheme @@ -69,8 +69,8 @@ fun AuthLinksBox( } } +@Preview @Composable -/*@DevicePreviews*/ private fun AuthLinksBoxPreview() { MoviesTheme { AuthLinksBox( @@ -79,18 +79,4 @@ private fun AuthLinksBoxPreview() { modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun AuthLinksBoxAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - AuthLinksBox( - onTermsOfUseClick = {}, - onPrivacyPolicyClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt b/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt index 61c2d1b3e..6fbf68e78 100644 --- a/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt +++ b/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt @@ -37,9 +37,9 @@ import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension import org.jetbrains.compose.resources.painterResource import org.jetbrains.compose.resources.stringResource +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.auth.ktx.text import org.michaelbel.movies.common.exceptions.CreateSessionWithLoginException -import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.interactor.entity.Password import org.michaelbel.movies.interactor.entity.Username import org.michaelbel.movies.interactor.ktx.PasswordSaver @@ -327,8 +327,8 @@ internal fun AuthScreenContent( } } +@Preview @Composable -/*@DevicePreviews*/ private fun AuthScreenContentPreview() { MoviesTheme { AuthScreenContent( @@ -344,25 +344,4 @@ private fun AuthScreenContentPreview() { modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun AuthScreenContentAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - AuthScreenContent( - error = null, - signInLoading = false, - loginLoading = false, - requestToken = null, - onBackClick = {}, - onSignInClick = { _,_ -> }, - onLoginClick = {}, - onResetRequestToken = {}, - onUrlClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthToolbar.kt b/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthToolbar.kt index 45bf32162..f4109db96 100644 --- a/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthToolbar.kt +++ b/feature/auth-impl/src/commonMain/kotlin/org/michaelbel/movies/auth/ui/AuthToolbar.kt @@ -13,7 +13,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextOverflow import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.compose.iconbutton.CloseIcon import org.michaelbel.movies.ui.strings.MoviesStrings import org.michaelbel.movies.ui.theme.MoviesTheme @@ -41,8 +41,8 @@ fun AuthToolbar( ) } +@Preview @Composable -/*@DevicePreviews*/ private fun AuthToolbarPreview() { MoviesTheme { AuthToolbar( @@ -50,17 +50,4 @@ private fun AuthToolbarPreview() { onNavigationIconClick = {} ) } -} - -@Composable -/*@Preview*/ -private fun AuthToolbarAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - AuthToolbar( - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer), - onNavigationIconClick = {} - ) - } } \ No newline at end of file diff --git a/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.android.kt b/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.android.kt index d6bf9569c..f9d43a73a 100644 --- a/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.android.kt +++ b/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.android.kt @@ -33,7 +33,6 @@ import coil.compose.AsyncImage import coil.compose.AsyncImagePainter import coil.request.ImageRequest import coil.request.SuccessResult -import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.network.config.formatBackdropImage import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.ktx.isNotEmpty @@ -41,7 +40,6 @@ import org.michaelbel.movies.ui.accessibility.MoviesContentDescription 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.DevicePreviews import org.michaelbel.movies.ui.preview.provider.MovieDbPreviewParameterProvider import org.michaelbel.movies.ui.theme.MoviesTheme @@ -164,8 +162,8 @@ internal fun DetailsContent( } } +@Preview @Composable -@DevicePreviews private fun DetailsContentPreview( @PreviewParameter(MovieDbPreviewParameterProvider::class) movie: MoviePojo ) { @@ -179,23 +177,4 @@ private fun DetailsContentPreview( onGenerateColors = { _,_ -> } ) } -} - -@Composable -@Preview -private fun DetailsContentAmoledPreview( - @PreviewParameter(MovieDbPreviewParameterProvider::class) movie: MoviePojo -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - DetailsContent( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer), - movie = movie, - onNavigateToGallery = {}, - onGenerateColors = { _,_ -> } - ) - } } \ No newline at end of file diff --git a/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.android.kt b/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.android.kt index 286ba5441..9013cf845 100644 --- a/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.android.kt +++ b/feature/details-impl/src/androidMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.android.kt @@ -6,9 +6,7 @@ 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.common.theme.AppTheme import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo -import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -24,8 +22,8 @@ internal fun DetailsLoading( ) } +@Preview @Composable -@DevicePreviews private fun DetailsLoadingPreview() { MoviesTheme { DetailsLoading( @@ -34,18 +32,4 @@ private fun DetailsLoadingPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -@Preview -private fun DetailsLoadingAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - DetailsLoading( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/feature/details-impl/src/commonMain/kotlin/org/michaelbel/movies/details/ui/DetailsFailure.kt b/feature/details-impl/src/commonMain/kotlin/org/michaelbel/movies/details/ui/DetailsFailure.kt index 30cff9ceb..b9d6c50e6 100644 --- a/feature/details-impl/src/commonMain/kotlin/org/michaelbel/movies/details/ui/DetailsFailure.kt +++ b/feature/details-impl/src/commonMain/kotlin/org/michaelbel/movies/details/ui/DetailsFailure.kt @@ -12,7 +12,7 @@ import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.strings.MoviesStrings @@ -56,8 +56,8 @@ internal fun DetailsFailure( } } +@Preview @Composable -/*@DevicePreviews*/ private fun DetailsFailurePreview() { MoviesTheme { DetailsFailure( @@ -66,18 +66,4 @@ private fun DetailsFailurePreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun DetailsFailureAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - DetailsFailure( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/feature/details-impl/src/commonMain/kotlin/org/michaelbel/movies/details/ui/DetailsToolbar.kt b/feature/details-impl/src/commonMain/kotlin/org/michaelbel/movies/details/ui/DetailsToolbar.kt index e3f4b279c..7829eaef8 100644 --- a/feature/details-impl/src/commonMain/kotlin/org/michaelbel/movies/details/ui/DetailsToolbar.kt +++ b/feature/details-impl/src/commonMain/kotlin/org/michaelbel/movies/details/ui/DetailsToolbar.kt @@ -15,7 +15,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextOverflow -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.compose.iconbutton.BackIcon import org.michaelbel.movies.ui.compose.iconbutton.ShareIcon import org.michaelbel.movies.ui.ktx.modifierDisplayCutoutWindowInsets @@ -71,8 +71,8 @@ internal fun DetailsToolbar( ) } +@Preview @Composable -/*@DevicePreviews*/ private fun DetailsToolbarPreview( /*@PreviewParameter(TitlePreviewParameterProvider::class)*/ title: String ) { @@ -86,23 +86,4 @@ private fun DetailsToolbarPreview( modifier = Modifier.statusBarsPadding() ) } -} - -@Composable -/*@Preview*/ -private fun DetailsToolbarAmoledPreview( - /*@PreviewParameter(TitlePreviewParameterProvider::class)*/ title: String -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - DetailsToolbar( - movieTitle = title, - movieUrl = null, - onNavigationIconClick = {}, - onShareClick = {}, - topAppBarScrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(), - modifier = Modifier.statusBarsPadding() - ) - } } \ No newline at end of file diff --git a/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.ios.kt b/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.ios.kt index 9ab8ab447..24f9ddfa0 100644 --- a/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.ios.kt +++ b/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.ios.kt @@ -25,7 +25,7 @@ import coil3.compose.LocalPlatformContext import coil3.request.ImageRequest import coil3.request.crossfade import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.network.config.formatBackdropImage import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.ktx.isNotEmpty @@ -127,8 +127,8 @@ internal fun DetailsContent( } } +@Preview @Composable -/*@DevicePreviews*/ private fun DetailsContentPreview( /*@PreviewParameter(MovieDbPreviewParameterProvider::class)*/ movie: MoviePojo ) { @@ -141,22 +141,4 @@ private fun DetailsContentPreview( onNavigateToGallery = {} ) } -} - -@Composable -/*@Preview*/ -private fun DetailsContentAmoledPreview( - /*@PreviewParameter(MovieDbPreviewParameterProvider::class)*/ movie: MoviePojo -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - DetailsContent( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer), - movie = movie, - onNavigateToGallery = {} - ) - } } \ No newline at end of file diff --git a/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.ios.kt b/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.ios.kt index 4413c422c..6d0140405 100644 --- a/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.ios.kt +++ b/feature/details-impl/src/iosMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.ios.kt @@ -5,7 +5,7 @@ import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.theme.MoviesTheme @@ -21,6 +21,7 @@ internal fun DetailsLoading( ) } +@Preview @Composable /*@DevicePreviews*/ private fun DetailsLoadingPreview() { @@ -31,18 +32,4 @@ private fun DetailsLoadingPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun DetailsLoadingAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - DetailsLoading( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.desktop.kt b/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.desktop.kt index 5b07f2a41..8929dbd8e 100644 --- a/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.desktop.kt +++ b/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsContent.desktop.kt @@ -1,5 +1,6 @@ package org.michaelbel.movies.details.ui +import androidx.compose.desktop.ui.tooling.preview.Preview import androidx.compose.foundation.background import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.rememberScrollState @@ -26,7 +27,6 @@ import coil3.compose.LocalPlatformContext import coil3.request.ImageRequest import coil3.request.crossfade import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.network.config.formatBackdropImage import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.ktx.isNotEmpty @@ -128,8 +128,8 @@ internal fun DetailsContent( } } +@Preview @Composable -/*@DevicePreviews*/ private fun DetailsContentPreview( /*@PreviewParameter(MovieDbPreviewParameterProvider::class)*/ movie: MoviePojo ) { @@ -142,22 +142,4 @@ private fun DetailsContentPreview( onNavigateToGallery = {} ) } -} - -@Composable -/*@Preview*/ -private fun DetailsContentAmoledPreview( - /*@PreviewParameter(MovieDbPreviewParameterProvider::class)*/ movie: MoviePojo -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - DetailsContent( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer), - movie = movie, - onNavigateToGallery = {} - ) - } } \ No newline at end of file diff --git a/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.desktop.kt b/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.desktop.kt index 4413c422c..506502f96 100644 --- a/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.desktop.kt +++ b/feature/details-impl/src/jvmMain/kotlin/org/michaelbel/movies/details/ui/DetailsLoading.desktop.kt @@ -1,11 +1,11 @@ package org.michaelbel.movies.details.ui +import androidx.compose.desktop.ui.tooling.preview.Preview import androidx.compose.foundation.background import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier -import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.theme.MoviesTheme @@ -21,8 +21,8 @@ internal fun DetailsLoading( ) } +@Preview @Composable -/*@DevicePreviews*/ private fun DetailsLoadingPreview() { MoviesTheme { DetailsLoading( @@ -31,18 +31,4 @@ private fun DetailsLoadingPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun DetailsLoadingAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - DetailsLoading( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedEmpty.kt b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedEmpty.kt index 8090abf97..13fb84de1 100644 --- a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedEmpty.kt +++ b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedEmpty.kt @@ -12,7 +12,7 @@ import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.strings.MoviesStrings @@ -56,8 +56,8 @@ internal fun FeedEmpty( } } +@Preview @Composable -/*@DevicePreviews*/ private fun FeedEmptyPreview() { MoviesTheme { FeedEmpty( @@ -66,18 +66,4 @@ private fun FeedEmptyPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun FeedEmptyAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - FeedEmpty( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt index 9462922c3..f2197fe84 100644 --- a/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt +++ b/feature/feed-impl/src/commonMain/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt @@ -24,7 +24,7 @@ import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.persistence.database.entity.pojo.AccountPojo import org.michaelbel.movies.persistence.database.ktx.isEmpty import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon @@ -118,8 +118,8 @@ internal fun FeedToolbar( } } +@Preview @Composable -/*@DevicePreviews*/ private fun FeedToolbarPreview() { MoviesTheme { FeedToolbar( @@ -136,26 +136,4 @@ private fun FeedToolbarPreview() { modifier = Modifier.statusBarsPadding() ) } -} - -@Composable -/*@Preview*/ -private fun FeedToolbarAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - FeedToolbar( - title = "Not Playing", - account = AccountPojo.Empty, - isTmdbApiKeyEmpty = true, - isSearchIconVisible = true, - onSearchIconClick = {}, - onAccountIconClick = {}, - isAuthIconVisible = true, - onAuthIconClick = {}, - onSettingsIconClick = {}, - topAppBarScrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(), - modifier = Modifier.statusBarsPadding() - ) - } } \ No newline at end of file diff --git a/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryLoading.kt b/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryLoading.kt index 8307e7cc3..a624c2b53 100644 --- a/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryLoading.kt +++ b/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryLoading.kt @@ -8,8 +8,6 @@ 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.common.theme.AppTheme -import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -26,24 +24,12 @@ internal fun GalleryLoading( } } +@Preview @Composable -@DevicePreviews private fun GalleryLoadingPreview() { MoviesTheme { GalleryLoading( modifier = Modifier.fillMaxSize() ) } -} - -@Composable -@Preview -private fun GalleryLoadingAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - GalleryLoading( - modifier = Modifier.fillMaxSize() - ) - } } \ No newline at end of file diff --git a/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryScreenContent.kt b/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryScreenContent.kt index 2b3763563..fe5027c90 100644 --- a/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryScreenContent.kt +++ b/feature/gallery-impl/src/androidMain/kotlin/org/michaelbel/movies/gallery/ui/GalleryScreenContent.kt @@ -46,7 +46,6 @@ import coil.compose.AsyncImage import coil.compose.AsyncImagePainter import coil.request.ImageRequest import kotlinx.coroutines.launch -import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.gallery.zoomable.rememberZoomState import org.michaelbel.movies.gallery.zoomable.zoomable import org.michaelbel.movies.gallery_impl.R @@ -57,7 +56,6 @@ 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.MoviesTheme import org.michaelbel.movies.work.DownloadImageWorker @@ -283,8 +281,8 @@ internal fun GalleryScreenContent( } } +@Preview @Composable -@DevicePreviews private fun GalleryScreenContentPreview() { MoviesTheme { GalleryScreenContent( @@ -295,20 +293,4 @@ private fun GalleryScreenContentPreview() { modifier = Modifier.fillMaxSize() ) } -} - -@Composable -@Preview -private fun GalleryScreenContentAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - GalleryScreenContent( - movieImages = emptyList(), - workInfo = null, - onBackClick = {}, - onDownloadClick = {}, - modifier = Modifier.fillMaxSize() - ) - } } \ No newline at end of file diff --git a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchEmpty.kt b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchEmpty.kt index ffe6a015c..2748e8b78 100644 --- a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchEmpty.kt +++ b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchEmpty.kt @@ -18,11 +18,9 @@ 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.common.theme.AppTheme 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.MoviesTheme @Composable @@ -53,8 +51,8 @@ internal fun SearchEmpty( } } +@Preview @Composable -@DevicePreviews private fun SearchEmptyPreview() { MoviesTheme { SearchEmpty( @@ -63,18 +61,4 @@ private fun SearchEmptyPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -@Preview -private fun SearchEmptyAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - SearchEmpty( - modifier = Modifier - .fillMaxSize() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchHistoryHeader.kt b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchHistoryHeader.kt index ea8762a2b..5bf7ab7de 100644 --- a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchHistoryHeader.kt +++ b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchHistoryHeader.kt @@ -14,9 +14,7 @@ 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.common.theme.AppTheme import org.michaelbel.movies.search_impl.R -import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.theme.MoviesTheme @Composable @@ -59,8 +57,8 @@ internal fun SearchHistoryHeader( } } +@Preview @Composable -@DevicePreviews private fun SearchHistoryHeaderPreview() { MoviesTheme { SearchHistoryHeader( @@ -71,20 +69,4 @@ private fun SearchHistoryHeaderPreview() { .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -@Preview -private fun SearchHistoryHeaderAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - 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/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchRe\321\201entResult.kt" "b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchRe\321\201entResult.kt" index 4f40b24c3..a23366af6 100644 --- "a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchRe\321\201entResult.kt" +++ "b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchRe\321\201entResult.kt" @@ -16,12 +16,10 @@ import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension -import org.michaelbel.movies.common.theme.AppTheme import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.ui.accessibility.MoviesContentDescription 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.MoviesTheme @@ -78,8 +76,8 @@ internal fun SearchRecentResult( } } +@Preview @Composable -@DevicePreviews private fun SearchRecentResultPreview( @PreviewParameter(MoviePreviewParameterProvider::class) movie: MoviePojo ) { @@ -93,23 +91,4 @@ private fun SearchRecentResultPreview( .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -@Preview -private fun SearchRecentResultAmoledPreview( - @PreviewParameter(MoviePreviewParameterProvider::class) movie: MoviePojo -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - 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/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchSuggestion.kt b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchSuggestion.kt index 9b7b06dec..2297a20ed 100644 --- a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchSuggestion.kt +++ b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchSuggestion.kt @@ -15,9 +15,7 @@ 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.common.theme.AppTheme import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo -import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.SuggestionDbPreviewParameterProvider import org.michaelbel.movies.ui.theme.MoviesTheme @@ -40,8 +38,8 @@ internal fun SearchSuggestion( } } +@Preview @Composable -@DevicePreviews private fun SearchSuggestionPreview( @PreviewParameter(SuggestionDbPreviewParameterProvider::class) suggestions: List ) { @@ -54,22 +52,4 @@ private fun SearchSuggestionPreview( .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -@Preview -private fun SearchSuggestionAmoledPreview( - @PreviewParameter(SuggestionDbPreviewParameterProvider::class) suggestions: List -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - 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/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchToolbar.kt b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchToolbar.kt index 6375c934d..554c1ee01 100644 --- a/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchToolbar.kt +++ b/feature/search-impl/src/androidMain/kotlin/org/michaelbel/movies/search/ui/SearchToolbar.kt @@ -23,7 +23,6 @@ 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 import org.michaelbel.movies.persistence.database.entity.pojo.MoviePojo import org.michaelbel.movies.persistence.database.entity.pojo.SuggestionPojo import org.michaelbel.movies.persistence.database.typealiases.MovieId @@ -32,7 +31,6 @@ import org.michaelbel.movies.search_impl.R import org.michaelbel.movies.ui.compose.iconbutton.BackIcon import org.michaelbel.movies.ui.compose.iconbutton.CloseIcon import org.michaelbel.movies.ui.compose.iconbutton.VoiceIcon -import org.michaelbel.movies.ui.preview.DevicePreviews import org.michaelbel.movies.ui.preview.provider.SuggestionDbPreviewParameterProvider import org.michaelbel.movies.ui.theme.MoviesTheme @@ -147,8 +145,8 @@ internal fun SearchToolbar( } } +@Preview @Composable -@DevicePreviews private fun SearchToolbarPreview( @PreviewParameter(SuggestionDbPreviewParameterProvider::class) suggestions: List ) { @@ -168,29 +166,4 @@ private fun SearchToolbarPreview( onClearHistoryClick = {} ) } -} - -@Composable -@Preview -private fun SearchToolbarAmoledPreview( - @PreviewParameter(SuggestionDbPreviewParameterProvider::class) suggestions: List -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - SearchToolbar( - query = "Napoleon", - onQueryChange = {}, - onSearch = {}, - active = true, - onActiveChange = {}, - onBackClick = {}, - onCloseClick = {}, - onInputText = {}, - suggestions = suggestions, - searchHistoryMovies = emptyList(), - onHistoryMovieRemoveClick = {}, - onClearHistoryClick = {} - ) - } } \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsToolbar.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsToolbar.kt index 59689129d..ca43bd937 100644 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsToolbar.kt +++ b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsToolbar.kt @@ -12,7 +12,7 @@ import androidx.compose.material3.TopAppBarScrollBehavior import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.compose.iconbutton.BackIcon import org.michaelbel.movies.ui.ktx.clickableWithoutRipple import org.michaelbel.movies.ui.ktx.modifierDisplayCutoutWindowInsets @@ -48,8 +48,8 @@ internal fun SettingsToolbar( ) } +@Preview @Composable -/*@DevicePreviews*/ private fun SettingsToolbarPreview() { MoviesTheme { SettingsToolbar( @@ -58,18 +58,4 @@ private fun SettingsToolbarPreview() { onClick = {} ) } -} - -@Composable -/*@Preview*/ -private fun SettingsToolbarAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - SettingsToolbar( - modifier = Modifier.statusBarsPadding(), - onNavigationIconClick = {}, - onClick = {} - ) - } } \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBox.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBox.kt index 907d67542..4e4616512 100644 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBox.kt +++ b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBox.kt @@ -14,7 +14,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.common.version.AppVersionData import org.michaelbel.movies.settings.model.SettingsData import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon @@ -69,8 +69,8 @@ internal fun SettingsVersionBox( } } +@Preview @Composable -/*@DevicePreviews*/ private fun SettingsVersionBoxPreview( /*@PreviewParameter(VersionPreviewParameterProvider::class)*/ appVersionData: AppVersionData ) { @@ -89,28 +89,4 @@ private fun SettingsVersionBoxPreview( .background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun SettingsVersionBoxAmoledPreview( - /*@PreviewParameter(VersionPreviewParameterProvider::class)*/ appVersionData: AppVersionData -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - SettingsVersionBox( - aboutData = SettingsData.AboutData( - isFeatureEnabled = true, - versionName = "1.0.0", - versionCode = 1, - flavor = "GMS", - isDebug = true, - ), - modifier = Modifier - .fillMaxWidth() - .wrapContentHeight() - .background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingAppIcon.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingAppIcon.kt index 308584dfb..55c09d78b 100644 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingAppIcon.kt +++ b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingAppIcon.kt @@ -23,7 +23,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import org.jetbrains.compose.resources.painterResource import org.jetbrains.compose.resources.stringResource -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.appicon.IconAlias import org.michaelbel.movies.ui.icons.MoviesIcons @@ -84,8 +84,8 @@ internal fun RowScope.SettingAppIcon( } } +@Preview @Composable -/*@DevicePreviews*/ private fun SettingAppIconPreview( /*@PreviewParameter(IconAliasPreviewParameterProvider::class)*/ iconAlias: IconAlias ) { @@ -98,22 +98,4 @@ private fun SettingAppIconPreview( ) } } -} - -@Composable -/*@Preview*/ -private fun SettingAppIconAmoledPreview( - /*@PreviewParameter(IconAliasPreviewParameterProvider::class)*/ iconAlias: IconAlias -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - Row { - SettingAppIcon( - iconAlias = iconAlias, - isEnabled = true, - onClick = {} - ) - } - } } \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingDialog.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingDialog.kt index bddf7d928..3943b53d9 100644 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingDialog.kt +++ b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingDialog.kt @@ -22,10 +22,14 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.unit.dp import org.jetbrains.compose.resources.stringResource +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.common.SealedString +import org.michaelbel.movies.interactor.entity.AppLanguage import org.michaelbel.movies.settings.ktx.stringText import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon +import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.strings.MoviesStrings +import org.michaelbel.movies.ui.theme.MoviesTheme @Composable internal fun SettingsDialog( @@ -105,39 +109,19 @@ internal fun SettingsDialog( ) } -/* +@Preview @Composable -@DevicePreviews private fun SettingDialogPreview( - @PreviewParameter(AppearancePreviewParameterProvider::class) appLanguage: AppLanguage + /*@PreviewParameter(AppearancePreviewParameterProvider::class)*/ appLanguage: AppLanguage ) { MoviesTheme { SettingsDialog( icon = MoviesIcons.Language, - title = stringResource(R.string.settings_language), - items = AppLanguage.VALUES, - currentItem = appLanguage, - onItemSelect = {}, - onDismissRequest = {} - ) - } -} - -@Composable -@Preview -private fun SettingDialogAmoledPreview( - @PreviewParameter(LanguagePreviewParameterProvider::class) appLanguage: AppLanguage -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - SettingsDialog( - icon = MoviesIcons.Language, - title = stringResource(R.string.settings_language), + title = stringResource(MoviesStrings.settings_language), items = AppLanguage.VALUES, currentItem = appLanguage, onItemSelect = {}, onDismissRequest = {} ) } -}*/ +} \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingItem.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingItem.kt index dd2de2591..77b765bf8 100644 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingItem.kt +++ b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingItem.kt @@ -15,7 +15,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.unit.dp -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.icons.MoviesIcons import org.michaelbel.movies.ui.theme.MoviesTheme @@ -60,8 +60,8 @@ internal fun SettingItem( } } +@Preview @Composable -/*@DevicePreviews*/ private fun SettingItemPreview() { MoviesTheme { SettingItem( @@ -72,20 +72,4 @@ private fun SettingItemPreview() { modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun SettingItemAmoledPreview() { - MoviesTheme( - theme = AppTheme.Amoled - ) { - SettingItem( - title = "Title", - description = "Description", - icon = MoviesIcons.Language, - onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingSwitchItem.kt b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingSwitchItem.kt index 3c2c442ce..d62427833 100644 --- a/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingSwitchItem.kt +++ b/feature/settings-impl/src/commonMain/kotlin/org/michaelbel/movies/settings/ui/common/SettingSwitchItem.kt @@ -17,7 +17,7 @@ import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.unit.dp import androidx.constraintlayout.compose.ConstraintLayout import androidx.constraintlayout.compose.Dimension -import org.michaelbel.movies.common.theme.AppTheme +import org.jetbrains.compose.ui.tooling.preview.Preview import org.michaelbel.movies.ui.accessibility.MoviesContentDescriptionCommon import org.michaelbel.movies.ui.compose.SwitchCheckIcon import org.michaelbel.movies.ui.icons.MoviesIcons @@ -163,8 +163,8 @@ internal fun SettingSwitchItem( } } +@Preview @Composable -/*@DevicePreviews*/ private fun SettingSwitchItemPreview( /*@PreviewParameter(BooleanPreviewParameterProvider::class)*/ checked: Boolean ) { @@ -178,23 +178,4 @@ private fun SettingSwitchItemPreview( modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) ) } -} - -@Composable -/*@Preview*/ -private fun SettingSwitchItemAmoledPreview( - /*@PreviewParameter(BooleanPreviewParameterProvider::class)*/ checked: Boolean -) { - MoviesTheme( - theme = AppTheme.Amoled - ) { - SettingSwitchItem( - title = "Title", - description = "Description", - icon = MoviesIcons.Language, - checked = checked, - onClick = {}, - modifier = Modifier.background(MaterialTheme.colorScheme.primaryContainer) - ) - } } \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9928575af..9c1562455 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -127,8 +127,6 @@ androidx-compose-ui = { module = "androidx.compose.ui:ui", version.ref = "androi androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "androidx-compose-ui" } androidx-compose-ui-tooling-preview-android = { module = "androidx.compose.ui:ui-tooling-preview-android", version.ref = "androidx-compose-ui" } androidx-compose-ui-tooling-preview-desktop = { module = "androidx.compose.ui:ui-tooling-preview-desktop", version.ref = "androidx-compose-ui" } -androidx-compose-ui-test-junit4 = { module = "androidx.compose.ui:ui-test-junit4", version.ref = "androidx-compose-ui" } -androidx-compose-ui-test-manifest = { module = "androidx.compose.ui:ui-test-manifest", version.ref = "androidx-compose-ui" } androidx-compose-ui-util = { module = "androidx.compose.ui:ui-util", version.ref = "androidx-compose-ui" } androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "androidx-core-ktx" } androidx-core-splashscreen = { module = "androidx.core:core-splashscreen", version.ref = "androidx-core-splashscreen" } @@ -340,11 +338,9 @@ compose-android = [ "androidx-compose-runtime", "androidx-compose-ui", "androidx-compose-ui-tooling", + "androidx-compose-ui-tooling-preview-android", "androidx-compose-ui-util" ] -compose-ui-test-android = [ - "androidx-compose-ui-test-junit4" -] core-android = [ "androidx-core-ktx" ] @@ -478,6 +474,9 @@ flaker-noop-android = [ kotlinx-coroutines-desktop = [ "kotlinx-coroutines-swing" ] +compose-desktop = [ + "androidx-compose-ui-tooling-preview-desktop" +] datastore-desktop = [ "androidx-datastore-core-okio-jvm" ]