From 6f131db8df60f925d01978d5a64dde20b7e9f7b6 Mon Sep 17 00:00:00 2001 From: Ali Nasrabadi Date: Sat, 13 Jul 2024 11:19:43 +0330 Subject: [PATCH] Fix detekt issues --- app/src/main/java/me/nasrabadiam/tictactoe/home/HomeScreen.kt | 3 --- .../main/java/me/nasrabadiam/tictactoe/strings/AppStrings.kt | 4 ++-- library/resources/build.gradle.kts | 2 +- .../src/main/java/me/nasrabadiam/resources/LocaleManager.kt | 3 +-- .../src/main/java/me/nasrabadiam/resources/Lyricist.kt | 2 +- .../src/main/java/me/nasrabadiam/resources/LyricistCompose.kt | 4 ++-- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/me/nasrabadiam/tictactoe/home/HomeScreen.kt b/app/src/main/java/me/nasrabadiam/tictactoe/home/HomeScreen.kt index 6808dbd..2f547cd 100644 --- a/app/src/main/java/me/nasrabadiam/tictactoe/home/HomeScreen.kt +++ b/app/src/main/java/me/nasrabadiam/tictactoe/home/HomeScreen.kt @@ -2,7 +2,6 @@ package me.nasrabadiam.tictactoe.home import androidx.compose.foundation.Image import androidx.compose.foundation.background -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -36,8 +35,6 @@ import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import me.nasrabadiam.tictactoe.R import me.nasrabadiam.tictactoe.home.HomeEvent.PlayWithAFriend -import me.nasrabadiam.resources.LocaleManager -import me.nasrabadiam.resources.Locales import me.nasrabadiam.tictactoe.strings.appStrings import me.nasrabadiam.tictactoe.strings.getAppStrings import me.nasrabadiam.tictactoe.ui.GameWindowSizeClass diff --git a/app/src/main/java/me/nasrabadiam/tictactoe/strings/AppStrings.kt b/app/src/main/java/me/nasrabadiam/tictactoe/strings/AppStrings.kt index 99f8ff2..6c2cadf 100644 --- a/app/src/main/java/me/nasrabadiam/tictactoe/strings/AppStrings.kt +++ b/app/src/main/java/me/nasrabadiam/tictactoe/strings/AppStrings.kt @@ -18,8 +18,8 @@ internal val AppStrings: Map = mapOf( ) internal val AppStringsLayoutDirections: Map = mapOf( - Locales.EN.getName() to LayoutDirection.Ltr, - Locales.FA.getName() to LayoutDirection.Rtl, + Locales.EN.getName() to LayoutDirection.LTR, + Locales.FA.getName() to LayoutDirection.RTL, ) internal val LocalStrings: ProvidableCompositionLocal = diff --git a/library/resources/build.gradle.kts b/library/resources/build.gradle.kts index 6787e0d..ad9276f 100644 --- a/library/resources/build.gradle.kts +++ b/library/resources/build.gradle.kts @@ -9,7 +9,7 @@ java { targetCompatibility = JavaVersion.VERSION_17 } -dependencies{ +dependencies { implementation(libs.coroutines) implementation(platform(libs.compose.bom)) implementation(libs.ui) diff --git a/library/resources/src/main/java/me/nasrabadiam/resources/LocaleManager.kt b/library/resources/src/main/java/me/nasrabadiam/resources/LocaleManager.kt index 6a9bd1c..2adb8d0 100644 --- a/library/resources/src/main/java/me/nasrabadiam/resources/LocaleManager.kt +++ b/library/resources/src/main/java/me/nasrabadiam/resources/LocaleManager.kt @@ -22,8 +22,7 @@ public fun getLocale(): Locale { } public enum class Locales { - EN, - FA; + EN, FA } public fun Locales.getName(): String { diff --git a/library/resources/src/main/java/me/nasrabadiam/resources/Lyricist.kt b/library/resources/src/main/java/me/nasrabadiam/resources/Lyricist.kt index f97455d..cf562e3 100644 --- a/library/resources/src/main/java/me/nasrabadiam/resources/Lyricist.kt +++ b/library/resources/src/main/java/me/nasrabadiam/resources/Lyricist.kt @@ -71,5 +71,5 @@ public class LyricistException internal constructor( ) : RuntimeException() public enum class LayoutDirection { - Ltr, Rtl + LTR, RTL } diff --git a/library/resources/src/main/java/me/nasrabadiam/resources/LyricistCompose.kt b/library/resources/src/main/java/me/nasrabadiam/resources/LyricistCompose.kt index bd078d5..0b748fa 100644 --- a/library/resources/src/main/java/me/nasrabadiam/resources/LyricistCompose.kt +++ b/library/resources/src/main/java/me/nasrabadiam/resources/LyricistCompose.kt @@ -40,7 +40,7 @@ public fun ProvideStrings( private fun LayoutDirection.toComposeLayoutDirection(): ComposeLayoutDirection { return when (this) { - LayoutDirection.Ltr -> ComposeLayoutDirection.Ltr - LayoutDirection.Rtl -> ComposeLayoutDirection.Rtl + LayoutDirection.LTR -> ComposeLayoutDirection.Ltr + LayoutDirection.RTL -> ComposeLayoutDirection.Rtl } }