Skip to content

Commit 057a0c9

Browse files
committed
Update Libs
* Use new Compose Tooltips. * Update Gradle. * Update libs.
1 parent 7a46dc5 commit 057a0c9

File tree

5 files changed

+29
-18
lines changed

5 files changed

+29
-18
lines changed

app/build.gradle.kts

+10-10
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ android {
8484
dependencies {
8585

8686
implementation("androidx.core:core-ktx:1.12.0")
87-
implementation("androidx.activity:activity-compose:1.7.2")
88-
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
89-
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.6.2")
90-
implementation("androidx.compose.ui:ui:1.5.1")
91-
implementation("androidx.tv:tv-foundation:1.0.0-alpha09")
92-
implementation("androidx.compose.material3:material3:1.2.0-alpha05")
93-
implementation("androidx.work:work-runtime-ktx:2.8.1")
87+
implementation("androidx.activity:activity-compose:1.8.2")
88+
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
89+
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.7.0")
90+
implementation("androidx.compose.ui:ui:1.6.4")
91+
implementation("androidx.tv:tv-foundation:1.0.0-alpha10")
92+
implementation("androidx.compose.material3:material3:1.2.1")
93+
implementation("androidx.work:work-runtime-ktx:2.9.0")
9494
implementation("io.insert-koin:koin-android:3.4.2")
9595
implementation("io.insert-koin:koin-androidx-compose:3.4.2")
9696
implementation("com.squareup.retrofit2:retrofit:2.9.0")
@@ -108,9 +108,9 @@ dependencies {
108108

109109
androidTestImplementation("androidx.test.ext:junit:1.1.5")
110110
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
111-
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.5.1")
111+
androidTestImplementation("androidx.compose.ui:ui-test-junit4:1.6.4")
112112

113-
debugImplementation("androidx.compose.ui:ui-tooling:1.5.1")
114-
debugImplementation("androidx.compose.ui:ui-test-manifest:1.5.1")
113+
debugImplementation("androidx.compose.ui:ui-tooling:1.6.4")
114+
debugImplementation("androidx.compose.ui:ui-test-manifest:1.6.4")
115115

116116
}

app/src/main/kotlin/com/apkupdater/ui/component/Icons.kt

+16-5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ import androidx.compose.material3.CircularProgressIndicator
99
import androidx.compose.material3.ExperimentalMaterial3Api
1010
import androidx.compose.material3.Icon
1111
import androidx.compose.material3.MaterialTheme
12-
import androidx.compose.material3.PlainTooltipBox
12+
import androidx.compose.material3.PlainTooltip
1313
import androidx.compose.material3.Text
14+
import androidx.compose.material3.TooltipBox
15+
import androidx.compose.material3.TooltipDefaults
16+
import androidx.compose.material3.rememberTooltipState
1417
import androidx.compose.runtime.Composable
1518
import androidx.compose.ui.Alignment
1619
import androidx.compose.ui.Modifier
@@ -33,8 +36,12 @@ fun ExcludeIcon(
3336
@DrawableRes icon: Int = if (exclude) excludeIcon else includeIcon,
3437
@StringRes string: Int = if (exclude) includeString else excludeString,
3538
@StringRes contentDescription: Int = if (exclude) excludeString else includeString,
36-
) = PlainTooltipBox(tooltip = { Text(stringResource(string)) }) {
37-
Icon(painterResource(icon), stringResource(contentDescription), Modifier.tooltipTrigger())
39+
) = TooltipBox(
40+
positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(),
41+
state = rememberTooltipState(),
42+
tooltip = { PlainTooltip { Text(stringResource(string)) } }
43+
) {
44+
Icon(painterResource(icon), stringResource(contentDescription))
3845
}
3946

4047
@Composable
@@ -111,10 +118,14 @@ fun BoxScope.InstallProgressIcon(
111118
fun RefreshIcon(
112119
text: String,
113120
modifier: Modifier = Modifier
114-
) = PlainTooltipBox(tooltip = { Text(text) }) {
121+
) = TooltipBox(
122+
positionProvider = TooltipDefaults.rememberPlainTooltipPositionProvider(),
123+
state = rememberTooltipState(),
124+
tooltip = { PlainTooltip { Text(text) } }
125+
) {
115126
Icon(
116127
painter = painterResource(id = R.drawable.ic_refresh),
117128
contentDescription = text,
118-
modifier = Modifier.tooltipTrigger().then(modifier)
129+
modifier = modifier
119130
)
120131
}

app/src/main/kotlin/com/apkupdater/ui/component/Settings.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fun SegmentedButtonSetting(
100100
SingleChoiceSegmentedButtonRow(Modifier.padding(8.dp).fillMaxWidth()) {
101101
options.forEachIndexed { index, label ->
102102
SegmentedButton(
103-
shape = SegmentedButtonDefaults.shape(position = index, count = options.size),
103+
shape = SegmentedButtonDefaults.itemShape(index = index, count = options.size),
104104
onClick = {
105105
position = index
106106
setValue(position)

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
plugins {
2-
id("com.android.application") version "8.1.1" apply false
2+
id("com.android.application") version "8.3.1" apply false
33
id("org.jetbrains.kotlin.android") version "1.9.0" apply false
44
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
2-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
33
distributionPath=wrapper/dists
44
zipStorePath=wrapper/dists
55
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)