diff options
Diffstat (limited to 'android')
5 files changed, 24 insertions, 69 deletions
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/ExpandableComposeCell.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/ExpandableComposeCell.kt index a1ca433322..a8adcb2b39 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/ExpandableComposeCell.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/ExpandableComposeCell.kt @@ -18,13 +18,9 @@ import androidx.compose.ui.focus.focusProperties import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview -import androidx.core.text.HtmlCompat import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.component.ExpandChevronIconButton -import net.mullvad.mullvadvpn.compose.component.textResource -import net.mullvad.mullvadvpn.compose.extensions.toAnnotatedString import net.mullvad.mullvadvpn.lib.theme.AppTheme import net.mullvad.mullvadvpn.lib.theme.Dimens import net.mullvad.mullvadvpn.lib.theme.color.AlphaInactive @@ -118,16 +114,12 @@ private fun ExpandableComposeCellBody( @Composable fun ContentBlockersDisableModeCellSubtitle(modifier: Modifier) { - val spanned = - HtmlCompat.fromHtml( - textResource( + Text( + text = + stringResource( id = R.string.dns_content_blockers_subtitle, stringResource(id = R.string.enable_custom_dns), ), - HtmlCompat.FROM_HTML_MODE_COMPACT, - ) - Text( - text = spanned.toAnnotatedString(boldFontWeight = FontWeight.ExtraBold), style = MaterialTheme.typography.labelMedium, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = modifier, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/SwitchComposeCell.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/SwitchComposeCell.kt index d935ca5950..ef62511061 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/SwitchComposeCell.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/SwitchComposeCell.kt @@ -19,16 +19,12 @@ import androidx.compose.ui.focus.focusProperties import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.AnnotatedString -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.Dp -import androidx.core.text.HtmlCompat -import androidx.core.text.HtmlCompat.FROM_HTML_MODE_COMPACT import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.component.MullvadSwitch import net.mullvad.mullvadvpn.compose.component.SpacedColumn import net.mullvad.mullvadvpn.compose.component.textResource -import net.mullvad.mullvadvpn.compose.extensions.toAnnotatedString import net.mullvad.mullvadvpn.lib.theme.AppTheme import net.mullvad.mullvadvpn.lib.theme.Dimens import net.mullvad.mullvadvpn.lib.theme.color.AlphaDisabled @@ -183,20 +179,17 @@ fun SwitchCellView( @Composable fun CustomDnsCellSubtitle(isCellClickable: Boolean, modifier: Modifier) { - val spanned = - HtmlCompat.fromHtml( - if (isCellClickable) { - textResource(id = R.string.custom_dns_footer) - } else { - textResource( - id = R.string.custom_dns_disable_mode_subtitle, - textResource(id = R.string.dns_content_blockers_title), - ) - }, - FROM_HTML_MODE_COMPACT, - ) + val text = + if (isCellClickable) { + textResource(id = R.string.custom_dns_footer) + } else { + textResource( + id = R.string.custom_dns_disable_mode_subtitle, + textResource(id = R.string.dns_content_blockers_title), + ) + } Text( - text = spanned.toAnnotatedString(boldFontWeight = FontWeight.ExtraBold), + text = text, style = MaterialTheme.typography.labelMedium, color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = modifier, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AutoConnectAndLockdownModeScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AutoConnectAndLockdownModeScreen.kt index 3d2949fc9c..39b9e174f2 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AutoConnectAndLockdownModeScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AutoConnectAndLockdownModeScreen.kt @@ -251,18 +251,7 @@ private fun ConstraintLayoutScope.PageIndicator( @Composable private fun buildTopText(@StringRes id: Int) = buildAnnotatedString { - withStyle(style = SpanStyle(color = MaterialTheme.colorScheme.onSurfaceVariant)) { - append( - HtmlCompat.fromHtml(stringResource(id = id), HtmlCompat.FROM_HTML_MODE_COMPACT) - .toAnnotatedString( - boldSpanStyle = - SpanStyle( - fontWeight = FontWeight.ExtraBold, - color = MaterialTheme.colorScheme.onSurface, - ) - ) - ) - } + append(stringResource(id = id)) } @Composable diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreen.kt index db8b3f94dd..d900f8e879 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreen.kt @@ -22,11 +22,9 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp -import androidx.core.text.HtmlCompat import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleEventObserver import androidx.lifecycle.compose.LocalLifecycleOwner @@ -76,7 +74,6 @@ import net.mullvad.mullvadvpn.compose.dialog.info.WireguardPortInfoDialogArgumen import net.mullvad.mullvadvpn.compose.extensions.dropUnlessResumed import net.mullvad.mullvadvpn.compose.extensions.itemWithDivider import net.mullvad.mullvadvpn.compose.extensions.itemsIndexedWithDivider -import net.mullvad.mullvadvpn.compose.extensions.toAnnotatedString import net.mullvad.mullvadvpn.compose.preview.VpnSettingsUiStatePreviewParameterProvider import net.mullvad.mullvadvpn.compose.state.VpnSettingsUiState import net.mullvad.mullvadvpn.compose.test.LAZY_LIST_LAST_ITEM_TEST_TAG @@ -339,14 +336,10 @@ fun VpnSettingsScreen( ) SwitchComposeSubtitleCell( text = - HtmlCompat.fromHtml( - textResource( - R.string.connect_on_start_footer, - textResource(R.string.auto_connect_and_lockdown_mode), - ), - HtmlCompat.FROM_HTML_MODE_COMPACT, - ) - .toAnnotatedString(boldFontWeight = FontWeight.ExtraBold) + textResource( + R.string.connect_on_start_footer, + textResource(R.string.auto_connect_and_lockdown_mode), + ) ) } } diff --git a/android/lib/resource/src/main/res/values/strings.xml b/android/lib/resource/src/main/res/values/strings.xml index 1352648630..4f6f2ca30c 100644 --- a/android/lib/resource/src/main/res/values/strings.xml +++ b/android/lib/resource/src/main/res/values/strings.xml @@ -68,16 +68,10 @@ <string name="auto_connect_and_lockdown_mode_footer">Makes sure the device is always on the VPN tunnel.</string> <string name="go_to_vpn_settings">Go to VPN settings</string> <string name="auto_connect_carousel_first_slide_top_text">The Auto-connect and Lockdown mode settings can be found in the Android system settings, follow this guide to enable one or both.</string> - <string name="auto_connect_carousel_first_slide_bottom_text"> - <![CDATA[1. After clicking on the \"Go to VPN settings\" button below, click on the cogwheel next to the \"Mullvad VPN\" name.]]> - </string> + <string name="auto_connect_carousel_first_slide_bottom_text">1. After clicking on the \"Go to VPN settings\" button below, click on the cogwheel next to the \"Mullvad VPN\" name.</string> <string name="auto_connect_carousel_second_slide_top_text">Auto-connect is called Always-on VPN in the Android system settings and it makes sure you are constantly connected to the VPN tunnel and auto connects after restart.</string> - <string name="auto_connect_carousel_second_slide_bottom_text"> - <![CDATA[2. To enable Auto-connect, click on the toggle next to \"Always-on VPN\".]]> - </string> - <string name="auto_connect_carousel_third_slide_top_text"> - <![CDATA[The Lockdown mode is called \"Block connections without VPN\" in the Android system settings. It helps minimize leaks, however it has some known limitations which you can read more about]]> - </string> + <string name="auto_connect_carousel_second_slide_bottom_text">2. To enable Auto-connect, click on the toggle next to \"Always-on VPN\".</string> + <string name="auto_connect_carousel_third_slide_top_text">The Lockdown mode is called \"Block connections without VPN\" in the Android system settings. It helps minimize leaks, however it has some known limitations which you can read more about</string> <string name="auto_connect_carousel_third_slide_top_text_website_link">here</string> <string name="auto_connect_carousel_third_slide_bottom_text"> <![CDATA[3. To enable Lockdown mode, click on the toggle next to \"Block connections without VPN\".<br /><br /><b>Warning: This setting blocks split apps and the Local Network Sharing feature.</b>]]> @@ -190,9 +184,7 @@ <string name="dns_content_blockers_title">DNS content blockers</string> <string name="dns_content_blockers_info">When this feature is enabled it stops the device from contacting certain domains or websites known for distributing ads, malware, trackers and more.</string> <string name="dns_content_blockers_warning">This might cause issues on certain websites, services, and apps.</string> - <string name="dns_content_blockers_custom_dns_warning"> - <![CDATA[Attention: this setting cannot be used in combination with \"Use custom DNS server\".]]> - </string> + <string name="dns_content_blockers_custom_dns_warning">Attention: this setting cannot be used in combination with \"Use custom DNS server\".</string> <string name="block_ads_title">Ads</string> <string name="block_trackers_title">Trackers</string> <string name="block_malware_title">Malware</string> @@ -200,12 +192,8 @@ <string name="block_gambling_title">Gambling</string> <string name="block_adult_content_title">Adult content</string> <string name="block_social_media_title">Social media</string> - <string name="dns_content_blockers_subtitle"> - <![CDATA[Disable \"%s\" below to activate these settings.]]> - </string> - <string name="custom_dns_disable_mode_subtitle"> - <![CDATA[Disable all \"%s\" above to activate this setting.]]> - </string> + <string name="dns_content_blockers_subtitle">Disable \"%s\" below to activate these settings.</string> + <string name="custom_dns_disable_mode_subtitle">Disable all \"%s\" above to activate this setting.</string> <string name="settings_changes_effect_warning_short">DNS settings might not go into effect immediately</string> <string name="settings_changes_effect_warning_content_blocker">Changes to DNS related settings might not go into effect immediately due to cached results.</string> <string name="manage_account">Manage account</string> |
