Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enable/disable button to Split Tunnelling #5641

Merged
merged 4 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Line wrap the file at 100 chars. Th

#### Android
- Add support for all screen orientations.
- Add toggle for enabling or disabling split tunneling.

### Fixed
- Fix connectivity issues that would occur when using quantum-resistant tunnels with an incorrectly
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ class SplitTunnelingScreenTest {
fun testLoadingState() =
composeExtension.use {
// Arrange
setContentWithTheme { SplitTunnelingScreen(uiState = SplitTunnelingUiState.Loading) }
setContentWithTheme {
SplitTunnelingScreen(uiState = SplitTunnelingUiState.Loading(enabled = true))
}

// Assert
onNodeWithText(TITLE).assertExists()
Expand Down Expand Up @@ -64,6 +66,7 @@ class SplitTunnelingScreenTest {
SplitTunnelingScreen(
uiState =
SplitTunnelingUiState.ShowAppList(
enabled = true,
excludedApps = listOf(excludedApp),
includedApps = listOf(includedApp),
showSystemApps = false
Expand Down Expand Up @@ -95,6 +98,7 @@ class SplitTunnelingScreenTest {
SplitTunnelingScreen(
uiState =
SplitTunnelingUiState.ShowAppList(
enabled = true,
excludedApps = emptyList(),
includedApps = listOf(includedApp),
showSystemApps = false
Expand Down Expand Up @@ -133,6 +137,7 @@ class SplitTunnelingScreenTest {
SplitTunnelingScreen(
uiState =
SplitTunnelingUiState.ShowAppList(
enabled = true,
excludedApps = listOf(excludedApp),
includedApps = listOf(includedApp),
showSystemApps = false
Expand Down Expand Up @@ -169,6 +174,7 @@ class SplitTunnelingScreenTest {
SplitTunnelingScreen(
uiState =
SplitTunnelingUiState.ShowAppList(
enabled = true,
excludedApps = listOf(excludedApp),
includedApps = listOf(includedApp),
showSystemApps = false
Expand Down Expand Up @@ -205,6 +211,7 @@ class SplitTunnelingScreenTest {
SplitTunnelingScreen(
uiState =
SplitTunnelingUiState.ShowAppList(
enabled = true,
excludedApps = listOf(excludedApp),
includedApps = listOf(includedApp),
showSystemApps = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,18 @@ private fun PreviewTunnelingCell() {
modifier =
Modifier.background(color = MaterialTheme.colorScheme.background).padding(20.dp)
) {
SplitTunnelingCell(title = "Mullvad VPN", packageName = "", isSelected = false)
SplitTunnelingCell(title = "Mullvad VPN", packageName = "", isSelected = true)
SplitTunnelingCell(
title = "Mullvad VPN",
packageName = "",
isSelected = false,
enabled = true
)
SplitTunnelingCell(
title = "Mullvad VPN",
packageName = "",
isSelected = true,
enabled = true
)
}
}
}
Expand All @@ -52,6 +62,7 @@ fun SplitTunnelingCell(
title: String,
packageName: String?,
isSelected: Boolean,
enabled: Boolean,
modifier: Modifier = Modifier,
backgroundColor: Color =
MaterialTheme.colorScheme.primary
Expand Down Expand Up @@ -110,6 +121,7 @@ fun SplitTunnelingCell(
},
onCellClicked = onCellClicked,
background = backgroundColor,
modifier = modifier
modifier = modifier,
isRowEnabled = enabled
)
}
Loading
Loading