Skip to content

Commit

Permalink
Update Libs
Browse files Browse the repository at this point in the history
* Use new Compose Tooltips.
* Update Gradle.
* Update libs.
  • Loading branch information
rumboalla committed Mar 23, 2024
1 parent 7a46dc5 commit 057a0c9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 18 deletions.
20 changes: 10 additions & 10 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")

}
21 changes: 16 additions & 5 deletions app/src/main/kotlin/com/apkupdater/ui/component/Icons.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 057a0c9

Please sign in to comment.