diff --git a/data/market-remote/build.gradle.kts b/data/market-remote/build.gradle.kts index 36e09f83..301c5cce 100644 --- a/data/market-remote/build.gradle.kts +++ b/data/market-remote/build.gradle.kts @@ -19,6 +19,7 @@ dependencies { implementation(kotlinx.serialization.json) implementation(kotlinx.serialization.converter) implementation(logging.interceptor) + implementation(lifecycle.viewmodel.ktx) debugImplementation(chucker) releaseImplementation(chucker.no.op) androidTestImplementation(runner) diff --git a/feature/marketdetail/src/main/java/ir/composenews/marketdetail/MarketDetailLoadingView.kt b/feature/marketdetail/src/main/java/ir/composenews/marketdetail/MarketDetailLoadingView.kt index 180ac71f..96704ef8 100644 --- a/feature/marketdetail/src/main/java/ir/composenews/marketdetail/MarketDetailLoadingView.kt +++ b/feature/marketdetail/src/main/java/ir/composenews/marketdetail/MarketDetailLoadingView.kt @@ -12,7 +12,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.Divider +import androidx.compose.material3.HorizontalDivider import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -81,7 +81,7 @@ fun MarketDetailLoadingView() { .shimmerEffect(), ) } - Divider(color = Color.Gray) + HorizontalDivider(color = Color.Gray) Row( modifier = Modifier .padding(16.dp) diff --git a/feature/marketdetail/src/main/java/ir/composenews/marketdetail/MarketDetailScreen.kt b/feature/marketdetail/src/main/java/ir/composenews/marketdetail/MarketDetailScreen.kt index bcec6872..aa874921 100644 --- a/feature/marketdetail/src/main/java/ir/composenews/marketdetail/MarketDetailScreen.kt +++ b/feature/marketdetail/src/main/java/ir/composenews/marketdetail/MarketDetailScreen.kt @@ -14,8 +14,8 @@ import androidx.compose.foundation.layout.size import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.verticalScroll -import androidx.compose.material3.Divider import androidx.compose.material3.FloatingActionButton +import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.Text @@ -233,7 +233,7 @@ private fun MarketData() { style = MaterialTheme.typography.titleLarge, ) } - Divider(color = Color.Gray) + HorizontalDivider(color = Color.Gray) } fun formatNumber(number: Long?): String { diff --git a/gradle.properties b/gradle.properties index a5943047..ab7a7f1b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8 # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5b33451d..981f5d2c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,35 +6,35 @@ projectTargetSdkVersion = "34" projectCompileSdkVersion = "34" projectVersionCode = "1" -kotlin = "1.9.10" +kotlin = "1.9.23" kotlinter = "3.16.0" ksp = "1.9.10-1.0.13" kotlinxImmutableCollection = "0.3.5" -androidGradlePlugin = "8.1.3" +androidGradlePlugin = "8.1.4" ktx = "1.12.0" -composeBOM = "2023.10.01" -composeActivity = "1.8.0" +composeBOM = "2024.03.00" +composeActivity = "1.8.2" composeCoil = "2.2.2" -composeCompiler = "1.5.3" -composeMaterial3 = "1.1.2" +composeCompiler = "1.5.11" +composeMaterial3 = "1.2.1" detekt = "1.23.1" -hilt = "2.48" -androidHiltCompiler = "1.1.0" -hiltNavigationCompose = "1.1.0" -hiltWork = "1.1.0" +hilt = "2.50" +androidHiltCompiler = "1.2.0" +hiltNavigationCompose = "1.2.0" +hiltWork = "1.2.0" javaxInject = "1" lottieAnimation = "6.1.0" coroutinesCore = "1.7.3" -lifeCycle = "2.6.2" -lifeCycleViewModelKtx = "2.6.2" -lifeCycleRuntimeCompose = "2.6.2" +lifeCycle = "2.7.0" +lifeCycleViewModelKtx = "2.7.0" +lifeCycleRuntimeCompose = "2.7.0" -navigationCompose = "2.7.5" +navigationCompose = "2.7.7" retrofit = "2.9.0" loggingInterceptor = "4.11.0" @@ -42,7 +42,7 @@ chucker = "3.5.2" kotlinx-serialization = "1.6.0" kotlinx-serialization-converter = "1.0.0" -sqldelight = "2.0.0" +sqldelight = "2.0.1" junit = "4.13.2" junitExt = "1.1.5" @@ -53,13 +53,13 @@ runner = "1.5.2" startupRuntime = "1.1.1" -workRuntimeKtx = "2.8.1" +workRuntimeKtx = "2.9.0" -windowsSizeClass = "1.1.2" +windowsSizeClass = "1.2.1" adaptive = "0.26.2-beta" kotest = "5.7.2" -espressoCore = "3.4.0" +espressoCore = "3.5.1" [libraries] androidx-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "ktx" } diff --git a/library/designsystem/src/main/java/ir/composenews/designsystem/component/DismissBackgroundSwipe.kt b/library/designsystem/src/main/java/ir/composenews/designsystem/component/DismissBackgroundSwipe.kt index a46b4888..02077623 100644 --- a/library/designsystem/src/main/java/ir/composenews/designsystem/component/DismissBackgroundSwipe.kt +++ b/library/designsystem/src/main/java/ir/composenews/designsystem/component/DismissBackgroundSwipe.kt @@ -11,11 +11,11 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Delete -import androidx.compose.material3.DismissState -import androidx.compose.material3.DismissValue import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.SwipeToDismissBoxState +import androidx.compose.material3.SwipeToDismissBoxValue import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment @@ -27,10 +27,10 @@ import androidx.compose.ui.unit.dp @OptIn(ExperimentalMaterial3Api::class) @Composable -fun DismissBackgroundSwipe(modifier: Modifier, dismissState: DismissState) { +fun DismissBackgroundSwipe(modifier: Modifier, dismissState: SwipeToDismissBoxState) { val color by animateColorAsState( targetValue = when (dismissState.targetValue) { - DismissValue.DismissedToStart -> if (isSystemInDarkTheme()) { + SwipeToDismissBoxValue.EndToStart -> if (isSystemInDarkTheme()) { MaterialTheme.colorScheme.errorContainer } else { Color.Red @@ -42,7 +42,7 @@ fun DismissBackgroundSwipe(modifier: Modifier, dismissState: DismissState) { ) val iconScale by animateFloatAsState( - targetValue = if (dismissState.targetValue == DismissValue.Default) 0.8f else 1.1f, + targetValue = if (dismissState.targetValue == SwipeToDismissBoxValue.StartToEnd) 0.8f else 1.1f, label = "", ) diff --git a/library/designsystem/src/main/java/ir/composenews/designsystem/component/FavoriteIcon.kt b/library/designsystem/src/main/java/ir/composenews/designsystem/component/FavoriteIcon.kt index 22601261..3fc0fac7 100644 --- a/library/designsystem/src/main/java/ir/composenews/designsystem/component/FavoriteIcon.kt +++ b/library/designsystem/src/main/java/ir/composenews/designsystem/component/FavoriteIcon.kt @@ -49,7 +49,7 @@ fun FavoriteIcon( keyframes { durationMillis = 300 1f at 0 - 1.3f at 150 with FastOutSlowInEasing + 1.3f at 150 using FastOutSlowInEasing 1f at 300 } } else { diff --git a/library/designsystem/src/main/java/ir/composenews/designsystem/component/MarketItem.kt b/library/designsystem/src/main/java/ir/composenews/designsystem/component/MarketItem.kt index 358d09b5..92777a74 100644 --- a/library/designsystem/src/main/java/ir/composenews/designsystem/component/MarketItem.kt +++ b/library/designsystem/src/main/java/ir/composenews/designsystem/component/MarketItem.kt @@ -24,15 +24,14 @@ import androidx.compose.foundation.shape.CircleShape import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.Card import androidx.compose.material3.CardDefaults -import androidx.compose.material3.DismissDirection -import androidx.compose.material3.DismissValue import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Surface import androidx.compose.material3.SwipeToDismiss +import androidx.compose.material3.SwipeToDismissBoxValue import androidx.compose.material3.Text -import androidx.compose.material3.rememberDismissState +import androidx.compose.material3.rememberSwipeToDismissBoxState import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -74,9 +73,9 @@ fun MarketItem( var show by remember { mutableStateOf(true) } - val dismissState = rememberDismissState( + val dismissState = rememberSwipeToDismissBoxState( confirmValueChange = { - if (it == DismissValue.DismissedToStart) { + if (it == SwipeToDismissBoxValue.EndToStart) { show = false true } else { @@ -90,7 +89,7 @@ fun MarketItem( AnimatedVisibility(visible = show, exit = fadeOut(spring())) { SwipeToDismiss( state = dismissState, - directions = setOf(DismissDirection.EndToStart), + directions = setOf(SwipeToDismissBoxValue.EndToStart), background = { DismissBackgroundSwipe( modifier = Modifier,