Skip to content

Commit 188fc4b

Browse files
committed
Fixed link styles
Signed-off-by: Arnau Mora <arnyminerz@proton.me>
1 parent d560338 commit 188fc4b

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

app/src/main/java/at/bitfire/icsdroid/ui/screen/InfoScreen.kt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import androidx.compose.material.icons.automirrored.filled.ArrowBack
1212
import androidx.compose.material3.ExperimentalMaterial3Api
1313
import androidx.compose.material3.Icon
1414
import androidx.compose.material3.IconButton
15+
import androidx.compose.material3.LocalTextStyle
1516
import androidx.compose.material3.MaterialTheme
1617
import androidx.compose.material3.OutlinedButton
1718
import androidx.compose.material3.Scaffold
@@ -30,9 +31,11 @@ import androidx.compose.ui.platform.LocalUriHandler
3031
import androidx.compose.ui.res.painterResource
3132
import androidx.compose.ui.res.stringResource
3233
import androidx.compose.ui.text.AnnotatedString
34+
import androidx.compose.ui.text.TextLinkStyles
3335
import androidx.compose.ui.text.font.FontWeight
3436
import androidx.compose.ui.text.fromHtml
3537
import androidx.compose.ui.text.style.TextAlign
38+
import androidx.compose.ui.text.style.TextDecoration
3639
import androidx.compose.ui.unit.dp
3740
import androidx.core.graphics.drawable.toBitmap
3841
import androidx.datastore.preferences.core.edit
@@ -210,7 +213,16 @@ private fun TextDialog(@StringRes text: Int, state: MutableState<Boolean>) {
210213
GenericAlertDialog(
211214
content = {
212215
val htmlString = stringResource(text).replace("\n", "<br/>")
213-
Text(AnnotatedString.fromHtml(htmlString))
216+
val linkStyle = LocalTextStyle.current.copy(
217+
color = MaterialTheme.colorScheme.primary,
218+
textDecoration = TextDecoration.Underline
219+
).toSpanStyle()
220+
Text(
221+
text = AnnotatedString.fromHtml(
222+
htmlString,
223+
linkStyles = TextLinkStyles(linkStyle)
224+
)
225+
)
214226
},
215227
confirmButton = stringResource(R.string.edit_calendar_dismiss) to {
216228
state.value = false

0 commit comments

Comments
 (0)