Skip to content

Commit 1c78ee9

Browse files
committed
More adjustments
1 parent 636796b commit 1c78ee9

File tree

5 files changed

+20
-30
lines changed

5 files changed

+20
-30
lines changed

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/button/SwitchLocationButton.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ fun SwitchLocationButton(
3434
onClick = onClick,
3535
colors =
3636
ButtonDefaults.buttonColors(
37-
containerColor = MaterialTheme.colorScheme.onSurface.copy(alpha = Alpha20),
38-
contentColor = MaterialTheme.colorScheme.onSurface
37+
containerColor = MaterialTheme.colorScheme.primaryContainer,
38+
contentColor = MaterialTheme.colorScheme.onPrimaryContainer
3939
),
4040
modifier = modifier,
4141
text = text,

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

+7-6
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import net.mullvad.mullvadvpn.lib.theme.AppTheme
3131
import net.mullvad.mullvadvpn.lib.theme.Dimens
3232
import net.mullvad.mullvadvpn.lib.theme.color.AlphaInvisible
3333
import net.mullvad.mullvadvpn.lib.theme.color.AlphaVisible
34+
import net.mullvad.mullvadvpn.lib.theme.color.onSelected
3435
import net.mullvad.mullvadvpn.lib.theme.color.selected
3536

3637
@Preview
@@ -70,7 +71,7 @@ fun CustomPortCell(
7071
if (isSelected) {
7172
MaterialTheme.colorScheme.selected
7273
} else {
73-
MaterialTheme.colorScheme.primaryContainer
74+
MaterialTheme.colorScheme.surfaceContainerLow
7475
}
7576
)
7677
.padding(start = Dimens.cellStartPadding)
@@ -79,7 +80,7 @@ fun CustomPortCell(
7980
Icon(
8081
painter = painterResource(id = R.drawable.icon_tick),
8182
contentDescription = null,
82-
tint = MaterialTheme.colorScheme.onSecondary,
83+
tint = MaterialTheme.colorScheme.onSelected,
8384
modifier =
8485
Modifier.padding(end = Dimens.selectableCellTextMargin)
8586
.alpha(if (isSelected) AlphaVisible else AlphaInvisible)
@@ -89,9 +90,9 @@ fun CustomPortCell(
8990
style = MaterialTheme.typography.labelLarge,
9091
textAlign = TextAlign.Start,
9192
textColor = if (isSelected) {
92-
MaterialTheme.colorScheme.onSecondary
93+
MaterialTheme.colorScheme.onSelected
9394
} else {
94-
MaterialTheme.colorScheme.onPrimaryContainer
95+
MaterialTheme.colorScheme.onSurface
9596
}
9697
)
9798
}
@@ -102,12 +103,12 @@ fun CustomPortCell(
102103
.height(Dimens.cellHeight)
103104
.wrapContentWidth()
104105
.defaultMinSize(minWidth = Dimens.customPortBoxMinWidth)
105-
.background(MaterialTheme.colorScheme.primary)
106+
.background(MaterialTheme.colorScheme.surfaceContainerHighest)
106107
.testTag(numberTestTag)
107108
) {
108109
Text(
109110
text = port?.value?.toString() ?: stringResource(id = R.string.port),
110-
color = MaterialTheme.colorScheme.onPrimary,
111+
color = MaterialTheme.colorScheme.onSurface,
111112
modifier = Modifier.align(Alignment.Center)
112113
)
113114
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ fun SelectableCell(
5656
titleStyle: TextStyle = MaterialTheme.typography.labelLarge,
5757
startPadding: Dp = Dimens.cellStartPadding,
5858
selectedColor: Color = MaterialTheme.colorScheme.selected,
59-
backgroundColor: Color = MaterialTheme.colorScheme.primaryContainer,
59+
backgroundColor: Color = MaterialTheme.colorScheme.surfaceContainerLow,
6060
onSelectedColor: Color = MaterialTheme.colorScheme.onSelected,
61-
onBackgroundColor: Color = MaterialTheme.colorScheme.onPrimaryContainer,
61+
onBackgroundColor: Color = MaterialTheme.colorScheme.onSurface,
6262
onCellClicked: () -> Unit = {},
6363
testTag: String = ""
6464
) {

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/Switch.kt

+6-17
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import androidx.compose.runtime.Composable
1515
import androidx.compose.runtime.remember
1616
import androidx.compose.ui.Modifier
1717
import androidx.compose.ui.graphics.Color
18-
import androidx.compose.ui.graphics.compositeOver
1918
import androidx.compose.ui.tooling.preview.Preview
2019
import net.mullvad.mullvadvpn.lib.theme.AppTheme
2120
import net.mullvad.mullvadvpn.lib.theme.Dimens
@@ -69,28 +68,18 @@ fun mullvadSwitchColors(): SwitchColors =
6968
SwitchDefaults.colors(
7069
checkedThumbColor = MaterialTheme.colorScheme.selected,
7170
checkedTrackColor = Color.Transparent,
72-
checkedBorderColor = MaterialTheme.colorScheme.onPrimary,
71+
checkedBorderColor = MaterialTheme.colorScheme.onSurface,
7372
// checkedIconColor= SwitchTokens.SelectedIconColor.toColor(),
7473
uncheckedThumbColor = MaterialTheme.colorScheme.error,
7574
uncheckedTrackColor = Color.Transparent,
76-
uncheckedBorderColor = MaterialTheme.colorScheme.onPrimary,
75+
uncheckedBorderColor = MaterialTheme.colorScheme.onSurface,
7776
// uncheckedIconColor= SwitchTokens.UnselectedIconColor.toColor(),
78-
disabledCheckedThumbColor =
79-
MaterialTheme.colorScheme.selected
80-
.copy(alpha = AlphaDisabled)
81-
.compositeOver(MaterialTheme.colorScheme.primary),
77+
disabledCheckedThumbColor = MaterialTheme.colorScheme.selected.copy(alpha = AlphaDisabled),
8278
disabledCheckedTrackColor = Color.Transparent,
8379
disabledCheckedBorderColor =
84-
MaterialTheme.colorScheme.onPrimary
85-
.copy(alpha = AlphaDisabled)
86-
.compositeOver(MaterialTheme.colorScheme.primary),
87-
disabledUncheckedThumbColor =
88-
MaterialTheme.colorScheme.error
89-
.copy(alpha = AlphaDisabled)
90-
.compositeOver(MaterialTheme.colorScheme.primary),
80+
MaterialTheme.colorScheme.onSurface.copy(alpha = AlphaDisabled),
81+
disabledUncheckedThumbColor = MaterialTheme.colorScheme.error.copy(alpha = AlphaDisabled),
9182
disabledUncheckedTrackColor = Color.Transparent,
9283
disabledUncheckedBorderColor =
93-
MaterialTheme.colorScheme.onPrimary
94-
.copy(alpha = AlphaDisabled)
95-
.compositeOver(MaterialTheme.colorScheme.primary),
84+
MaterialTheme.colorScheme.onSurface.copy(alpha = AlphaDisabled)
9685
)

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/ConnectScreen.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ private fun MapColumn(
311311
markers = markers,
312312
globeColors =
313313
GlobeColors(
314-
landColor = MaterialTheme.colorScheme.onSurface,
314+
landColor = MaterialTheme.colorScheme.primary,
315315
oceanColor = MaterialTheme.colorScheme.surface,
316316
)
317317
)
@@ -346,15 +346,15 @@ private fun ConnectionInfo(state: ConnectUiState) {
346346
Text(
347347
text = state.location?.country ?: "",
348348
style = MaterialTheme.typography.headlineLarge,
349-
color = MaterialTheme.colorScheme.onPrimary,
349+
color = MaterialTheme.colorScheme.onSurface,
350350
maxLines = 1,
351351
overflow = TextOverflow.Ellipsis,
352352
modifier = Modifier.padding(horizontal = Dimens.sideMargin)
353353
)
354354
Text(
355355
text = state.location?.city ?: "",
356356
style = MaterialTheme.typography.headlineLarge,
357-
color = MaterialTheme.colorScheme.onPrimary,
357+
color = MaterialTheme.colorScheme.onSurface,
358358
maxLines = 1,
359359
overflow = TextOverflow.Ellipsis,
360360
modifier = Modifier.padding(horizontal = Dimens.sideMargin)

0 commit comments

Comments
 (0)