From 057a0c9e6bd8599f96813584351e04f04c2592e0 Mon Sep 17 00:00:00 2001 From: rumboalla Date: Sat, 23 Mar 2024 15:42:50 +0100 Subject: [PATCH] Update Libs * Use new Compose Tooltips. * Update Gradle. * Update libs. --- app/build.gradle.kts | 20 +++++++++--------- .../com/apkupdater/ui/component/Icons.kt | 21 ++++++++++++++----- .../com/apkupdater/ui/component/Settings.kt | 2 +- build.gradle.kts | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 29 insertions(+), 18 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index e80a71f9..f740d58e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -84,13 +84,13 @@ android { dependencies { implementation("androidx.core:core-ktx:1.12.0") - implementation("androidx.activity:activity-compose:1.7.2") - implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2") - implementation("androidx.lifecycle:lifecycle-runtime-compose:2.6.2") - implementation("androidx.compose.ui:ui:1.5.1") - implementation("androidx.tv:tv-foundation:1.0.0-alpha09") - implementation("androidx.compose.material3:material3:1.2.0-alpha05") - implementation("androidx.work:work-runtime-ktx:2.8.1") + implementation("androidx.activity:activity-compose:1.8.2") + implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0") + implementation("androidx.lifecycle:lifecycle-runtime-compose:2.7.0") + implementation("androidx.compose.ui:ui:1.6.4") + implementation("androidx.tv:tv-foundation:1.0.0-alpha10") + implementation("androidx.compose.material3:material3:1.2.1") + implementation("androidx.work:work-runtime-ktx:2.9.0") implementation("io.insert-koin:koin-android:3.4.2") implementation("io.insert-koin:koin-androidx-compose:3.4.2") implementation("com.squareup.retrofit2:retrofit:2.9.0") @@ -108,9 +108,9 @@ dependencies { androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") - androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.5.1") + androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.6.4") - debugImplementation("androidx.compose.ui:ui-tooling:1.5.1") - debugImplementation("androidx.compose.ui:ui-test-manifest:1.5.1") + debugImplementation("androidx.compose.ui:ui-tooling:1.6.4") + debugImplementation("androidx.compose.ui:ui-test-manifest:1.6.4") } diff --git a/app/src/main/kotlin/com/apkupdater/ui/component/Icons.kt b/app/src/main/kotlin/com/apkupdater/ui/component/Icons.kt index 061b67ae..2e8bbcac 100644 --- a/app/src/main/kotlin/com/apkupdater/ui/component/Icons.kt +++ b/app/src/main/kotlin/com/apkupdater/ui/component/Icons.kt @@ -9,8 +9,11 @@ import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.PlainTooltipBox +import androidx.compose.material3.PlainTooltip import androidx.compose.material3.Text +import androidx.compose.material3.TooltipBox +import androidx.compose.material3.TooltipDefaults +import androidx.compose.material3.rememberTooltipState import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -33,8 +36,12 @@ fun ExcludeIcon( @DrawableRes icon: Int = if (exclude) excludeIcon else includeIcon, @StringRes string: Int = if (exclude) includeString else excludeString, @StringRes contentDescription: Int = if (exclude) excludeString else includeString, -) = PlainTooltipBox(tooltip = { Text(stringResource(string)) }) { - Icon(painterResource(icon), stringResource(contentDescription), Modifier.tooltipTrigger()) +) = TooltipBox( + positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(), + state = rememberTooltipState(), + tooltip = { PlainTooltip { Text(stringResource(string)) } } +) { + Icon(painterResource(icon), stringResource(contentDescription)) } @Composable @@ -111,10 +118,14 @@ fun BoxScope.InstallProgressIcon( fun RefreshIcon( text: String, modifier: Modifier = Modifier -) = PlainTooltipBox(tooltip = { Text(text) }) { +) = TooltipBox( + positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(), + state = rememberTooltipState(), + tooltip = { PlainTooltip { Text(text) } } +) { Icon( painter = painterResource(id = R.drawable.ic_refresh), contentDescription = text, - modifier = Modifier.tooltipTrigger().then(modifier) + modifier = modifier ) } diff --git a/app/src/main/kotlin/com/apkupdater/ui/component/Settings.kt b/app/src/main/kotlin/com/apkupdater/ui/component/Settings.kt index 8136ff58..45f8e171 100644 --- a/app/src/main/kotlin/com/apkupdater/ui/component/Settings.kt +++ b/app/src/main/kotlin/com/apkupdater/ui/component/Settings.kt @@ -100,7 +100,7 @@ fun SegmentedButtonSetting( SingleChoiceSegmentedButtonRow(Modifier.padding(8.dp).fillMaxWidth()) { options.forEachIndexed { index, label -> SegmentedButton( - shape = SegmentedButtonDefaults.shape(position = index, count = options.size), + shape = SegmentedButtonDefaults.itemShape(index = index, count = options.size), onClick = { position = index setValue(position) diff --git a/build.gradle.kts b/build.gradle.kts index 435b80a7..8416cbe5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,4 @@ plugins { - id("com.android.application") version "8.1.1" apply false + id("com.android.application") version "8.3.1" apply false id("org.jetbrains.kotlin.android") version "1.9.0" apply false } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bdac3005..0148d9b6 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME