Skip to content

Commit

Permalink
Adjust switch color
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa authored and Pururun committed Nov 6, 2023
1 parent 3dccd38 commit abb2034
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ class VpnSettingsScreenTest {
// Arrange
composeTestRule.setContentWithTheme {
VpnSettingsScreen(
uiState = VpnSettingsUiState.createDefault(mtu = VALID_DUMMY_MTU_VALUE),
uiState =
VpnSettingsUiState.createDefault(
dialog = VpnSettingsDialog.Mtu(mtuEditValue = VALID_DUMMY_MTU_VALUE)
),
toastMessagesSharedFlow = MutableSharedFlow<String>().asSharedFlow()
)
}
Expand Down Expand Up @@ -262,9 +265,7 @@ class VpnSettingsScreenTest {
toastMessagesSharedFlow = MutableSharedFlow<String>().asSharedFlow()
)
}
// composeTestRule
// .onNodeWithTag(LAZY_LIST_TEST_TAG)
// .performScrollToNode(hasTestTag(LAZY_LIST_LAST_ITEM_TEST_TAG))

// Assert
composeTestRule.apply {
onNodeWithText(DUMMY_DNS_ADDRESS).assertExists()
Expand Down Expand Up @@ -388,9 +389,6 @@ class VpnSettingsScreenTest {
toastMessagesSharedFlow = MutableSharedFlow<String>().asSharedFlow()
)
}
// composeTestRule
// .onNodeWithTag(LAZY_LIST_TEST_TAG)
// .performScrollToNode(hasTestTag(LAZY_LIST_LAST_ITEM_TEST_TAG))

// Act
composeTestRule.onNodeWithText("Add a server").performClick()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.material3.SwitchDefaults
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.compositeOver
import androidx.compose.ui.tooling.preview.Preview
import net.mullvad.mullvadvpn.lib.theme.AppTheme
Expand Down Expand Up @@ -67,18 +68,18 @@ fun MullvadSwitch(
fun mullvadSwitchColors(): SwitchColors =
SwitchDefaults.colors(
checkedThumbColor = MaterialTheme.colorScheme.selected,
checkedTrackColor = MaterialTheme.colorScheme.primary,
checkedTrackColor = Color.Transparent,
checkedBorderColor = MaterialTheme.colorScheme.onPrimary,
// checkedIconColor= SwitchTokens.SelectedIconColor.toColor(),
uncheckedThumbColor = MaterialTheme.colorScheme.error,
uncheckedTrackColor = MaterialTheme.colorScheme.primary,
uncheckedTrackColor = Color.Transparent,
uncheckedBorderColor = MaterialTheme.colorScheme.onPrimary,
// uncheckedIconColor= SwitchTokens.UnselectedIconColor.toColor(),
disabledCheckedThumbColor =
MaterialTheme.colorScheme.selected
.copy(alpha = AlphaDisabled)
.compositeOver(MaterialTheme.colorScheme.primary),
disabledCheckedTrackColor = MaterialTheme.colorScheme.primary,
disabledCheckedTrackColor = Color.Transparent,
disabledCheckedBorderColor =
MaterialTheme.colorScheme.onPrimary
.copy(alpha = AlphaDisabled)
Expand All @@ -87,7 +88,7 @@ fun mullvadSwitchColors(): SwitchColors =
MaterialTheme.colorScheme.error
.copy(alpha = AlphaDisabled)
.compositeOver(MaterialTheme.colorScheme.primary),
disabledUncheckedTrackColor = MaterialTheme.colorScheme.primary,
disabledUncheckedTrackColor = Color.Transparent,
disabledUncheckedBorderColor =
MaterialTheme.colorScheme.onPrimary
.copy(alpha = AlphaDisabled)
Expand Down

0 comments on commit abb2034

Please sign in to comment.