@@ -31,7 +31,6 @@ import androidx.compose.foundation.layout.fillMaxSize
3131import androidx.compose.foundation.layout.fillMaxWidth
3232import androidx.compose.foundation.layout.padding
3333import androidx.compose.foundation.layout.size
34- import androidx.compose.foundation.text.ClickableText
3534import androidx.compose.material.icons.Icons
3635import androidx.compose.material.icons.automirrored.outlined.ArrowBack
3736import androidx.compose.material3.ExperimentalMaterial3Api
@@ -61,6 +60,7 @@ import androidx.compose.ui.graphics.drawscope.Fill
6160import androidx.compose.ui.graphics.drawscope.translate
6261import androidx.compose.ui.platform.LocalInspectionMode
6362import androidx.compose.ui.platform.LocalUriHandler
63+ import androidx.compose.ui.text.LinkAnnotation
6464import androidx.compose.ui.text.SpanStyle
6565import androidx.compose.ui.text.buildAnnotatedString
6666import 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 }
0 commit comments