Skip to content

Commit 5c993e2

Browse files
committed
Merge branch 'implement-split-tunneling-toggle-button-droid-458'
2 parents bf4fc6d + 4a9f3b1 commit 5c993e2

File tree

12 files changed

+323
-134
lines changed

12 files changed

+323
-134
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Line wrap the file at 100 chars. Th
3636

3737
#### Android
3838
- Add support for all screen orientations.
39+
- Add toggle for enabling or disabling split tunneling.
3940

4041
### Fixed
4142
- Fix connectivity issues that would occur when using quantum-resistant tunnels with an incorrectly

android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/screen/SplitTunnelingScreenTest.kt

+8-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class SplitTunnelingScreenTest {
3434
fun testLoadingState() =
3535
composeExtension.use {
3636
// Arrange
37-
setContentWithTheme { SplitTunnelingScreen(uiState = SplitTunnelingUiState.Loading) }
37+
setContentWithTheme {
38+
SplitTunnelingScreen(uiState = SplitTunnelingUiState.Loading(enabled = true))
39+
}
3840

3941
// Assert
4042
onNodeWithText(TITLE).assertExists()
@@ -64,6 +66,7 @@ class SplitTunnelingScreenTest {
6466
SplitTunnelingScreen(
6567
uiState =
6668
SplitTunnelingUiState.ShowAppList(
69+
enabled = true,
6770
excludedApps = listOf(excludedApp),
6871
includedApps = listOf(includedApp),
6972
showSystemApps = false
@@ -95,6 +98,7 @@ class SplitTunnelingScreenTest {
9598
SplitTunnelingScreen(
9699
uiState =
97100
SplitTunnelingUiState.ShowAppList(
101+
enabled = true,
98102
excludedApps = emptyList(),
99103
includedApps = listOf(includedApp),
100104
showSystemApps = false
@@ -133,6 +137,7 @@ class SplitTunnelingScreenTest {
133137
SplitTunnelingScreen(
134138
uiState =
135139
SplitTunnelingUiState.ShowAppList(
140+
enabled = true,
136141
excludedApps = listOf(excludedApp),
137142
includedApps = listOf(includedApp),
138143
showSystemApps = false
@@ -169,6 +174,7 @@ class SplitTunnelingScreenTest {
169174
SplitTunnelingScreen(
170175
uiState =
171176
SplitTunnelingUiState.ShowAppList(
177+
enabled = true,
172178
excludedApps = listOf(excludedApp),
173179
includedApps = listOf(includedApp),
174180
showSystemApps = false
@@ -205,6 +211,7 @@ class SplitTunnelingScreenTest {
205211
SplitTunnelingScreen(
206212
uiState =
207213
SplitTunnelingUiState.ShowAppList(
214+
enabled = true,
208215
excludedApps = listOf(excludedApp),
209216
includedApps = listOf(includedApp),
210217
showSystemApps = false

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/cell/SplitTunnelingCell.kt

+15-3
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,18 @@ private fun PreviewTunnelingCell() {
4141
modifier =
4242
Modifier.background(color = MaterialTheme.colorScheme.background).padding(20.dp)
4343
) {
44-
SplitTunnelingCell(title = "Mullvad VPN", packageName = "", isSelected = false)
45-
SplitTunnelingCell(title = "Mullvad VPN", packageName = "", isSelected = true)
44+
SplitTunnelingCell(
45+
title = "Mullvad VPN",
46+
packageName = "",
47+
isSelected = false,
48+
enabled = true
49+
)
50+
SplitTunnelingCell(
51+
title = "Mullvad VPN",
52+
packageName = "",
53+
isSelected = true,
54+
enabled = true
55+
)
4656
}
4757
}
4858
}
@@ -52,6 +62,7 @@ fun SplitTunnelingCell(
5262
title: String,
5363
packageName: String?,
5464
isSelected: Boolean,
65+
enabled: Boolean,
5566
modifier: Modifier = Modifier,
5667
backgroundColor: Color =
5768
MaterialTheme.colorScheme.primary
@@ -110,6 +121,7 @@ fun SplitTunnelingCell(
110121
},
111122
onCellClicked = onCellClicked,
112123
background = backgroundColor,
113-
modifier = modifier
124+
modifier = modifier,
125+
isRowEnabled = enabled
114126
)
115127
}

0 commit comments

Comments
 (0)