summaryrefslogtreecommitdiffhomepage
path: root/android
diff options
context:
space:
mode:
authorJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-04-08 15:04:55 +0200
committerJonatan Rhodin <jonatan.rhodin@mullvad.net>2025-04-09 12:01:09 +0200
commit213df3c221081edea70abf411809f7022d7836e2 (patch)
treeee7bf3a7f74e09d02305b200d9d4bea356faec07 /android
parent75da013ccc20e5a612a87aa826c4e057da22567a (diff)
downloadmullvadvpn-213df3c221081edea70abf411809f7022d7836e2.tar.xz
mullvadvpn-213df3c221081edea70abf411809f7022d7836e2.zip
Replace subtext with info dialog for device ip version
Diffstat (limited to 'android')
-rw-r--r--android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreenTest.kt2
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/info/DeviceIpInfoDialog.kt25
-rw-r--r--android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreen.kt24
-rw-r--r--android/lib/resource/src/main/res/values/strings.xml3
4 files changed, 37 insertions, 17 deletions
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreenTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreenTest.kt
index b3f68cb0cf..963762c246 100644
--- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreenTest.kt
+++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/VpnSettingsScreenTest.kt
@@ -76,6 +76,7 @@ class VpnSettingsScreenTest {
onSelectDeviceIpVersion: (Constraint<IpVersion>) -> Unit = {},
onToggleIpv6: (Boolean) -> Unit = {},
navigateToIpv6Info: () -> Unit = {},
+ navigateToDeviceIpInfo: () -> Unit = {},
) {
setContentWithTheme {
VpnSettingsScreen(
@@ -110,6 +111,7 @@ class VpnSettingsScreenTest {
onSelectDeviceIpVersion = onSelectDeviceIpVersion,
onToggleIpv6 = onToggleIpv6,
navigateToIpv6Info = navigateToIpv6Info,
+ navigateToDeviceIpInfo = navigateToDeviceIpInfo,
)
}
}
diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/info/DeviceIpInfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/info/DeviceIpInfoDialog.kt
new file mode 100644
index 0000000000..196bdd922b
--- /dev/null
+++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/info/DeviceIpInfoDialog.kt
@@ -0,0 +1,25 @@
+package net.mullvad.mullvadvpn.compose.dialog.info
+
+import androidx.compose.runtime.Composable
+import androidx.compose.ui.res.stringResource
+import androidx.lifecycle.compose.dropUnlessResumed
+import com.ramcosta.composedestinations.annotation.Destination
+import com.ramcosta.composedestinations.annotation.RootGraph
+import com.ramcosta.composedestinations.navigation.DestinationsNavigator
+import com.ramcosta.composedestinations.spec.DestinationStyle
+import net.mullvad.mullvadvpn.R
+
+@Destination<RootGraph>(style = DestinationStyle.Dialog::class)
+@Composable
+fun DeviceIpInfo(navigator: DestinationsNavigator) {
+ InfoDialog(
+ message =
+ buildString {
+ append(stringResource(R.string.device_ip_info_first_paragraph))
+ appendLine()
+ appendLine()
+ append(stringResource(R.string.device_ip_info_second_paragraph))
+ },
+ onDismiss = dropUnlessResumed { navigator.navigateUp() },
+ )
+}
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 ea0e63fb32..bf7dd56274 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
@@ -35,6 +35,7 @@ import com.ramcosta.composedestinations.annotation.RootGraph
import com.ramcosta.composedestinations.generated.destinations.AutoConnectAndLockdownModeDestination
import com.ramcosta.composedestinations.generated.destinations.ContentBlockersInfoDestination
import com.ramcosta.composedestinations.generated.destinations.CustomDnsInfoDestination
+import com.ramcosta.composedestinations.generated.destinations.DeviceIpInfoDestination
import com.ramcosta.composedestinations.generated.destinations.DnsDestination
import com.ramcosta.composedestinations.generated.destinations.Ipv6InfoDestination
import com.ramcosta.composedestinations.generated.destinations.LocalNetworkSharingInfoDestination
@@ -145,6 +146,7 @@ private fun PreviewVpnSettings(
onSelectDeviceIpVersion = {},
onToggleIpv6 = {},
navigateToIpv6Info = {},
+ navigateToDeviceIpInfo = {},
)
}
}
@@ -276,6 +278,7 @@ fun VpnSettings(
onSelectDeviceIpVersion = vm::onDeviceIpVersionSelected,
onToggleIpv6 = vm::setIpv6Enabled,
navigateToIpv6Info = dropUnlessResumed { navigator.navigate(Ipv6InfoDestination) },
+ navigateToDeviceIpInfo = dropUnlessResumed { navigator.navigate(DeviceIpInfoDestination) },
)
}
@@ -315,6 +318,7 @@ fun VpnSettingsScreen(
onSelectDeviceIpVersion: (ipVersion: Constraint<IpVersion>) -> Unit,
onToggleIpv6: (Boolean) -> Unit,
navigateToIpv6Info: () -> Unit,
+ navigateToDeviceIpInfo: () -> Unit,
) {
var expandContentBlockersState by rememberSaveable { mutableStateOf(false) }
val topPadding = 6.dp
@@ -674,7 +678,10 @@ fun VpnSettingsScreen(
}
itemWithDivider {
- InformationComposeCell(title = stringResource(R.string.device_ip_version_title))
+ InformationComposeCell(
+ title = stringResource(R.string.device_ip_version_title),
+ onInfoClicked = navigateToDeviceIpInfo,
+ )
}
itemWithDivider {
SelectableCell(
@@ -698,21 +705,6 @@ fun VpnSettingsScreen(
)
}
item {
- Text(
- text = stringResource(R.string.device_ip_version_subtitle),
- style = MaterialTheme.typography.labelMedium,
- color = MaterialTheme.colorScheme.onSurfaceVariant,
- modifier =
- Modifier.padding(
- start = Dimens.cellStartPadding,
- top = topPadding,
- end = Dimens.cellEndPadding,
- ),
- )
- Spacer(modifier = Modifier.height(Dimens.cellVerticalSpacing))
- }
-
- item {
MtuComposeCell(mtuValue = state.mtu, onEditMtu = { navigateToMtuDialog(state.mtu) })
}
item { MtuSubtitle(modifier = Modifier.testTag(LAZY_LIST_LAST_ITEM_TEST_TAG)) }
diff --git a/android/lib/resource/src/main/res/values/strings.xml b/android/lib/resource/src/main/res/values/strings.xml
index 30bc03d3dc..84b58a76a3 100644
--- a/android/lib/resource/src/main/res/values/strings.xml
+++ b/android/lib/resource/src/main/res/values/strings.xml
@@ -405,8 +405,9 @@
<string name="enable_ipv6">In-tunnel IPv6</string>
<string name="uri_market_app_not_found">No Android app store installed, could not open link</string>
<string name="uri_browser_app_not_found">No browser app installed, could not open link</string>
- <string name="device_ip_version_subtitle">This allows access to WireGuard for devices that only support IPv6.</string>
<string name="ipv6_info">When this feature is enabled, IPv6 can be used alongside IPv4 in the VPN tunnel to communicate with internet services.</string>
<string name="ip_version_v4_unavailable">IPv4 is not available</string>
<string name="ip_version_v6_unavailable">IPv6 is not available</string>
+ <string name="device_ip_info_first_paragraph">This feature allows you to choose whether to use only IPv4, only IPv6, or allow the app to automatically decide the best option when connecting to a server.</string>
+ <string name="device_ip_info_second_paragraph">It can be useful when you are aware of problems caused by a certain IP version.</string>
</resources>