From 3583349d327feae47e4a43e2d0f9ecfe98be5257 Mon Sep 17 00:00:00 2001 From: Tiago Araujo Date: Mon, 18 Mar 2024 14:15:01 +0100 Subject: [PATCH] style: format code --- .../listofarts/injection/StorageModuleTest.kt | 2 +- build.gradle.kts | 1 - config/detekt/detekt.yml | 98 ++++++++++++++++++- .../domain/models/ArtObjectDomain.kt | 2 +- .../domain/models/CountFacetsDomain.kt | 4 +- .../listofarts/domain/models/FacetDomain.kt | 4 +- .../listofarts/domain/models/FacetsDomain.kt | 4 +- .../domain/models/HeaderImageDomain.kt | 4 +- .../listofarts/domain/models/LinksDomain.kt | 4 +- .../domain/models/ResponseDomain.kt | 4 +- .../domain/models/WebImageDomain.kt | 2 +- .../domain/repositories/ArtRepository.kt | 3 +- .../usecases/GetArtObjectByIdUseCase.kt | 1 - .../usecases/GetArtObjectByIdUseCaseTest.kt | 2 +- .../usecases/GetArtObjectsUseCaseTest.kt | 2 +- gradle/libs.versions.toml | 11 ++- .../presentation/ui/composables/EmptyState.kt | 4 +- .../presentation/ui/composables/LogoText.kt | 4 +- .../composables/PrimaryContainerFilterChip.kt | 6 +- .../presentation/ui/composables/SearchBar.kt | 4 +- .../presentation/ui/composables/SearchFab.kt | 6 +- .../ui/composables/SingleSelectionFilter.kt | 4 +- .../{DefaultPreview.kt => PreviewDefault.kt} | 2 +- .../ui/screens/details/DetailsScreen.kt | 8 +- .../ui/screens/home/HomeScreen.kt | 4 +- 25 files changed, 139 insertions(+), 51 deletions(-) rename presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/previews/{DefaultPreview.kt => PreviewDefault.kt} (81%) diff --git a/app/src/androidTest/java/tgo1014/listofarts/injection/StorageModuleTest.kt b/app/src/androidTest/java/tgo1014/listofarts/injection/StorageModuleTest.kt index 91fc639..5f86362 100644 --- a/app/src/androidTest/java/tgo1014/listofarts/injection/StorageModuleTest.kt +++ b/app/src/androidTest/java/tgo1014/listofarts/injection/StorageModuleTest.kt @@ -17,6 +17,6 @@ object StorageModuleTest { @Singleton @Provides - fun providesFakeBeerRepository(): ArtRepository = FakeArtRepository() + fun providesFakeArtRepository(): ArtRepository = FakeArtRepository() } \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index c063635..4470e44 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -17,7 +17,6 @@ subprojects { configure { kotlin { ktlint() - .setUseExperimental(true) .editorConfigOverride( mapOf( "ij_kotlin_allow_trailing_comma" to "true", diff --git a/config/detekt/detekt.yml b/config/detekt/detekt.yml index a93bd3c..ac47390 100644 --- a/config/detekt/detekt.yml +++ b/config/detekt/detekt.yml @@ -1,27 +1,115 @@ -TwitterCompose: +#TwitterCompose: +# ContentEmitterReturningValues: +# active: true +# ModifierComposable: +# active: true +# ModifierMissing: +# active: true +# ModifierReused: +# active: true +# ModifierWithoutDefault: +# active: true +# MultipleEmitters: +# active: true +# MutableParams: +# active: true +# ComposableNaming: +# active: true +# ComposableParamOrder: +# active: true +# PreviewPublic: +# active: false # Triggering even for private methods +# RememberMissing: +# active: true +# ViewModelForwarding: +# active: true +# ViewModelInjection: +# active: true +Compose: + ComposableAnnotationNaming: + active: true + ComposableNaming: + active: true + # -- You can optionally disable the checks in this rule for regex matches against the composable name (e.g. molecule presenters) + # allowedComposableFunctionNames: .*Presenter,.*MoleculePresenter + ComposableParamOrder: + active: true + # -- You can optionally have a list of types to be treated as lambdas (e.g. typedefs or fun interfaces not picked up automatically) + # treatAsLambda: MyLambdaType + CompositionLocalAllowlist: + active: true + # -- You can optionally define a list of CompositionLocals that are allowed here + # allowedCompositionLocals: LocalSomething,LocalSomethingElse + CompositionLocalNaming: + active: true ContentEmitterReturningValues: active: true + # -- You can optionally add your own composables here + # contentEmitters: MyComposable,MyOtherComposable + DefaultsVisibility: + active: true + LambdaParameterInRestartableEffect: + active: true + # -- You can optionally have a list of types to be treated as lambdas (e.g. typedefs or fun interfaces not picked up automatically) + # treatAsLambda: MyLambdaType + ModifierClickableOrder: + active: true + # -- You can optionally add your own Modifier types + # customModifiers: BananaModifier,PotatoModifier ModifierComposable: active: true + # -- You can optionally add your own Modifier types + # customModifiers: BananaModifier,PotatoModifier ModifierMissing: active: true + # -- You can optionally control the visibility of which composables to check for here + # -- Possible values are: `only_public`, `public_and_internal` and `all` (default is `only_public`) + # checkModifiersForVisibility: only_public + # -- You can optionally add your own Modifier types + # customModifiers: BananaModifier,PotatoModifier + ModifierNaming: + active: true + # -- You can optionally add your own Modifier types + # customModifiers: BananaModifier,PotatoModifier + ModifierNotUsedAtRoot: + active: true + # -- You can optionally add your own composables here + # contentEmitters: MyComposable,MyOtherComposable + # -- You can optionally add your own Modifier types + # customModifiers: BananaModifier,PotatoModifier ModifierReused: active: true + # -- You can optionally add your own Modifier types + # customModifiers: BananaModifier,PotatoModifier ModifierWithoutDefault: active: true MultipleEmitters: active: true + # -- You can optionally add your own composables here that will count as content emitters + # contentEmitters: MyComposable,MyOtherComposable + # -- You can add composables here that you don't want to count as content emitters (e.g. custom dialogs or modals) + # contentEmittersDenylist: MyNonEmitterComposable MutableParams: active: true - ComposableNaming: + MutableStateParam: active: true - ComposableParamOrder: + PreviewAnnotationNaming: active: true PreviewPublic: - active: false # Triggering even for private methods + active: true RememberMissing: active: true + RememberContentMissing: + active: true + UnstableCollections: + active: false # with strong skipping enabled this is not necessary ViewModelForwarding: active: true + # -- You can optionally use this rule on things other than types ending in "ViewModel" or "Presenter" (which are the defaults). You can add your own via a regex here: + # allowedStateHolderNames: .*ViewModel,.*Presenter + # -- You can optionally add an allowlist for Composable names that won't be affected by this rule + # allowedForwarding: .*Content,.*FancyStuff ViewModelInjection: - active: true \ No newline at end of file + active: true + # -- You can optionally add your own ViewModel factories here + # viewModelFactories: hiltViewModel,potatoViewModel \ No newline at end of file diff --git a/domain/src/main/java/tgo1014/listofarts/domain/models/ArtObjectDomain.kt b/domain/src/main/java/tgo1014/listofarts/domain/models/ArtObjectDomain.kt index 208b9b4..8be81a4 100644 --- a/domain/src/main/java/tgo1014/listofarts/domain/models/ArtObjectDomain.kt +++ b/domain/src/main/java/tgo1014/listofarts/domain/models/ArtObjectDomain.kt @@ -17,4 +17,4 @@ data class ArtObjectDomain( val principalMaker: String = "", val materialsList: List = emptyList(), val mainType: String = "", -) \ No newline at end of file +) diff --git a/domain/src/main/java/tgo1014/listofarts/domain/models/CountFacetsDomain.kt b/domain/src/main/java/tgo1014/listofarts/domain/models/CountFacetsDomain.kt index 6b65d89..c7b7cd5 100644 --- a/domain/src/main/java/tgo1014/listofarts/domain/models/CountFacetsDomain.kt +++ b/domain/src/main/java/tgo1014/listofarts/domain/models/CountFacetsDomain.kt @@ -2,5 +2,5 @@ package tgo1014.listofarts.domain.models data class CountFacetsDomain( val hasimage: Int = 0, - val ondisplay: Int = 0 -) \ No newline at end of file + val ondisplay: Int = 0, +) diff --git a/domain/src/main/java/tgo1014/listofarts/domain/models/FacetDomain.kt b/domain/src/main/java/tgo1014/listofarts/domain/models/FacetDomain.kt index 28303cd..6d6bc1b 100644 --- a/domain/src/main/java/tgo1014/listofarts/domain/models/FacetDomain.kt +++ b/domain/src/main/java/tgo1014/listofarts/domain/models/FacetDomain.kt @@ -4,5 +4,5 @@ data class FacetDomain( val facets: List = listOf(), val name: String = "", val otherTerms: Int = 0, - val prettyName: Int = 0 -) \ No newline at end of file + val prettyName: Int = 0, +) diff --git a/domain/src/main/java/tgo1014/listofarts/domain/models/FacetsDomain.kt b/domain/src/main/java/tgo1014/listofarts/domain/models/FacetsDomain.kt index 372dd5c..fce107c 100644 --- a/domain/src/main/java/tgo1014/listofarts/domain/models/FacetsDomain.kt +++ b/domain/src/main/java/tgo1014/listofarts/domain/models/FacetsDomain.kt @@ -2,5 +2,5 @@ package tgo1014.listofarts.domain.models data class FacetsDomain( val key: String = "", - val value: Int = 0 -) \ No newline at end of file + val value: Int = 0, +) diff --git a/domain/src/main/java/tgo1014/listofarts/domain/models/HeaderImageDomain.kt b/domain/src/main/java/tgo1014/listofarts/domain/models/HeaderImageDomain.kt index 47c9a58..1ebdcea 100644 --- a/domain/src/main/java/tgo1014/listofarts/domain/models/HeaderImageDomain.kt +++ b/domain/src/main/java/tgo1014/listofarts/domain/models/HeaderImageDomain.kt @@ -6,5 +6,5 @@ data class HeaderImageDomain( val offsetPercentageY: Int = 0, val width: Int = 0, val height: Int = 0, - val url: String = "" -) \ No newline at end of file + val url: String = "", +) diff --git a/domain/src/main/java/tgo1014/listofarts/domain/models/LinksDomain.kt b/domain/src/main/java/tgo1014/listofarts/domain/models/LinksDomain.kt index 02aa9b0..bf24015 100644 --- a/domain/src/main/java/tgo1014/listofarts/domain/models/LinksDomain.kt +++ b/domain/src/main/java/tgo1014/listofarts/domain/models/LinksDomain.kt @@ -2,5 +2,5 @@ package tgo1014.listofarts.domain.models data class LinksDomain( val self: String = "", - val web: String = "" -) \ No newline at end of file + val web: String = "", +) diff --git a/domain/src/main/java/tgo1014/listofarts/domain/models/ResponseDomain.kt b/domain/src/main/java/tgo1014/listofarts/domain/models/ResponseDomain.kt index 3c6fab5..0bb008d 100644 --- a/domain/src/main/java/tgo1014/listofarts/domain/models/ResponseDomain.kt +++ b/domain/src/main/java/tgo1014/listofarts/domain/models/ResponseDomain.kt @@ -5,5 +5,5 @@ data class ResponseDomain( val count: Int = 0, val countFacets: CountFacetsDomain = CountFacetsDomain(), val artObjects: List = listOf(), - val facets: List = listOf() -) \ No newline at end of file + val facets: List = listOf(), +) diff --git a/domain/src/main/java/tgo1014/listofarts/domain/models/WebImageDomain.kt b/domain/src/main/java/tgo1014/listofarts/domain/models/WebImageDomain.kt index 4b1e9a9..a90afcf 100644 --- a/domain/src/main/java/tgo1014/listofarts/domain/models/WebImageDomain.kt +++ b/domain/src/main/java/tgo1014/listofarts/domain/models/WebImageDomain.kt @@ -7,4 +7,4 @@ data class WebImageDomain( val width: Int = 0, val height: Int = 0, val url: String = "", -) \ No newline at end of file +) diff --git a/domain/src/main/java/tgo1014/listofarts/domain/repositories/ArtRepository.kt b/domain/src/main/java/tgo1014/listofarts/domain/repositories/ArtRepository.kt index 113095d..a4fdf8f 100644 --- a/domain/src/main/java/tgo1014/listofarts/domain/repositories/ArtRepository.kt +++ b/domain/src/main/java/tgo1014/listofarts/domain/repositories/ArtRepository.kt @@ -11,7 +11,6 @@ interface ArtRepository { ): List suspend fun getArtById( - id: String + id: String, ): ArtObjectDomain - } diff --git a/domain/src/main/java/tgo1014/listofarts/domain/usecases/GetArtObjectByIdUseCase.kt b/domain/src/main/java/tgo1014/listofarts/domain/usecases/GetArtObjectByIdUseCase.kt index 9b5fe89..98f22be 100644 --- a/domain/src/main/java/tgo1014/listofarts/domain/usecases/GetArtObjectByIdUseCase.kt +++ b/domain/src/main/java/tgo1014/listofarts/domain/usecases/GetArtObjectByIdUseCase.kt @@ -15,5 +15,4 @@ class GetArtObjectByIdUseCase @Inject constructor( artRepository.getArtById(id.replace("en-", "")) } } - } diff --git a/domain/src/test/java/tgo1014/listofarts/domain/usecases/GetArtObjectByIdUseCaseTest.kt b/domain/src/test/java/tgo1014/listofarts/domain/usecases/GetArtObjectByIdUseCaseTest.kt index 437b009..74afbd8 100644 --- a/domain/src/test/java/tgo1014/listofarts/domain/usecases/GetArtObjectByIdUseCaseTest.kt +++ b/domain/src/test/java/tgo1014/listofarts/domain/usecases/GetArtObjectByIdUseCaseTest.kt @@ -23,7 +23,7 @@ class GetArtObjectByIdUseCaseTest { fakeArtRepository = FakeArtRepository() usecase = GetArtObjectByIdUseCase( artRepository = fakeArtRepository, - coroutineProvider = fakeCoroutineProvider + coroutineProvider = fakeCoroutineProvider, ) } diff --git a/domain/src/test/java/tgo1014/listofarts/domain/usecases/GetArtObjectsUseCaseTest.kt b/domain/src/test/java/tgo1014/listofarts/domain/usecases/GetArtObjectsUseCaseTest.kt index d574308..407750a 100644 --- a/domain/src/test/java/tgo1014/listofarts/domain/usecases/GetArtObjectsUseCaseTest.kt +++ b/domain/src/test/java/tgo1014/listofarts/domain/usecases/GetArtObjectsUseCaseTest.kt @@ -24,7 +24,7 @@ class GetArtObjectsUseCaseTest { fakeArtRepository = FakeArtRepository() usecase = GetArtObjectsUseCase( artRepository = fakeArtRepository, - coroutineProvider = fakeCoroutineProvider + coroutineProvider = fakeCoroutineProvider, ) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 839ed97..61bba9d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,7 +5,8 @@ accompanistNavigationMaterial = "0.34.0" coilCompose = "2.6.0" compose = "1.7.0-alpha04" compose-compiler = "1.5.10" -detekt = "1.23.4" +detekt = "1.23.5" +detektRules = "0.3.12" hilt = "2.51" hiltNavigationCompose = "1.2.0" javaxInject = "1" @@ -23,14 +24,16 @@ mockwebserver = "5.0.0-alpha.12" retrofit = "2.9.0" retrofit2KotlinxSerializationConverter = "1.0.0" runner = "1.5+" -spotless = "6.12.0" +spotless = "6.25.0" timber = "5.0.1" turbine = "1.1.0" +zoomimageComposeCoil = "1.0.2" + + optIns = "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi,com.google.accompanist.navigation.material.ExperimentalMaterialNavigationApi,androidx.compose.ui.test.ExperimentalTestApi" sdk-compile = "34" sdk-target = "34" sdk-min = "21" -zoomimageComposeCoil = "1.0.2" [libraries] accompanist-navigation-material = { module = "com.google.accompanist:accompanist-navigation-material", version.ref = "accompanistNavigationMaterial" } @@ -45,7 +48,7 @@ androidx-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview androidx-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" } androidx-ui-util = { module = "androidx.compose.ui:ui-util", version.ref = "compose" } coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coilCompose" } -detekt = { module = "io.nlopez.compose.rules:detekt", version.ref = "detekt" } +detekt = { module = "io.nlopez.compose.rules:detekt", version.ref = "detektRules" } hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "hilt" } hilt-android-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "hilt" } hilt-android-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "hilt" } diff --git a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/EmptyState.kt b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/EmptyState.kt index 424fc1c..dcf3db4 100644 --- a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/EmptyState.kt +++ b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/EmptyState.kt @@ -14,7 +14,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import tgo1014.listofarts.presentation.R -import tgo1014.listofarts.presentation.ui.composables.previews.DefaultPreview +import tgo1014.listofarts.presentation.ui.composables.previews.PreviewDefault import tgo1014.listofarts.presentation.ui.theme.ListOfArtsTheme @Composable @@ -37,7 +37,7 @@ fun EmptyState( } } -@DefaultPreview +@PreviewDefault @Composable private fun EmptyStatePreview() = ListOfArtsTheme { Surface { EmptyState() } diff --git a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/LogoText.kt b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/LogoText.kt index 1390fa6..c294ffb 100644 --- a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/LogoText.kt +++ b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/LogoText.kt @@ -13,7 +13,7 @@ import androidx.compose.ui.text.font.FontStyle import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.withStyle import androidx.compose.ui.tooling.preview.PreviewParameter -import tgo1014.listofarts.presentation.ui.composables.previews.DefaultPreview +import tgo1014.listofarts.presentation.ui.composables.previews.PreviewDefault import tgo1014.listofarts.presentation.ui.composables.providers.ThemeProvider import tgo1014.listofarts.presentation.ui.theme.ListOfArtsTheme @@ -39,7 +39,7 @@ fun LogoText( ) } -@DefaultPreview +@PreviewDefault @Composable private fun LogoTextPreview( @PreviewParameter(ThemeProvider::class) materialYouColors: Boolean diff --git a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/PrimaryContainerFilterChip.kt b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/PrimaryContainerFilterChip.kt index bda7131..3ab0b8d 100644 --- a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/PrimaryContainerFilterChip.kt +++ b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/PrimaryContainerFilterChip.kt @@ -13,7 +13,7 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import tgo1014.listofarts.presentation.models.Filter -import tgo1014.listofarts.presentation.ui.composables.previews.DefaultPreview +import tgo1014.listofarts.presentation.ui.composables.previews.PreviewDefault import tgo1014.listofarts.presentation.ui.composables.providers.ThemeProvider import tgo1014.listofarts.presentation.ui.theme.ListOfArtsTheme @@ -42,7 +42,7 @@ fun PrimaryContainerFilterChip( ) } -@DefaultPreview +@PreviewDefault @Composable private fun FilterChipPreview( @PreviewParameter(ThemeProvider::class) materialYouColors: Boolean @@ -52,7 +52,7 @@ private fun FilterChipPreview( } } -@DefaultPreview +@PreviewDefault @Composable private fun FilterChipDisabledPreview( @PreviewParameter(ThemeProvider::class) materialYouColors: Boolean diff --git a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/SearchBar.kt b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/SearchBar.kt index 579ca96..8dc4fb1 100644 --- a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/SearchBar.kt +++ b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/SearchBar.kt @@ -25,7 +25,7 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import tgo1014.listofarts.presentation.R -import tgo1014.listofarts.presentation.ui.composables.previews.DefaultPreview +import tgo1014.listofarts.presentation.ui.composables.previews.PreviewDefault import tgo1014.listofarts.presentation.ui.composables.providers.ThemeProvider import tgo1014.listofarts.presentation.ui.theme.ListOfArtsTheme @@ -69,7 +69,7 @@ fun SearchBar( ) } -@DefaultPreview +@PreviewDefault @Composable private fun SearchBarPreview( @PreviewParameter(ThemeProvider::class) materialYouColors: Boolean diff --git a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/SearchFab.kt b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/SearchFab.kt index 8b2fcf4..329ffd2 100644 --- a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/SearchFab.kt +++ b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/SearchFab.kt @@ -64,7 +64,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import kotlinx.coroutines.delay import tgo1014.listofarts.presentation.R -import tgo1014.listofarts.presentation.ui.composables.previews.DefaultPreview +import tgo1014.listofarts.presentation.ui.composables.previews.PreviewDefault import tgo1014.listofarts.presentation.ui.composables.previews.isPreviewMode import tgo1014.listofarts.presentation.ui.composables.providers.ThemeProvider import tgo1014.listofarts.presentation.ui.theme.ListOfArtsTheme @@ -75,10 +75,10 @@ import kotlin.time.Duration.Companion.milliseconds @OptIn(ExperimentalMaterial3Api::class) @Composable fun SearchFab( - modifier: Modifier = Modifier, searchText: String, buttonState: SearchFabState, isLoading: Boolean, + modifier: Modifier = Modifier, onCloseClicked: () -> Unit = {}, onSearchTextChanged: (String) -> Unit = {}, onButtonClicked: () -> Unit = {}, @@ -275,7 +275,7 @@ private fun SearchFabPreviewSearchLoading() = ListOfArtsTheme { } } -@DefaultPreview +@PreviewDefault @Composable private fun HomeScreenPreview( @PreviewParameter(ThemeProvider::class) materialYouColors: Boolean diff --git a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/SingleSelectionFilter.kt b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/SingleSelectionFilter.kt index a43750b..53f2121 100644 --- a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/SingleSelectionFilter.kt +++ b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/SingleSelectionFilter.kt @@ -13,7 +13,7 @@ import androidx.compose.ui.unit.dp import tgo1014.listofarts.presentation.models.Filter import tgo1014.listofarts.presentation.models.FilterState import tgo1014.listofarts.presentation.models.translation -import tgo1014.listofarts.presentation.ui.composables.previews.DefaultPreview +import tgo1014.listofarts.presentation.ui.composables.previews.PreviewDefault import tgo1014.listofarts.presentation.ui.composables.providers.ThemeProvider import tgo1014.listofarts.presentation.ui.theme.ListOfArtsTheme @@ -37,7 +37,7 @@ fun SingleSelectionFilter( } } -@DefaultPreview +@PreviewDefault @Composable private fun SingleSelectionFilterPreview( @PreviewParameter(ThemeProvider::class) materialYouColors: Boolean diff --git a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/previews/DefaultPreview.kt b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/previews/PreviewDefault.kt similarity index 81% rename from presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/previews/DefaultPreview.kt rename to presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/previews/PreviewDefault.kt index 0b5be4a..b23fc80 100644 --- a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/previews/DefaultPreview.kt +++ b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/composables/previews/PreviewDefault.kt @@ -3,4 +3,4 @@ package tgo1014.listofarts.presentation.ui.composables.previews import androidx.compose.ui.tooling.preview.PreviewLightDark @PreviewLightDark -annotation class DefaultPreview +annotation class PreviewDefault diff --git a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/screens/details/DetailsScreen.kt b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/screens/details/DetailsScreen.kt index d3ba266..f73e0e8 100644 --- a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/screens/details/DetailsScreen.kt +++ b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/screens/details/DetailsScreen.kt @@ -55,7 +55,7 @@ import tgo1014.listofarts.presentation.R import tgo1014.listofarts.presentation.models.ArtObjectUi import tgo1014.listofarts.presentation.ui.composables.PrimaryContainerFilterChip import tgo1014.listofarts.presentation.ui.composables.modifyIf -import tgo1014.listofarts.presentation.ui.composables.previews.DefaultPreview +import tgo1014.listofarts.presentation.ui.composables.previews.PreviewDefault import tgo1014.listofarts.presentation.ui.composables.previews.isPreviewMode import tgo1014.listofarts.presentation.ui.composables.providers.ThemeProvider import tgo1014.listofarts.presentation.ui.theme.ListOfArtsTheme @@ -223,7 +223,7 @@ private fun DetailScreenContent(item: ArtObjectUi) { } } -@DefaultPreview +@PreviewDefault @Composable private fun DetailsScreenPreview( @PreviewParameter(ThemeProvider::class) materialYouColors: Boolean @@ -241,7 +241,7 @@ private fun DetailsScreenPreview( } } -@DefaultPreview +@PreviewDefault @Composable private fun DetailScreenLoadingPreview() = ListOfArtsTheme { Surface(color = MaterialTheme.colorScheme.primaryContainer) { @@ -249,7 +249,7 @@ private fun DetailScreenLoadingPreview() = ListOfArtsTheme { } } -@DefaultPreview +@PreviewDefault @Composable private fun DetailScreenErrorPreview() = ListOfArtsTheme { Surface(color = MaterialTheme.colorScheme.primaryContainer) { diff --git a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/screens/home/HomeScreen.kt b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/screens/home/HomeScreen.kt index 77a311a..079e0fb 100644 --- a/presentation/src/main/java/tgo1014/listofarts/presentation/ui/screens/home/HomeScreen.kt +++ b/presentation/src/main/java/tgo1014/listofarts/presentation/ui/screens/home/HomeScreen.kt @@ -47,7 +47,7 @@ import tgo1014.listofarts.presentation.ui.composables.LogoText import tgo1014.listofarts.presentation.ui.composables.SearchFab import tgo1014.listofarts.presentation.ui.composables.SearchFabState import tgo1014.listofarts.presentation.ui.composables.SingleSelectionFilter -import tgo1014.listofarts.presentation.ui.composables.previews.DefaultPreview +import tgo1014.listofarts.presentation.ui.composables.previews.PreviewDefault import tgo1014.listofarts.presentation.ui.composables.providers.ThemeProvider import tgo1014.listofarts.presentation.ui.theme.ListOfArtsTheme @@ -181,7 +181,7 @@ private fun HomeScreen( ) } -@DefaultPreview +@PreviewDefault @Composable private fun HomeScreenPreview( @PreviewParameter(ThemeProvider::class) materialYouColors: Boolean