Skip to content

Commit 4d8165e

Browse files
authored
Fix: Some warnings and deprecations (#81)
1 parent 7fcc0b7 commit 4d8165e

File tree

4 files changed

+13
-18
lines changed

4 files changed

+13
-18
lines changed

composeApp/src/commonMain/kotlin/org/neotech/app/abysner/presentation/screens/AboutScreen.kt

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import androidx.compose.foundation.layout.fillMaxSize
3131
import androidx.compose.foundation.layout.fillMaxWidth
3232
import androidx.compose.foundation.layout.padding
3333
import androidx.compose.foundation.layout.size
34-
import androidx.compose.foundation.text.ClickableText
3534
import androidx.compose.material.icons.Icons
3635
import androidx.compose.material.icons.automirrored.outlined.ArrowBack
3736
import androidx.compose.material3.ExperimentalMaterial3Api
@@ -61,6 +60,7 @@ import androidx.compose.ui.graphics.drawscope.Fill
6160
import androidx.compose.ui.graphics.drawscope.translate
6261
import androidx.compose.ui.platform.LocalInspectionMode
6362
import androidx.compose.ui.platform.LocalUriHandler
63+
import androidx.compose.ui.text.LinkAnnotation
6464
import androidx.compose.ui.text.SpanStyle
6565
import androidx.compose.ui.text.buildAnnotatedString
6666
import androidx.compose.ui.text.font.FontWeight
@@ -281,43 +281,38 @@ fun AboutScreen(
281281

282282
val annotatedString = buildAnnotatedString {
283283

284-
pushStringAnnotation(tag = "url", annotation = "https://github.com/NeoTech-Software/Abysner")
284+
pushLink(LinkAnnotation.Url("https://github.com/NeoTech-Software/Abysner"))
285285
withStyle(style = SpanStyle(fontWeight = FontWeight.Bold, textDecoration = TextDecoration.Underline)) {
286286
append("Open-source")
287287
}
288288
pop()
289289

290290
append(" & licensed under ")
291291

292-
pushStringAnnotation(tag = "url", annotation = "https://www.gnu.org/licenses/agpl-3.0.txt")
292+
pushLink(LinkAnnotation.Url("https://www.gnu.org/licenses/agpl-3.0.txt"))
293293
withStyle(style = SpanStyle(fontWeight = FontWeight.Bold, textDecoration = TextDecoration.Underline)) {
294294
append("GNU AGPLv3")
295295
}
296296
pop()
297297

298298
appendLine()
299-
pushStringAnnotation(tag = "terms", annotation = "https://google.com/terms")
299+
pushLink(LinkAnnotation.Clickable(tag = "terms_and_conditions") { link ->
300+
navController.navigate(Destinations.TERMS_AND_CONDITIONS_VIEW.destinationName)
301+
})
300302
withStyle(style = SpanStyle(fontWeight = FontWeight.Bold, textDecoration = TextDecoration.Underline)) {
301303
append("Terms & Conditions")
302304
}
303305
pop()
304306
}
305307

306-
ClickableText(
308+
Text(
307309
modifier = Modifier.padding(insets.onlyBottom()).padding(bottom = 16.dp).align(Alignment.BottomCenter),
308310
style = MaterialTheme.typography.labelMedium.copy(
309311
textAlign = TextAlign.Center,
310312
color = MaterialTheme.colorScheme.onPrimary
311313
),
312-
text = annotatedString
313-
) { offset ->
314-
annotatedString.getStringAnnotations(tag = "url", start = offset, end = offset).firstOrNull()?.let {
315-
uriHandler.openUri(it.item)
316-
}
317-
annotatedString.getStringAnnotations(tag = "terms", start = offset, end = offset).firstOrNull()?.let {
318-
navController.navigate(Destinations.TERMS_AND_CONDITIONS_VIEW.destinationName)
319-
}
320-
}
314+
text = annotatedString,
315+
)
321316
}
322317
}
323318
}

composeApp/src/commonMain/kotlin/org/neotech/app/abysner/presentation/screens/planner/segments/SegmentPickerBottomSheet.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ fun SegmentPickerBottomSheet(
243243
Text("Cancel")
244244
}
245245
Button(
246-
enabled = isTimeValid.value && isDepthValid.value && cylinder != null,
246+
enabled = isTimeValid.value && isDepthValid.value,
247247
modifier = Modifier
248248
.weight(0.5f)
249249
.padding(top = 16.dp),
@@ -252,7 +252,7 @@ fun SegmentPickerBottomSheet(
252252
DiveProfileSection(
253253
duration = time,
254254
depth = depth,
255-
cylinder = cylinder!!
255+
cylinder = cylinder
256256
)
257257
)
258258
scope.launch {

data/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ kotlin {
6969
}
7070

7171
android {
72-
namespace = "nl.neotech.app.abysner"
72+
namespace = "nl.neotech.app.abysner.data"
7373
compileSdk = libs.versions.android.compileSdk.get().toInt()
7474

7575
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
agp = "8.11.1"
44
android-compileSdk = "36"
55
android-minSdk = "26"
6-
android-targetSdk = "35"
6+
android-targetSdk = "36"
77
uiTooling = "1.8.3"
88
startupRuntime = "1.2.0"
99
androidx-activityCompose = "1.10.1"

0 commit comments

Comments
 (0)