diff options
| author | David Göransson <david.goransson90@gmail.com> | 2023-10-25 15:19:40 +0200 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2023-11-06 12:37:36 +0100 |
| commit | 231d3869bbaa9fcdb1174141111152711b8618fb (patch) | |
| tree | a7a1393d33724d6a4a51409e772727670a7a9d14 /android/app/src | |
| parent | ae9967e2d78d08761269324aeb23d5c7bab98681 (diff) | |
| download | mullvadvpn-231d3869bbaa9fcdb1174141111152711b8618fb.tar.xz mullvadvpn-231d3869bbaa9fcdb1174141111152711b8618fb.zip | |
Re-order settings to be same as desktop
Diffstat (limited to 'android/app/src')
2 files changed, 54 insertions, 54 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 167aabd5ec..688c3c165b 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 @@ -370,9 +370,6 @@ class VpnSettingsScreenTest { toastMessagesSharedFlow = MutableSharedFlow<String>().asSharedFlow() ) } - composeTestRule - .onNodeWithTag(LAZY_LIST_TEST_TAG) - .performScrollToNode(hasTestTag(LAZY_LIST_LAST_ITEM_TEST_TAG)) // Assert composeTestRule.apply { 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 4178b66329..7290b9600f 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 @@ -440,6 +440,56 @@ fun VpnSettingsScreen( itemWithDivider { Spacer(modifier = Modifier.height(Dimens.cellLabelVerticalPadding)) InformationComposeCell( + title = stringResource(id = R.string.wireguard_port_title), + onInfoClicked = onWireguardPortInfoClicked + ) + } + + itemWithDivider { + SelectableCell( + title = stringResource(id = R.string.automatic), + isSelected = uiState.selectedWireguardPort is Constraint.Any, + onCellClicked = { onWireguardPortSelected(Constraint.Any()) } + ) + } + + WIREGUARD_PRESET_PORTS.forEach { port -> + itemWithDivider { + SelectableCell( + title = port.toString(), + testTag = String.format(LAZY_LIST_WIREGUARD_PORT_ITEM_X_TEST_TAG, port), + isSelected = uiState.selectedWireguardPort.hasValue(port), + onCellClicked = { onWireguardPortSelected(Constraint.Only(Port(port))) } + ) + } + } + + itemWithDivider { + CustomPortCell( + title = stringResource(id = R.string.wireguard_custon_port_title), + isSelected = uiState.selectedWireguardPort.isCustom(), + port = + if (uiState.selectedWireguardPort.isCustom()) { + uiState.selectedWireguardPort.toDisplayCustomPort() + } else { + savedCustomPort.value.toDisplayCustomPort() + }, + onMainCellClicked = { + if (savedCustomPort.value is Constraint.Only) { + onWireguardPortSelected(savedCustomPort.value) + } else { + onShowCustomPortDialog() + } + }, + onPortCellClicked = { onShowCustomPortDialog() }, + mainTestTag = LAZY_LIST_WIREGUARD_CUSTOM_PORT_TEXT_TEST_TAG, + numberTestTag = LAZY_LIST_WIREGUARD_CUSTOM_PORT_NUMBER_TEST_TAG + ) + } + + itemWithDivider { + Spacer(modifier = Modifier.height(Dimens.cellLabelVerticalPadding)) + InformationComposeCell( title = stringResource(R.string.obfuscation_title), onInfoClicked = { onObfuscationInfoClick() } ) @@ -488,68 +538,21 @@ fun VpnSettingsScreen( onCellClicked = { onSelectQuantumResistanceSetting(QuantumResistantState.On) } ) } - itemWithDivider { + item { SelectableCell( title = stringResource(id = R.string.off), testTag = LAZY_LIST_QUANTUM_ITEM_OFF_TEST_TAG, isSelected = uiState.quantumResistant == QuantumResistantState.Off, onCellClicked = { onSelectQuantumResistanceSetting(QuantumResistantState.Off) } ) - } - - itemWithDivider { Spacer(modifier = Modifier.height(Dimens.cellLabelVerticalPadding)) - InformationComposeCell( - title = stringResource(id = R.string.wireguard_port_title), - onInfoClicked = onWireguardPortInfoClicked - ) - } - - itemWithDivider { - SelectableCell( - title = stringResource(id = R.string.automatic), - isSelected = uiState.selectedWireguardPort is Constraint.Any, - onCellClicked = { onWireguardPortSelected(Constraint.Any()) } - ) - } - - WIREGUARD_PRESET_PORTS.forEach { port -> - itemWithDivider { - SelectableCell( - title = port.toString(), - testTag = String.format(LAZY_LIST_WIREGUARD_PORT_ITEM_X_TEST_TAG, port), - isSelected = uiState.selectedWireguardPort.hasValue(port), - onCellClicked = { onWireguardPortSelected(Constraint.Only(Port(port))) } - ) - } } - itemWithDivider { - CustomPortCell( - title = stringResource(id = R.string.wireguard_custon_port_title), - isSelected = uiState.selectedWireguardPort.isCustom(), - port = - if (uiState.selectedWireguardPort.isCustom()) { - uiState.selectedWireguardPort.toDisplayCustomPort() - } else { - savedCustomPort.value.toDisplayCustomPort() - }, - onMainCellClicked = { - if (savedCustomPort.value is Constraint.Only) { - onWireguardPortSelected(savedCustomPort.value) - } else { - onShowCustomPortDialog() - } - }, - onPortCellClicked = { onShowCustomPortDialog() }, - mainTestTag = LAZY_LIST_WIREGUARD_CUSTOM_PORT_TEXT_TEST_TAG, - numberTestTag = LAZY_LIST_WIREGUARD_CUSTOM_PORT_NUMBER_TEST_TAG - ) + item { MtuComposeCell(mtuValue = uiState.mtu, onEditMtu = { onMtuCellClick() }) } + item { + MtuSubtitle(modifier = Modifier.testTag(LAZY_LIST_LAST_ITEM_TEST_TAG)) Spacer(modifier = Modifier.height(Dimens.cellLabelVerticalPadding)) } - - item { MtuComposeCell(mtuValue = uiState.mtu, onEditMtu = { onMtuCellClick() }) } - item { MtuSubtitle(modifier = Modifier.testTag(LAZY_LIST_LAST_ITEM_TEST_TAG)) } } } } |
