From f273f9192dc32bc70e0d443c688b8c8629e2a13f Mon Sep 17 00:00:00 2001 From: michaelbel Date: Fri, 28 Apr 2023 19:04:13 +0300 Subject: [PATCH] Update project --- .github/workflows/check_pr.yml | 4 +- app/build.gradle.kts | 29 +++++++---- build.gradle.kts | 8 ++-- buildSrc/build.gradle.kts | 16 ------- .../AndroidApplicationConventionPlugin.kt | 23 --------- ...droidComposeApplicationConventionPlugin.kt | 18 ------- .../AndroidComposeLibraryConventionPlugin.kt | 18 ------- .../plugins/AndroidLibraryConventionPlugin.kt | 23 --------- core/ads/build.gradle.kts | 9 +++- core/analytics/build.gradle.kts | 9 +++- core/common/build.gradle.kts | 13 ++++- core/domain/build.gradle.kts | 12 +++-- core/entities/build.gradle.kts | 13 ++++- core/navigation/build.gradle.kts | 9 +++- core/network/build.gradle.kts | 15 +++++- core/ui/build.gradle.kts | 12 ++++- .../movies/ui/compose/AccountAvatar.kt | 9 ++-- feature/account-impl/build.gradle.kts | 12 ++++- .../movies/account/ui/AccountCountryBox.kt | 14 +++--- .../movies/account/ui/AccountScreenContent.kt | 18 +++---- feature/account/build.gradle.kts | 12 ++++- feature/auth-impl/build.gradle.kts | 12 ++++- .../michaelbel/movies/auth/ui/AuthErrorBox.kt | 14 +++--- .../movies/auth/ui/AuthScreenContent.kt | 8 ++-- feature/auth/build.gradle.kts | 12 ++++- feature/details-impl/build.gradle.kts | 12 ++++- .../movies/details/ui/DetailsScreenContent.kt | 15 +++--- .../movies/details/ui/DetailsShareButton.kt | 7 ++- .../movies/details/ui/DetailsToolbar.kt | 13 +++-- feature/details/build.gradle.kts | 12 ++++- feature/feed-impl/build.gradle.kts | 12 ++++- .../michaelbel/movies/feed/ui/FeedContent.kt | 12 ++--- .../michaelbel/movies/feed/ui/FeedLoading.kt | 4 +- .../michaelbel/movies/feed/ui/FeedMovieBox.kt | 8 ++-- .../movies/feed/ui/FeedScreenContent.kt | 15 +++--- .../michaelbel/movies/feed/ui/FeedToolbar.kt | 14 +++--- feature/feed/build.gradle.kts | 12 ++++- feature/settings-impl/build.gradle.kts | 13 ++++- .../ui/SettingsDynamicColorsBoxTest.kt | 4 +- .../settings/ui/SettingsLanguageBoxTest.kt | 8 ++-- .../movies/settings/ui/SettingsRtlBoxTest.kt | 4 +- .../settings/ui/SettingsThemeBoxTest.kt | 8 ++-- .../settings/ui/SettingsVersionBoxTest.kt | 4 +- .../settings/ui/SettingsDynamicColorsBox.kt | 11 ++--- .../movies/settings/ui/SettingsLanguageBox.kt | 12 ++--- .../settings/ui/SettingsLanguageDialog.kt | 9 ++-- .../ui/SettingsNetworkRequestDelayBox.kt | 4 +- .../movies/settings/ui/SettingsReviewBox.kt | 3 +- .../movies/settings/ui/SettingsRtlBox.kt | 11 ++--- .../settings/ui/SettingsScreenContent.kt | 44 ++++++++--------- .../movies/settings/ui/SettingsThemeBox.kt | 12 ++--- .../movies/settings/ui/SettingsThemeDialog.kt | 9 ++-- .../movies/settings/ui/SettingsToolbar.kt | 15 ++---- .../movies/settings/ui/SettingsVersionBox.kt | 11 ++--- feature/settings/build.gradle.kts | 12 ++++- gradle.properties | 29 ++++++----- gradle/libs.versions.toml | 48 +++++++++++-------- gradle/wrapper/gradle-wrapper.properties | 2 +- readme.md | 20 ++++---- 59 files changed, 411 insertions(+), 360 deletions(-) delete mode 100644 buildSrc/src/main/kotlin/plugins/AndroidApplicationConventionPlugin.kt delete mode 100644 buildSrc/src/main/kotlin/plugins/AndroidComposeApplicationConventionPlugin.kt delete mode 100644 buildSrc/src/main/kotlin/plugins/AndroidComposeLibraryConventionPlugin.kt delete mode 100644 buildSrc/src/main/kotlin/plugins/AndroidLibraryConventionPlugin.kt diff --git a/.github/workflows/check_pr.yml b/.github/workflows/check_pr.yml index 52399736b..268149ec1 100644 --- a/.github/workflows/check_pr.yml +++ b/.github/workflows/check_pr.yml @@ -40,11 +40,11 @@ jobs: - name: Validate Gradle Wrapper uses: gradle/wrapper-validation-action@v1 - - name: Set up JDK 11 + - name: Set up JDK 17 uses: actions/setup-java@v3 with: distribution: 'zulu' - java-version: 11 + java-version: 17 - name: Setup Gradle uses: gradle/gradle-build-action@v2 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index dc74f9e80..95d799a33 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -1,17 +1,18 @@ import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties -import java.io.FileInputStream import org.apache.commons.io.output.ByteArrayOutputStream import org.jetbrains.kotlin.konan.properties.Properties +import java.io.FileInputStream +@Suppress("dsl_scope_violation") plugins { - id("movies-android-application") - id("movies-android-application-compose") + alias(libs.plugins.application) + alias(libs.plugins.kotlin) + alias(libs.plugins.androidx.navigation.safeargs) + alias(libs.plugins.google.services) + alias(libs.plugins.firebase.appdistribution) + alias(libs.plugins.firebase.crashlytics) + alias(libs.plugins.palantir.git) id("movies-android-hilt") - id("androidx.navigation.safeargs") - id("com.google.gms.google-services") - id("com.google.firebase.appdistribution") - id("com.google.firebase.crashlytics") - id("com.palantir.git-version") } val gitCommitsCount: Int by lazy { @@ -27,11 +28,11 @@ val currentTime: Long by lazy { System.currentTimeMillis() } -val admobAppId: String by lazy { +val admobAppId: String? by lazy { gradleLocalProperties(rootDir).getProperty("ADMOB_APP_ID") } -val admobBannerId: String by lazy { +val admobBannerId: String? by lazy { gradleLocalProperties(rootDir).getProperty("ADMOB_BANNER_ID") } @@ -129,6 +130,7 @@ android { } buildFeatures { + buildConfig = true compose = true } @@ -136,6 +138,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -165,4 +172,6 @@ dependencies { androidTestImplementation(libs.androidx.espresso.core) androidTestImplementation(libs.androidx.compose.ui.test.junit4) androidTestImplementation(libs.androidx.benchmark.junit) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 80a98f15d..4a6ea330e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,4 @@ +@Suppress("dsl_scope_violation") plugins { alias(libs.plugins.application) apply false alias(libs.plugins.library) apply false @@ -12,10 +13,9 @@ plugins { alias(libs.plugins.hilt) apply false alias(libs.plugins.spotless) alias(libs.plugins.detekt) - - id("com.github.ben-manes.versions") version "0.46.0" - id("nl.littlerobots.version-catalog-update") version "0.8.0" - id("com.palantir.git-version") version "2.0.0" + alias(libs.plugins.palantir.git) + alias(libs.plugins.ben.manes.versions) + alias(libs.plugins.littlerobots.version.catalog.update) } /** diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 8a68b018b..7a034a208 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -10,22 +10,6 @@ dependencies { gradlePlugin { plugins { - register("androidApplication") { - id = "movies-android-application" - implementationClass = "plugins.AndroidApplicationConventionPlugin" - } - register("androidLibrary") { - id = "movies-android-library" - implementationClass = "plugins.AndroidLibraryConventionPlugin" - } - register("androidComposeApplication") { - id = "movies-android-application-compose" - implementationClass = "plugins.AndroidComposeApplicationConventionPlugin" - } - register("androidComposeLibrary") { - id = "movies-android-library-compose" - implementationClass = "plugins.AndroidComposeLibraryConventionPlugin" - } register("androidHilt") { id = "movies-android-hilt" implementationClass = "plugins.AndroidHiltConventionPlugin" diff --git a/buildSrc/src/main/kotlin/plugins/AndroidApplicationConventionPlugin.kt b/buildSrc/src/main/kotlin/plugins/AndroidApplicationConventionPlugin.kt deleted file mode 100644 index a161e33f6..000000000 --- a/buildSrc/src/main/kotlin/plugins/AndroidApplicationConventionPlugin.kt +++ /dev/null @@ -1,23 +0,0 @@ -package plugins - -import org.gradle.api.Plugin -import org.gradle.api.Project - -internal class AndroidApplicationConventionPlugin: Plugin { - - override fun apply(target: Project) { - target.run { - pluginManager.run { - apply("com.android.application") - apply("org.jetbrains.kotlin.android") - } - - /*val libs: VersionCatalog = extensions.getByType().named("libs") - extensions.configure { - defaultConfig.targetSdk = libs.findVersion("target-sdk").get().requiredVersion.toInt() - configureKotlinAndroid(this) - configureLintCheck(this) - }*/ - } - } -} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/plugins/AndroidComposeApplicationConventionPlugin.kt b/buildSrc/src/main/kotlin/plugins/AndroidComposeApplicationConventionPlugin.kt deleted file mode 100644 index 2f8359cdf..000000000 --- a/buildSrc/src/main/kotlin/plugins/AndroidComposeApplicationConventionPlugin.kt +++ /dev/null @@ -1,18 +0,0 @@ -package plugins - -import org.gradle.api.Plugin -import org.gradle.api.Project - -internal class AndroidComposeApplicationConventionPlugin: Plugin { - - override fun apply(target: Project) { - target.run { - pluginManager.run { - apply("com.android.application") - } - - /*val extension: ApplicationExtension = extensions.getByType() - configureAndroidCompose(extension)*/ - } - } -} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/plugins/AndroidComposeLibraryConventionPlugin.kt b/buildSrc/src/main/kotlin/plugins/AndroidComposeLibraryConventionPlugin.kt deleted file mode 100644 index 60265dd9c..000000000 --- a/buildSrc/src/main/kotlin/plugins/AndroidComposeLibraryConventionPlugin.kt +++ /dev/null @@ -1,18 +0,0 @@ -package plugins - -import org.gradle.api.Plugin -import org.gradle.api.Project - -internal class AndroidComposeLibraryConventionPlugin: Plugin { - - override fun apply(target: Project) { - target.run { - pluginManager.run { - apply("com.android.library") - } - - /*val extension: LibraryExtension = extensions.getByType() - configureAndroidCompose(extension)*/ - } - } -} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/plugins/AndroidLibraryConventionPlugin.kt b/buildSrc/src/main/kotlin/plugins/AndroidLibraryConventionPlugin.kt deleted file mode 100644 index cb53208f0..000000000 --- a/buildSrc/src/main/kotlin/plugins/AndroidLibraryConventionPlugin.kt +++ /dev/null @@ -1,23 +0,0 @@ -package plugins - -import org.gradle.api.Plugin -import org.gradle.api.Project - -internal class AndroidLibraryConventionPlugin: Plugin { - - override fun apply(target: Project) { - target.run { - pluginManager.run { - apply("com.android.library") - apply("org.jetbrains.kotlin.android") - } - - /*val libs: VersionCatalog = extensions.getByType().named("libs") - extensions.configure { - defaultConfig.targetSdk = libs.findVersion("target-sdk").get().requiredVersion.toInt() - configureKotlinAndroid(this) - configureLintCheck(this) - }*/ - } - } -} \ No newline at end of file diff --git a/core/ads/build.gradle.kts b/core/ads/build.gradle.kts index 7ac7cc76a..86b545ec5 100644 --- a/core/ads/build.gradle.kts +++ b/core/ads/build.gradle.kts @@ -1,5 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) } android { @@ -18,6 +20,11 @@ android { } } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false diff --git a/core/analytics/build.gradle.kts b/core/analytics/build.gradle.kts index c07323583..5f0b79d1f 100644 --- a/core/analytics/build.gradle.kts +++ b/core/analytics/build.gradle.kts @@ -1,5 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) id("movies-android-hilt") } @@ -19,6 +21,11 @@ android { } } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false diff --git a/core/common/build.gradle.kts b/core/common/build.gradle.kts index f94e4f573..2a7c77555 100644 --- a/core/common/build.gradle.kts +++ b/core/common/build.gradle.kts @@ -1,6 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("movies-android-library-compose") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) id("movies-android-hilt") } @@ -29,6 +30,7 @@ android { } buildFeatures { + buildConfig = true compose = true } @@ -36,6 +38,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -60,4 +67,6 @@ dependencies { implementation(libs.firebase.crashlytics) implementation(libs.androidx.startup.runtime) implementation(libs.androidx.browser) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/core/domain/build.gradle.kts b/core/domain/build.gradle.kts index 0655170e6..ad78eb065 100644 --- a/core/domain/build.gradle.kts +++ b/core/domain/build.gradle.kts @@ -1,7 +1,9 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.ksp) id("movies-android-hilt") - id("com.google.devtools.ksp") } android { @@ -28,6 +30,11 @@ android { ) } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -45,7 +52,6 @@ dependencies { implementation(libs.bundles.datastore) implementation(libs.bundles.room) api(libs.androidx.hilt.work) - kapt(libs.androidx.hilt.compiler) api(libs.androidx.work.runtime.ktx) ksp(libs.androidx.room.compiler) } \ No newline at end of file diff --git a/core/entities/build.gradle.kts b/core/entities/build.gradle.kts index f323c8708..6ba521759 100644 --- a/core/entities/build.gradle.kts +++ b/core/entities/build.gradle.kts @@ -1,7 +1,9 @@ import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) id("movies-android-hilt") } @@ -28,6 +30,15 @@ android { } } + buildFeatures { + buildConfig = true + } + + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false diff --git a/core/navigation/build.gradle.kts b/core/navigation/build.gradle.kts index 6ff42b9bb..9e87661fb 100644 --- a/core/navigation/build.gradle.kts +++ b/core/navigation/build.gradle.kts @@ -1,5 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) } android { @@ -18,6 +20,11 @@ android { } } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false diff --git a/core/network/build.gradle.kts b/core/network/build.gradle.kts index b05fb442e..4c6e4ede1 100644 --- a/core/network/build.gradle.kts +++ b/core/network/build.gradle.kts @@ -1,6 +1,8 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("kotlinx-serialization") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) + alias(libs.plugins.kotlin.serialization) id("movies-android-hilt") } @@ -20,12 +22,21 @@ android { } } + buildFeatures { + buildConfig = true + } + kotlinOptions { freeCompilerArgs = freeCompilerArgs + listOf( "-opt-in=kotlinx.serialization.ExperimentalSerializationApi" ) } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts index cf89ac623..f81c8e75c 100644 --- a/core/ui/build.gradle.kts +++ b/core/ui/build.gradle.kts @@ -1,6 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("movies-android-library-compose") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) } android { @@ -27,6 +28,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -47,4 +53,6 @@ dependencies { api(libs.bundles.accompanist) api(libs.bundles.compose) api(libs.androidx.paging.compose) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/AccountAvatar.kt b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/AccountAvatar.kt index 66e8ab98a..ce963f38e 100644 --- a/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/AccountAvatar.kt +++ b/core/ui/src/main/kotlin/org/michaelbel/movies/ui/compose/AccountAvatar.kt @@ -26,9 +26,9 @@ import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun AccountAvatar( - modifier: Modifier = Modifier, account: AccountDb, - fontSize: TextUnit + fontSize: TextUnit, + modifier: Modifier = Modifier ) { if (account.avatarUrl.isNotEmpty()) { AsyncImage( @@ -68,10 +68,9 @@ private fun AccountAvatarPreview( ) { MoviesTheme { AccountAvatar( - modifier = Modifier - .size(32.dp), account = account, - fontSize = account.lettersTextFontSizeSmall + fontSize = account.lettersTextFontSizeSmall, + modifier = Modifier.size(32.dp), ) } } \ No newline at end of file diff --git a/feature/account-impl/build.gradle.kts b/feature/account-impl/build.gradle.kts index 1672f48c0..316ec71b9 100644 --- a/feature/account-impl/build.gradle.kts +++ b/feature/account-impl/build.gradle.kts @@ -1,6 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("movies-android-library-compose") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) id("movies-android-hilt") } @@ -38,6 +39,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -60,4 +66,6 @@ dependencies { androidTestImplementation(libs.androidx.compose.ui.test.junit4) androidTestImplementation(libs.androidx.benchmark.junit) debugImplementation(libs.androidx.compose.ui.test.manifest) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountCountryBox.kt b/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountCountryBox.kt index 55b6147f3..02ac0af48 100644 --- a/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountCountryBox.kt +++ b/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountCountryBox.kt @@ -20,8 +20,8 @@ import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun AccountCountryBox( - modifier: Modifier = Modifier, - country: String + country: String, + modifier: Modifier = Modifier ) { Row( modifier = modifier, @@ -31,15 +31,13 @@ fun AccountCountryBox( Icon( imageVector = MoviesIcons.LocationOn, contentDescription = null, - modifier = Modifier - .size(24.dp), + modifier = Modifier.size(24.dp), tint = MaterialTheme.colorScheme.onPrimaryContainer ) Text( text = country, - modifier = Modifier - .padding(start = 4.dp), + modifier = Modifier.padding(start = 4.dp), overflow = TextOverflow.Ellipsis, maxLines = 1, style = MaterialTheme.typography.bodySmall.copy( @@ -54,10 +52,10 @@ fun AccountCountryBox( private fun AccountCountryBoxPreview() { MoviesTheme { AccountCountryBox( + country = "Finland", modifier = Modifier .fillMaxWidth() - .background(MaterialTheme.colorScheme.primaryContainer), - country = "Finland" + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt b/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt index 5db943c80..320125e33 100644 --- a/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt +++ b/feature/account-impl/src/main/kotlin/org/michaelbel/movies/account/ui/AccountScreenContent.kt @@ -39,7 +39,6 @@ fun AccountRoute( val account: AccountDb? by viewModel.account.collectAsStateWithLifecycle() AccountScreenContent( - modifier = modifier, account = account.orEmpty, loading = viewModel.loading, onBackClick = onBackClick, @@ -47,17 +46,18 @@ fun AccountRoute( viewModel.onLogoutClick { onBackClick() } - } + }, + modifier = modifier ) } @Composable internal fun AccountScreenContent( - modifier: Modifier = Modifier, account: AccountDb, loading: Boolean, onBackClick: () -> Unit, - onLogoutClick: () -> Unit + onLogoutClick: () -> Unit, + modifier: Modifier = Modifier ) { ConstraintLayout( modifier @@ -92,15 +92,15 @@ internal fun AccountScreenContent( ) AccountAvatar( + account = account, + fontSize = account.lettersTextFontSizeLarge, modifier = Modifier .constrainAs(accountAvatar) { width = Dimension.value(64.dp) height = Dimension.value(64.dp) start.linkTo(parent.start, 16.dp) top.linkTo(toolbar.bottom) - }, - account = account, - fontSize = account.lettersTextFontSizeLarge + } ) Column( @@ -141,6 +141,7 @@ internal fun AccountScreenContent( if (account.country.isNotEmpty()) { AccountCountryBox( + country = account.country, modifier = Modifier .constrainAs(countryBox) { width = Dimension.fillToConstraints @@ -148,8 +149,7 @@ internal fun AccountScreenContent( start.linkTo(parent.start, 16.dp) top.linkTo(accountAvatar.bottom, 8.dp) end.linkTo(parent.end, 16.dp) - }, - country = account.country + } ) } diff --git a/feature/account/build.gradle.kts b/feature/account/build.gradle.kts index cea305925..8f07a9766 100644 --- a/feature/account/build.gradle.kts +++ b/feature/account/build.gradle.kts @@ -1,6 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("movies-android-library-compose") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) } android { @@ -33,6 +34,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -44,4 +50,6 @@ android { dependencies { implementation(project(":feature:account-impl")) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/feature/auth-impl/build.gradle.kts b/feature/auth-impl/build.gradle.kts index 5781b2a05..e2273d0cc 100644 --- a/feature/auth-impl/build.gradle.kts +++ b/feature/auth-impl/build.gradle.kts @@ -1,6 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("movies-android-library-compose") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) id("movies-android-hilt") } @@ -38,6 +39,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -60,4 +66,6 @@ dependencies { androidTestImplementation(libs.androidx.compose.ui.test.junit4) androidTestImplementation(libs.androidx.benchmark.junit) debugImplementation(libs.androidx.compose.ui.test.manifest) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthErrorBox.kt b/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthErrorBox.kt index 9b06a6524..1616d291f 100644 --- a/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthErrorBox.kt +++ b/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthErrorBox.kt @@ -23,8 +23,8 @@ import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun AuthErrorBox( - modifier: Modifier = Modifier, - error: Throwable? + error: Throwable?, + modifier: Modifier = Modifier ) { Row( modifier = modifier, @@ -34,15 +34,13 @@ fun AuthErrorBox( Icon( imageVector = MoviesIcons.Error, contentDescription = null, - modifier = Modifier - .size(24.dp), + modifier = Modifier.size(24.dp), tint = MaterialTheme.colorScheme.error ) Text( text = error.text, - modifier = Modifier - .padding(start = 4.dp), + modifier = Modifier.padding(start = 4.dp), color = MaterialTheme.colorScheme.error, fontSize = 13.sp, textAlign = TextAlign.Start, @@ -58,9 +56,9 @@ private fun AuthErrorBoxPreview( ) { MoviesTheme { AuthErrorBox( + error = error, modifier = Modifier - .background(MaterialTheme.colorScheme.primaryContainer), - error = error + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt b/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt index db60fc918..fb190124d 100644 --- a/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt +++ b/feature/auth-impl/src/main/kotlin/org/michaelbel/movies/auth/ui/AuthScreenContent.kt @@ -52,7 +52,6 @@ fun AuthRoute( viewModel: AuthViewModel = hiltViewModel() ) { AuthScreenContent( - modifier = modifier, error = viewModel.error, loading = viewModel.loading, onBackClick = onBackClick, @@ -60,17 +59,18 @@ fun AuthRoute( viewModel.onSignInClick(username, password) { onBackClick() } - } + }, + modifier = modifier ) } @Composable internal fun AuthScreenContent( - modifier: Modifier = Modifier, error: Throwable?, loading: Boolean, onBackClick: () -> Unit, - onSignInClick: (String, String) -> Unit + onSignInClick: (String, String) -> Unit, + modifier: Modifier = Modifier ) { val focusManager: FocusManager = LocalFocusManager.current val focusRequester: FocusRequester = remember { FocusRequester() } diff --git a/feature/auth/build.gradle.kts b/feature/auth/build.gradle.kts index 6f75a81b5..428bbf2c3 100644 --- a/feature/auth/build.gradle.kts +++ b/feature/auth/build.gradle.kts @@ -1,6 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("movies-android-library-compose") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) } android { @@ -33,6 +34,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -44,4 +50,6 @@ android { dependencies { implementation(project(":feature:auth-impl")) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/feature/details-impl/build.gradle.kts b/feature/details-impl/build.gradle.kts index 386063d43..280ed4544 100644 --- a/feature/details-impl/build.gradle.kts +++ b/feature/details-impl/build.gradle.kts @@ -1,6 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("movies-android-library-compose") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) id("movies-android-hilt") } @@ -37,6 +38,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -60,4 +66,6 @@ dependencies { androidTestImplementation(libs.androidx.compose.ui.test.junit4) androidTestImplementation(libs.androidx.benchmark.junit) debugImplementation(libs.androidx.compose.ui.test.manifest) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsScreenContent.kt b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsScreenContent.kt index a39661287..fe17ed015 100644 --- a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsScreenContent.kt +++ b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsScreenContent.kt @@ -33,20 +33,20 @@ fun DetailsRoute( DetailsScreenContent( onBackClick = onBackClick, - modifier = modifier, detailsState = detailsState, networkStatus = networkStatus, - onRetry = viewModel::retry + onRetry = viewModel::retry, + modifier = modifier ) } @Composable private fun DetailsScreenContent( onBackClick: () -> Unit, - modifier: Modifier = Modifier, detailsState: ScreenState, networkStatus: NetworkStatus, - onRetry: () -> Unit + onRetry: () -> Unit, + modifier: Modifier = Modifier ) { if (networkStatus.isAvailable && detailsState.isFailure && detailsState.throwable is UnknownHostException) { onRetry() @@ -56,11 +56,10 @@ private fun DetailsScreenContent( modifier = modifier, topBar = { DetailsToolbar( - modifier = Modifier - .statusBarsPadding(), - onNavigationIconClick = onBackClick, movieTitle = detailsState.toolbarTitle, - movieUrl = detailsState.movieUrl + movieUrl = detailsState.movieUrl, + onNavigationIconClick = onBackClick, + modifier = Modifier.statusBarsPadding() ) }, containerColor = MaterialTheme.colorScheme.primaryContainer diff --git a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsShareButton.kt b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsShareButton.kt index 50dd2bdf0..fe28093d6 100644 --- a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsShareButton.kt +++ b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsShareButton.kt @@ -8,6 +8,7 @@ import androidx.compose.foundation.Image import androidx.compose.material3.IconButton import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.tooling.preview.PreviewParameter @@ -21,7 +22,8 @@ import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun DetailsShareButton( - movieUrl: String + movieUrl: String, + modifier: Modifier = Modifier ) { val context: Context = LocalContext.current val resultContract = rememberLauncherForActivityResult( @@ -39,7 +41,8 @@ fun DetailsShareButton( Intent.createChooser(intent, context.getString(R.string.details_share_via)) ) } - } + }, + modifier = modifier ) { Image( imageVector = MoviesIcons.Share, diff --git a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsToolbar.kt b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsToolbar.kt index dcf6e97b9..aa798e787 100644 --- a/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsToolbar.kt +++ b/feature/details-impl/src/main/kotlin/org/michaelbel/movies/details/ui/DetailsToolbar.kt @@ -22,10 +22,10 @@ import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun DetailsToolbar( - modifier: Modifier = Modifier, - onNavigationIconClick: () -> Unit, movieTitle: String, - movieUrl: String? + movieUrl: String?, + onNavigationIconClick: () -> Unit, + modifier: Modifier = Modifier ) { TopAppBar( title = { @@ -77,11 +77,10 @@ private fun DetailsToolbarPreview( ) { MoviesTheme { DetailsToolbar( - modifier = Modifier - .statusBarsPadding(), - onNavigationIconClick = {}, movieTitle = title, - movieUrl = null + movieUrl = null, + onNavigationIconClick = {}, + modifier = Modifier.statusBarsPadding() ) } } \ No newline at end of file diff --git a/feature/details/build.gradle.kts b/feature/details/build.gradle.kts index 4ba87df58..f51e4fdeb 100644 --- a/feature/details/build.gradle.kts +++ b/feature/details/build.gradle.kts @@ -1,6 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("movies-android-library-compose") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) } android { @@ -27,6 +28,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -38,4 +44,6 @@ android { dependencies { implementation(project(":feature:details-impl")) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/feature/feed-impl/build.gradle.kts b/feature/feed-impl/build.gradle.kts index 083d8c625..f6b1d3328 100644 --- a/feature/feed-impl/build.gradle.kts +++ b/feature/feed-impl/build.gradle.kts @@ -1,6 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("movies-android-library-compose") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) id("movies-android-hilt") } @@ -38,6 +39,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -60,4 +66,6 @@ dependencies { androidTestImplementation(libs.androidx.compose.ui.test.junit4) androidTestImplementation(libs.androidx.benchmark.junit) debugImplementation(libs.androidx.compose.ui.test.manifest) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedContent.kt b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedContent.kt index 5f8ecbb91..de4eff286 100644 --- a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedContent.kt +++ b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedContent.kt @@ -23,20 +23,21 @@ import org.michaelbel.movies.ui.ktx.isPagingLoading @Composable fun FeedContent( - modifier: Modifier = Modifier, - paddingValues: PaddingValues = PaddingValues(), listState: LazyListState, pagingItems: LazyPagingItems, - onMovieClick: (Int) -> Unit + onMovieClick: (Int) -> Unit, + contentPadding: PaddingValues, + modifier: Modifier = Modifier, ) { LazyColumn( modifier = modifier, state = listState, - contentPadding = paddingValues + contentPadding = contentPadding ) { items(pagingItems) { movieItem -> movieItem?.let { movie -> FeedMovieBox( + movie = movie, modifier = Modifier .fillMaxWidth() .padding( @@ -47,8 +48,7 @@ fun FeedContent( .background(MaterialTheme.colorScheme.inversePrimary) .clickable { onMovieClick(movie.movieId) - }, - movie = movie + } ) } } diff --git a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedLoading.kt b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedLoading.kt index 0c6e08de6..352bca9c5 100644 --- a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedLoading.kt +++ b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedLoading.kt @@ -29,6 +29,7 @@ fun FeedLoading( ) { items(MovieResponse.DEFAULT_PAGE_SIZE) { FeedMovieBox( + movie = MovieDb.Empty, modifier = Modifier .fillMaxWidth() .padding( @@ -40,8 +41,7 @@ fun FeedLoading( color = MaterialTheme.colorScheme.inversePrimary, shape = MaterialTheme.shapes.small, highlight = PlaceholderHighlight.fade() - ), - movie = MovieDb.Empty + ) ) } } diff --git a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedMovieBox.kt b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedMovieBox.kt index d7a64d948..07f382752 100644 --- a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedMovieBox.kt +++ b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedMovieBox.kt @@ -33,8 +33,8 @@ import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun FeedMovieBox( - modifier: Modifier = Modifier, - movie: MovieDb + movie: MovieDb, + modifier: Modifier = Modifier ) { var isNoImageVisible: Boolean by remember { mutableStateOf(false) } @@ -111,6 +111,7 @@ private fun MovieBoxPreview( ) { MoviesTheme { FeedMovieBox( + movie = movie, modifier = Modifier .fillMaxWidth() .padding( @@ -118,8 +119,7 @@ private fun MovieBoxPreview( vertical = 4.dp ) .clip(MaterialTheme.shapes.small) - .background(MaterialTheme.colorScheme.inversePrimary), - movie = movie + .background(MaterialTheme.colorScheme.inversePrimary) ) } } \ No newline at end of file diff --git a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt index e25ebf93f..09df85ecb 100644 --- a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt +++ b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedScreenContent.kt @@ -59,7 +59,6 @@ fun FeedRoute( val networkStatus: NetworkStatus by viewModel.networkStatus.collectAsStateWithLifecycle() FeedScreenContent( - modifier = modifier, pagingItems = pagingItems, account = account.orEmpty, networkStatus = networkStatus, @@ -67,13 +66,13 @@ fun FeedRoute( onNavigateToAuth = onNavigateToAuth, onNavigateToAccount = onNavigateToAccount, onNavigateToSettings = onNavigateToSettings, - onNavigateToDetails = onNavigateToDetails + onNavigateToDetails = onNavigateToDetails, + modifier = modifier ) } @Composable private fun FeedScreenContent( - modifier: Modifier = Modifier, pagingItems: LazyPagingItems, account: AccountDb, networkStatus: NetworkStatus, @@ -81,7 +80,8 @@ private fun FeedScreenContent( onNavigateToAuth: () -> Unit, onNavigateToAccount: () -> Unit, onNavigateToSettings: () -> Unit, - onNavigateToDetails: (Int) -> Unit + onNavigateToDetails: (Int) -> Unit, + modifier: Modifier = Modifier ) { val context: Context = LocalContext.current val scope: CoroutineScope = rememberCoroutineScope() @@ -167,12 +167,11 @@ private fun FeedScreenContent( } else -> { FeedContent( - modifier = Modifier - .fillMaxSize(), - paddingValues = paddingValues, listState = listState, pagingItems = pagingItems, - onMovieClick = onNavigateToDetails + onMovieClick = onNavigateToDetails, + contentPadding = paddingValues, + modifier = Modifier.fillMaxSize() ) } } diff --git a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt index 1866e3a00..99e344503 100644 --- a/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt +++ b/feature/feed-impl/src/main/kotlin/org/michaelbel/movies/feed/ui/FeedToolbar.kt @@ -27,12 +27,12 @@ import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun FeedToolbar( - modifier: Modifier = Modifier, account: AccountDb, isSettingsIconVisible: Boolean, onAuthIconClick: () -> Unit, onAccountIconClick: () -> Unit, - onSettingsIconClick: () -> Unit + onSettingsIconClick: () -> Unit, + modifier: Modifier = Modifier ) { TopAppBar( title = { @@ -70,10 +70,9 @@ fun FeedToolbar( ) } else { AccountAvatar( - modifier = Modifier - .size(32.dp), account = account, - fontSize = account.lettersTextFontSizeSmall + fontSize = account.lettersTextFontSizeSmall, + modifier = Modifier.size(32.dp) ) } } @@ -91,13 +90,12 @@ private fun FeedToolbarPreview( ) { MoviesTheme { FeedToolbar( - modifier = Modifier - .statusBarsPadding(), account = AccountDb.Empty, isSettingsIconVisible = visible, onAccountIconClick = {}, onAuthIconClick = {}, - onSettingsIconClick = {} + onSettingsIconClick = {}, + modifier = Modifier.statusBarsPadding() ) } } \ No newline at end of file diff --git a/feature/feed/build.gradle.kts b/feature/feed/build.gradle.kts index a641d7fdc..2df65842f 100644 --- a/feature/feed/build.gradle.kts +++ b/feature/feed/build.gradle.kts @@ -1,6 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("movies-android-library-compose") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) } android { @@ -27,6 +28,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -38,4 +44,6 @@ android { dependencies { implementation(project(":feature:feed-impl")) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/feature/settings-impl/build.gradle.kts b/feature/settings-impl/build.gradle.kts index a0891e6e7..8843c8187 100644 --- a/feature/settings-impl/build.gradle.kts +++ b/feature/settings-impl/build.gradle.kts @@ -1,6 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("movies-android-library-compose") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) id("movies-android-hilt") } @@ -31,6 +32,7 @@ android { } buildFeatures { + buildConfig = true compose = true } @@ -38,6 +40,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -60,4 +67,6 @@ dependencies { androidTestImplementation(libs.androidx.compose.ui.test.junit4) androidTestImplementation(libs.androidx.benchmark.junit) debugImplementation(libs.androidx.compose.ui.test.manifest) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsDynamicColorsBoxTest.kt b/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsDynamicColorsBoxTest.kt index d8db54086..f935b9e27 100644 --- a/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsDynamicColorsBoxTest.kt +++ b/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsDynamicColorsBoxTest.kt @@ -25,11 +25,11 @@ internal class SettingsDynamicColorsBoxTest { composeTestRule.setContent { MoviesTheme { SettingsDynamicColorsBox( + isDynamicColorsEnabled = IS_DYNAMIC_COLORS_ENABLED, modifier = Modifier .fillMaxWidth() .height(48.dp) - .clickable {}, - isDynamicColorsEnabled = IS_DYNAMIC_COLORS_ENABLED + .clickable {} ) } } diff --git a/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageBoxTest.kt b/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageBoxTest.kt index 3345c3682..b9cdb69cb 100644 --- a/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageBoxTest.kt +++ b/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageBoxTest.kt @@ -25,12 +25,12 @@ internal class SettingsLanguageBoxTest { composeTestRule.setContent { MoviesTheme { SettingsLanguageBox( - modifier = Modifier - .fillMaxWidth() - .height(48.dp), languages = LANGUAGES, currentLanguage = CURRENT_LANGUAGE, - onLanguageSelect = {} + onLanguageSelect = {}, + modifier = Modifier + .fillMaxWidth() + .height(48.dp) ) } } diff --git a/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsRtlBoxTest.kt b/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsRtlBoxTest.kt index e1fd3ea5a..f74c215ab 100644 --- a/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsRtlBoxTest.kt +++ b/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsRtlBoxTest.kt @@ -25,11 +25,11 @@ internal class SettingsRtlBoxTest { composeTestRule.setContent { MoviesTheme { SettingsRtlBox( + isRtlEnabled = IS_RTL_ENABLED, modifier = Modifier .fillMaxWidth() .height(48.dp) - .clickable {}, - isRtlEnabled = IS_RTL_ENABLED + .clickable {} ) } } diff --git a/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeBoxTest.kt b/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeBoxTest.kt index b3d5dc8e9..e416a69d3 100644 --- a/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeBoxTest.kt +++ b/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeBoxTest.kt @@ -25,12 +25,12 @@ internal class SettingsThemeBoxTest { composeTestRule.setContent { MoviesTheme { SettingsThemeBox( - modifier = Modifier - .fillMaxWidth() - .height(48.dp), themes = THEMES, currentTheme = CURRENT_THEME, - onThemeSelect = {} + onThemeSelect = {}, + modifier = Modifier + .fillMaxWidth() + .height(48.dp) ) } } diff --git a/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBoxTest.kt b/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBoxTest.kt index 506098eda..5ca7e95aa 100644 --- a/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBoxTest.kt +++ b/feature/settings-impl/src/androidTest/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBoxTest.kt @@ -23,10 +23,10 @@ internal class SettingsVersionBoxTest { composeTestRule.setContent { MoviesTheme { SettingsVersionBox( + appVersionData = APP_VERSION_DATA, modifier = Modifier .navigationBarsPadding() - .fillMaxWidth(), - appVersionData = APP_VERSION_DATA + .fillMaxWidth() ) } } diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsDynamicColorsBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsDynamicColorsBox.kt index a82232e6a..32f052d7b 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsDynamicColorsBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsDynamicColorsBox.kt @@ -21,12 +21,11 @@ import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun SettingsDynamicColorsBox( - modifier: Modifier = Modifier, - isDynamicColorsEnabled: Boolean + isDynamicColorsEnabled: Boolean, + modifier: Modifier = Modifier ) { ConstraintLayout( - modifier = modifier - .testTag("ConstraintLayout") + modifier = modifier.testTag("ConstraintLayout") ) { val (title, value) = createRefs() @@ -69,11 +68,11 @@ private fun SettingsDynamicColorsBoxPreview( ) { MoviesTheme { SettingsDynamicColorsBox( + isDynamicColorsEnabled = isEnabled, modifier = Modifier .fillMaxWidth() .height(48.dp) - .background(MaterialTheme.colorScheme.primaryContainer), - isDynamicColorsEnabled = isEnabled + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageBox.kt index 3e1ec6819..321b647df 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageBox.kt @@ -27,10 +27,10 @@ import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun SettingsLanguageBox( - modifier: Modifier = Modifier, languages: List, currentLanguage: AppLanguage, - onLanguageSelect: (AppLanguage) -> Unit + onLanguageSelect: (AppLanguage) -> Unit, + modifier: Modifier = Modifier, ) { var languageDialog: Boolean by remember { mutableStateOf(false) } @@ -95,13 +95,13 @@ private fun SettingsLanguageBoxPreview( ) { MoviesTheme { SettingsLanguageBox( + languages = listOf(AppLanguage.English, AppLanguage.Russian), + currentLanguage = language, + onLanguageSelect = {}, modifier = Modifier .fillMaxWidth() .height(48.dp) - .background(MaterialTheme.colorScheme.primaryContainer), - languages = listOf(AppLanguage.English, AppLanguage.Russian), - currentLanguage = language, - onLanguageSelect = {} + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageDialog.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageDialog.kt index edfb69bc7..900e1bd7e 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageDialog.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsLanguageDialog.kt @@ -75,14 +75,13 @@ fun SettingLanguageDialog( }, text = { SettingLanguageDialogContent( - modifier = Modifier - .testTag("Content"), languages = languages, currentLanguage = currentLanguage, onLanguageSelect = { language -> onLanguageSelect(language) onDismissRequest() - } + }, + modifier = Modifier.testTag("Content") ) }, shape = RoundedCornerShape(28.dp), @@ -98,10 +97,10 @@ fun SettingLanguageDialog( @Composable private fun SettingLanguageDialogContent( - modifier: Modifier, languages: List, currentLanguage: AppLanguage, - onLanguageSelect: (AppLanguage) -> Unit + onLanguageSelect: (AppLanguage) -> Unit, + modifier: Modifier = Modifier ) { Column( modifier = modifier diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsNetworkRequestDelayBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsNetworkRequestDelayBox.kt index cc195624f..2c3f7d975 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsNetworkRequestDelayBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsNetworkRequestDelayBox.kt @@ -26,9 +26,9 @@ import kotlin.math.roundToInt @Composable fun SettingsNetworkRequestDelayBox( - modifier: Modifier = Modifier, delay: Int, - onDelayChangeFinished: (Int) -> Unit + onDelayChangeFinished: (Int) -> Unit, + modifier: Modifier = Modifier ) { var sliderPosition: Float by remember { mutableStateOf(delay.toFloat()) } sliderPosition = delay.toFloat() diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsReviewBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsReviewBox.kt index e78c01dba..18b052f02 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsReviewBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsReviewBox.kt @@ -21,8 +21,7 @@ fun SettingsReviewBox( modifier: Modifier = Modifier ) { ConstraintLayout( - modifier = modifier - .testTag("ConstraintLayout") + modifier = modifier.testTag("ConstraintLayout") ) { val (title) = createRefs() diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsRtlBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsRtlBox.kt index f8ebaca0b..0e15bd298 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsRtlBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsRtlBox.kt @@ -21,12 +21,11 @@ import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun SettingsRtlBox( - modifier: Modifier = Modifier, - isRtlEnabled: Boolean + isRtlEnabled: Boolean, + modifier: Modifier = Modifier ) { ConstraintLayout( - modifier = modifier - .testTag("ConstraintLayout") + modifier = modifier.testTag("ConstraintLayout") ) { val (title, value) = createRefs() @@ -69,11 +68,11 @@ private fun SettingsRtlBoxPreview( ) { MoviesTheme { SettingsRtlBox( + isRtlEnabled = isEnabled, modifier = Modifier .fillMaxWidth() .height(48.dp) - .background(MaterialTheme.colorScheme.primaryContainer), - isRtlEnabled = isEnabled + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsScreenContent.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsScreenContent.kt index d3321ecf0..0fd3e41d9 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsScreenContent.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsScreenContent.kt @@ -63,7 +63,6 @@ fun SettingsRoute( SettingsScreenContent( onBackClick = onBackClick, - modifier = modifier, languages = viewModel.languages, currentLanguage = currentLanguage, onLanguageSelect = viewModel::selectLanguage, @@ -81,14 +80,14 @@ fun SettingsRoute( isAppFromGooglePlay = isAppFromGooglePlay, networkRequestDelay = networkRequestDelay, onDelayChangeFinished = viewModel::setNetworkRequestDelay, - appVersionData = appVersionData + appVersionData = appVersionData, + modifier = modifier ) } @Composable private fun SettingsScreenContent( onBackClick: () -> Unit, - modifier: Modifier = Modifier, languages: List, currentLanguage: AppLanguage, onLanguageSelect: (AppLanguage) -> Unit, @@ -106,7 +105,8 @@ private fun SettingsScreenContent( isAppFromGooglePlay: Boolean, networkRequestDelay: Int, onDelayChangeFinished: (Int) -> Unit, - appVersionData: AppVersionData + appVersionData: AppVersionData, + modifier: Modifier = Modifier ) { val context: Context = LocalContext.current val scope: CoroutineScope = rememberCoroutineScope() @@ -179,10 +179,10 @@ private fun SettingsScreenContent( }, bottomBar = { SettingsVersionBox( + appVersionData = appVersionData, modifier = Modifier .navigationBarsPadding() - .fillMaxWidth(), - appVersionData = appVersionData + .fillMaxWidth() ) }, snackbarHost = { @@ -193,48 +193,47 @@ private fun SettingsScreenContent( containerColor = MaterialTheme.colorScheme.primaryContainer ) { paddingValues: PaddingValues -> Column( - modifier = Modifier - .padding(paddingValues) + modifier = Modifier.padding(paddingValues) ) { SettingsLanguageBox( - modifier = Modifier - .fillMaxWidth() - .height(48.dp), languages = languages, currentLanguage = currentLanguage, - onLanguageSelect = onLanguageSelect + onLanguageSelect = onLanguageSelect, + modifier = Modifier + .fillMaxWidth() + .height(48.dp) ) SettingsThemeBox( - modifier = Modifier - .fillMaxWidth() - .height(48.dp), themes = themes, currentTheme = currentTheme, - onThemeSelect = onThemeSelect + onThemeSelect = onThemeSelect, + modifier = Modifier + .fillMaxWidth() + .height(48.dp) ) if (isDynamicColorsFeatureEnabled) { SettingsDynamicColorsBox( + isDynamicColorsEnabled = dynamicColors, modifier = Modifier .fillMaxWidth() .height(48.dp) .clickable { onSetDynamicColors(!dynamicColors) - }, - isDynamicColorsEnabled = dynamicColors + } ) } if (isRtlFeatureEnabled) { SettingsRtlBox( + isRtlEnabled = isRtlEnabled, modifier = Modifier .fillMaxWidth() .height(48.dp) .clickable { onEnableRtlChanged(!isRtlEnabled) - }, - isRtlEnabled = isRtlEnabled + } ) } @@ -258,10 +257,9 @@ private fun SettingsScreenContent( if (BuildConfig.DEBUG) { SettingsNetworkRequestDelayBox( - modifier = Modifier - .fillMaxWidth(), delay = networkRequestDelay, - onDelayChangeFinished = onDelayChangeFinished + onDelayChangeFinished = onDelayChangeFinished, + modifier = Modifier.fillMaxWidth() ) } } diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeBox.kt index 7bf3fcb36..419baa594 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeBox.kt @@ -27,10 +27,10 @@ import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun SettingsThemeBox( - modifier: Modifier = Modifier, themes: List, currentTheme: AppTheme, - onThemeSelect: (AppTheme) -> Unit + onThemeSelect: (AppTheme) -> Unit, + modifier: Modifier = Modifier ) { var themeDialog: Boolean by remember { mutableStateOf(false) } @@ -95,13 +95,13 @@ private fun SettingsThemeBoxPreview( ) { MoviesTheme { SettingsThemeBox( + themes = listOf(AppTheme.FollowSystem, AppTheme.NightNo, AppTheme.NightYes), + currentTheme = theme, + onThemeSelect = {}, modifier = Modifier .fillMaxWidth() .height(48.dp) - .background(MaterialTheme.colorScheme.primaryContainer), - themes = listOf(AppTheme.FollowSystem, AppTheme.NightNo, AppTheme.NightYes), - currentTheme = theme, - onThemeSelect = {} + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeDialog.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeDialog.kt index f9d03404a..7108e505f 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeDialog.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsThemeDialog.kt @@ -76,14 +76,13 @@ internal fun SettingThemeDialog( }, text = { SettingThemeDialogContent( - modifier = Modifier - .testTag("Content"), themes = themes, currentTheme = currentTheme, onThemeSelect = { theme -> onThemeSelect(theme) onDismissRequest() - } + }, + modifier = Modifier.testTag("Content") ) }, shape = RoundedCornerShape(28.dp), @@ -99,10 +98,10 @@ internal fun SettingThemeDialog( @Composable private fun SettingThemeDialogContent( - modifier: Modifier, themes: List, currentTheme: AppTheme, - onThemeSelect: (AppTheme) -> Unit + onThemeSelect: (AppTheme) -> Unit, + modifier: Modifier = Modifier ) { Column( modifier = modifier diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsToolbar.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsToolbar.kt index 21d3af1d7..2f58fad3c 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsToolbar.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsToolbar.kt @@ -28,8 +28,7 @@ internal fun SettingsToolbar( title = { Text( text = stringResource(R.string.settings_title), - modifier = Modifier - .testTag("TitleText"), + modifier = Modifier.testTag("TitleText"), overflow = TextOverflow.Ellipsis, maxLines = 1, style = MaterialTheme.typography.titleLarge.copy( @@ -37,19 +36,16 @@ internal fun SettingsToolbar( ) ) }, - modifier = modifier - .testTag("TopAppBar"), + modifier = modifier.testTag("TopAppBar"), navigationIcon = { IconButton( onClick = onNavigationIconClick, - modifier = Modifier - .testTag("BackIconButton") + modifier = Modifier.testTag("BackIconButton") ) { Image( imageVector = MoviesIcons.ArrowBack, contentDescription = null, - modifier = Modifier - .testTag("BackImage"), + modifier = Modifier.testTag("BackImage"), colorFilter = ColorFilter.tint(MaterialTheme.colorScheme.onPrimaryContainer) ) } @@ -65,8 +61,7 @@ internal fun SettingsToolbar( private fun SettingsToolbarPreview() { MoviesTheme { SettingsToolbar( - modifier = Modifier - .statusBarsPadding(), + modifier = Modifier.statusBarsPadding(), onNavigationIconClick = {} ) } diff --git a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBox.kt b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBox.kt index b088235ec..5fcbbde43 100644 --- a/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBox.kt +++ b/feature/settings-impl/src/main/kotlin/org/michaelbel/movies/settings/ui/SettingsVersionBox.kt @@ -25,12 +25,11 @@ import org.michaelbel.movies.ui.theme.MoviesTheme @Composable fun SettingsVersionBox( - modifier: Modifier = Modifier, - appVersionData: AppVersionData + appVersionData: AppVersionData, + modifier: Modifier = Modifier ) { ConstraintLayout( - modifier = modifier - .testTag("ConstraintLayout") + modifier = modifier.testTag("ConstraintLayout") ) { val (icon, version, code) = createRefs() createHorizontalChain(icon, version, code, chainStyle = ChainStyle.Packed) @@ -96,11 +95,11 @@ private fun SettingsVersionBoxPreview( ) { MoviesTheme { SettingsVersionBox( + appVersionData = appVersionData, modifier = Modifier .fillMaxWidth() .wrapContentHeight() - .background(MaterialTheme.colorScheme.primaryContainer), - appVersionData = appVersionData + .background(MaterialTheme.colorScheme.primaryContainer) ) } } \ No newline at end of file diff --git a/feature/settings/build.gradle.kts b/feature/settings/build.gradle.kts index bcda9937d..827b0c8a1 100644 --- a/feature/settings/build.gradle.kts +++ b/feature/settings/build.gradle.kts @@ -1,6 +1,7 @@ +@Suppress("dsl_scope_violation") plugins { - id("movies-android-library") - id("movies-android-library-compose") + alias(libs.plugins.library) + alias(libs.plugins.kotlin) } android { @@ -27,6 +28,11 @@ android { kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get() } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + lint { quiet = true abortOnError = false @@ -38,4 +44,6 @@ android { dependencies { implementation(project(":feature:settings-impl")) + + lintChecks(libs.lint.checks) } \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 56545f786..8d18c27d9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,18 +1,23 @@ org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8 -org.gradle.parallel=false -kotlin.code.style=official +# https://docs.gradle.org/current/userguide/performance.html#parallel_execution +org.gradle.parallel=true +# https://d.android.com/jetpack/androidx/migrate android.useAndroidX=true -android.enableJetifier=true -android.nonTransitiveRClass=true -android.defaults.buildFeatures.aidl=false -android.defaults.buildFeatures.buildConfig=false -android.defaults.buildFeatures.compose=false -android.defaults.buildFeatures.dataBinding=false -android.defaults.buildFeatures.prefab=false -android.defaults.buildFeatures.renderScript=false +# If your project already has the enableJetifier flag and it's turned on, you can run +# Build Analyzer's Jetifier check to confirm if it's actually needed. +# https://d.android.com/jetpack/androidx/migrate#migrate_an_existing_project_using_android_studio +# https://d.android.com/build/optimize-your-build#disable-the-jetifier-flag +android.enableJetifier=false + +# https://d.android.com/reference/tools/gradle-api/8.0/com/android/build/api/dsl/BuildFeatures#resValues() +# Flag to enable Resource Values generation. +# Default value is true. android.defaults.buildFeatures.resValues=false -android.defaults.buildFeatures.shaders=false -android.defaults.buildFeatures.viewBinding=false \ No newline at end of file + +# https://d.android.com/reference/tools/gradle-api/8.0/com/android/build/api/dsl/BuildFeatures#shaders() +# Flag to enable Shader compilation. +# Default value is true. +android.defaults.buildFeatures.shaders=false \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ccc53339b..e5b68e605 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -8,40 +8,40 @@ compile-sdk = "33" # @keep target-sdk = "33" # @pin -gradle = "7.4.2" +gradle = "8.0.0" # @pin update when updating compose compiler -kotlin = "1.8.10" -kotlin-ksp = "1.8.10-1.0.9" +kotlin = "1.8.20" +kotlin-ksp = "1.8.20-1.0.11" kotlin-coroutines = "1.6.4" kotlin-serialization = "1.5.0" # @pin update when updating kotlin -compose-compiler = "1.4.3" +compose-compiler = "1.4.6" detekt = "1.22.0" -spotless = "6.17.0" +spotless = "6.18.0" google-services = "4.3.15" play-services-ads = "22.0.0" play-services-base = "18.2.0" -firebase-analytics = "21.2.1" +firebase-analytics = "21.2.2" firebase-appdistribution = "3.2.0" firebase-config = "21.3.0" firebase-crashlytics-plugin = "2.9.4" firebase-crashlytics = "18.3.6" play-core = "1.8.1" -accompanist = "0.30.0" +accompanist = "0.30.1" material = "1.8.0" material-compose-theme-adapter = "1.2.1" hilt = "2.45" -androidx-compose-foundation = "1.4.0" -androidx-compose-runtime = "1.4.0" -androidx-compose-ui = "1.4.0" -androidx-compose-compiler = "1.4.4" -androidx-compose-material = "1.4.0" +androidx-compose-foundation = "1.4.2" +androidx-compose-runtime = "1.4.2" +androidx-compose-ui = "1.4.2" +androidx-compose-compiler = "1.4.6" +androidx-compose-material = "1.4.2" androidx-compose-material3 = "1.0.1" -androidx-appcompat = "1.6.0-rc01" -androidx-activity = "1.7.0" +androidx-appcompat = "1.7.0-alpha02" +androidx-activity = "1.7.1" androidx-browser = "1.5.0" -androidx-core = "1.9.0" -androidx-core-splashscreen = "1.0.0" +androidx-core = "1.10.0" +androidx-core-splashscreen = "1.0.1" androidx-constraintlayout = "1.0.1" androidx-lifecycle = "2.6.1" androidx-hilt-navigation-compose = "1.0.0" @@ -58,14 +58,18 @@ androidx-espresso-core = "3.5.1" androidx-benchmark = "1.1.1" androidx-profile-installer = "1.3.0" androidx-work = "2.8.1" -coil = "2.2.2" -okhttp = "4.10.0" +coil = "2.3.0" +okhttp = "4.11.0" retrofit = "2.9.0" -retrofit-converter-serialization = "0.8.0" +retrofit-converter-serialization = "1.0.0" chucker = "3.5.2" timber = "5.0.1" javapoet = "1.13.0" junit = "4.13.2" +lint-checks = "1.2.0" +palantir-git = "3.0.0" +ben-manes-versions = "0.46.0" +littlerobots-version-catalog-update = "0.8.0" [libraries] kotlin-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutines" } @@ -142,6 +146,7 @@ chucker-library-no-op = { module = "com.github.chuckerteam.chucker:library-no-op timber = { module = "com.jakewharton.timber:timber", version.ref = "timber" } javapoet = { module = "com.squareup:javapoet", version.ref = "javapoet" } junit = { module = "junit:junit", version.ref = "junit" } +lint-checks = { module = "com.slack.lint.compose:compose-lint-checks", version.ref = "lint-checks" } gradle-plugin = { module = "com.android.tools.build:gradle", version.ref = "gradle" } kotlin-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } @@ -208,4 +213,7 @@ hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } androidx-navigation-safeargs = { id = "androidx.navigation.safeargs.kotlin", version.ref = "androidx-navigation" } application = { id = "com.android.application", version.ref = "gradle" } library = { id = "com.android.library", version.ref = "gradle" } -test = { id = "com.android.test", version.ref = "gradle" } \ No newline at end of file +test = { id = "com.android.test", version.ref = "gradle" } +palantir-git = { id = "com.palantir.git-version", version.ref = "palantir-git" } +ben-manes-versions = { id = "com.github.ben-manes.versions", version.ref = "ben-manes-versions" } +littlerobots-version-catalog-update = { id = "nl.littlerobots.version-catalog-update", version.ref = "littlerobots-version-catalog-update" } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0643dcb7d..afcd5d3a4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Sun Apr 04 22:00:34 MSK 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME \ No newline at end of file diff --git a/readme.md b/readme.md index 21891f6c6..79d29ca27 100644 --- a/readme.md +++ b/readme.md @@ -32,8 +32,8 @@ TMDB_API_KEY=your_own_tmdb_api_key - [x] [Clean Architecture](https://d.android.com/topic/architecture) - [x] [TMDB API](https://developers.themoviedb.org/3/getting-started) - [x] [KTS Gradle Files](https://d.android.com/studio/build/migrate-to-kts) -- [x] [Kotlin Symbol Processing API](https://d.android.com/studio/build/migrate-to-ksp) 1.8.10-1.0.9 -- [x] [Gradle Plugin](https://d.android.com/studio/releases/gradle-plugin) 7.4.2 +- [x] [Kotlin Symbol Processing API](https://d.android.com/studio/build/migrate-to-ksp) 1.8.20-1.0.11 +- [x] [Gradle Plugin](https://d.android.com/studio/releases/gradle-plugin) 8.0.0 - [x] Gradle Version Catalog - [x] MinSDK 21 - [x] TargetSDK 33 @@ -42,9 +42,9 @@ TMDB_API_KEY=your_own_tmdb_api_key - [x] [Dark Theme](https://d.android.com/develop/ui/views/theming/darktheme) - [x] [Dynamic Colors](https://d.android.com/develop/ui/views/theming/dynamic-colors) - [x] [Themed App Icon](https://d.android.com/develop/ui/views/launch/icon_design_adaptive) -- [x] 100% [Kotlin](https://d.android.com/kotlin) 1.8.10 -- [x] 100% [Jetpack Compose](https://d.android.com/jetpack/compose) 1.4.3 -- [x] [Accompanist](https://github.com/google/accompanist) 0.30.0 +- [x] 100% [Kotlin](https://d.android.com/kotlin) 1.8.20 +- [x] 100% [Jetpack Compose](https://d.android.com/jetpack/compose) 1.4.6 +- [x] [Accompanist](https://github.com/google/accompanist) 0.30.1 - [x] [Compose PreviewParameterProvider](https://d.android.com/jetpack/compose/tooling#previewparameter) - [x] [Downloadable Fonts](https://d.android.com/develop/ui/views/text-and-emoji/downloadable-fonts) - [x] [KotlinX Coroutines](https://github.com/Kotlin/kotlinx.coroutines) 1.6.4 @@ -61,16 +61,16 @@ TMDB_API_KEY=your_own_tmdb_api_key - [x] [Paging](https://d.android.com/topic/libraries/architecture/paging/v3-overview) (RemoteMediator & PagingSource) 1.0.0-alpha18 - [x] [ConstraintLayout](https://d.android.com/develop/ui/views/layout/constraint-layout) - [x] [Browser](https://d.android.com/jetpack/androidx/releases/browser) 1.5.0 -- [x] [OkHttp](https://github.com/square/okhttp) 4.10.0 +- [x] [OkHttp](https://github.com/square/okhttp) 4.11.0 - [x] [Retrofit](https://github.com/square/retrofit) 2.9.0 - [x] [Retrofit Kotlinx Converter Serialization](https://github.com/JakeWharton/retrofit2-kotlinx-serialization-converter) 0.8.0 - [x] [Chucker](https://github.com/ChuckerTeam/chucker) 3.5.2 -- [x] [Coil](https://github.com/coil-kt/coil) 2.2.2 +- [x] [Coil](https://github.com/coil-kt/coil) 2.3.0 - [x] [Timber](https://github.com/JakeWharton/timber) 5.0.1 - [x] [Firebase Crashlytics](https://firebase.google.com/products/crashlytics) 18.3.6 - [x] [Firebase App Distribution](https://firebase.google.com/products/app-distribution) 3.2.0 - [x] [Firebase Remote Config](https://firebase.google.com/products/remote-config) 21.3.0 -- [x] [Google Analytics for Firebase](https://firebase.google.com/products/analytics) 21.2.0 +- [x] [Google Analytics for Firebase](https://firebase.google.com/products/analytics) 21.2.2 - [x] [In-App Reviews](https://d.android.com/guide/playcore/in-app-review) - [x] [App Shortcuts](https://d.android.com/develop/ui/views/launch/shortcuts) - [x] [Dependabot](https://github.com/dependabot) @@ -78,10 +78,10 @@ TMDB_API_KEY=your_own_tmdb_api_key - [x] [Github Releases](https://github.com/michaelbel/movies/releases) - [x] [Lint](https://d.android.com/studio/write/lint) - [x] [Detekt](https://github.com/detekt/detekt) 1.22.0 -- [x] [Spotless](https://github.com/diffplug/spotless) 6.17.0 +- [x] [Spotless](https://github.com/diffplug/spotless) 6.18.0 - [x] [Distribute App via Telegram Bot](https://github.com/appleboy/telegram-action) - [x] [Non-Transitive R classes](https://d.android.com/studio/build/optimize-your-build#use-non-transitive-r-classes) -- [x] [SplashScreen API](https://d.android.com/develop/ui/views/launch/splash-screen) +- [x] [SplashScreen API](https://d.android.com/develop/ui/views/launch/splash-screen) 1.0.1 - [x] [Per-App Language Preferences](https://d.android.com/guide/topics/resources/app-languages) - [x] [Settings Panel](https://d.android.com/reference/android/provider/Settings.Panel) - [x] [Benchmark](https://d.android.com/topic/performance/benchmarking/benchmarking-overview)