Skip to content

Commit 4ffc8b1

Browse files
committed
Cleaned up some more
1 parent 69314b0 commit 4ffc8b1

27 files changed

+111
-103
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ private fun PreviewSitePaymentButton() {
1717
AppTheme {
1818
SpacedColumn(
1919
spacing = Dimens.cellVerticalSpacing,
20-
modifier = Modifier.background(color = MaterialTheme.colorScheme.background)
20+
modifier = Modifier.background(color = MaterialTheme.colorScheme.surface)
2121
) {
2222
SitePaymentButton(onClick = {}, isEnabled = true)
2323
SitePaymentButton(onClick = {}, isEnabled = false)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ fun BaseSubtitleCell(
121121
text: String,
122122
modifier: Modifier = Modifier,
123123
style: TextStyle = MaterialTheme.typography.labelMedium,
124-
color: Color = MaterialTheme.colorScheme.onSecondary
124+
color: Color
125125
) {
126126
BaseSubtitleCell(
127127
text = AnnotatedString(text),
@@ -136,7 +136,7 @@ fun BaseSubtitleCell(
136136
text: AnnotatedString,
137137
modifier: Modifier = Modifier,
138138
style: TextStyle = MaterialTheme.typography.labelMedium,
139-
color: Color = MaterialTheme.colorScheme.onSecondary
139+
color: Color
140140
) {
141141
Text(
142142
text = text,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ internal fun CheckboxCell(
5454
Text(
5555
text = title,
5656
style = MaterialTheme.typography.labelLarge,
57-
color = MaterialTheme.colorScheme.onBackground,
57+
color = MaterialTheme.colorScheme.onSurface,
5858
modifier =
5959
Modifier.weight(1f)
6060
.padding(top = Dimens.mediumPadding, bottom = Dimens.mediumPadding)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import net.mullvad.mullvadvpn.lib.theme.color.selected
3838
@Composable
3939
private fun PreviewCustomPortCell() {
4040
AppTheme {
41-
SpacedColumn(Modifier.background(MaterialTheme.colorScheme.background)) {
41+
SpacedColumn(Modifier.background(MaterialTheme.colorScheme.surface)) {
4242
CustomPortCell(title = "Title", isSelected = true, port = Port(444))
4343
CustomPortCell(title = "Title", isSelected = false, port = null)
4444
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ private fun PreviewNavigationCell() {
3030
NavigationCellBody(
3131
contentBodyDescription = "",
3232
content = "content body",
33-
contentColor = MaterialTheme.colorScheme.error,
33+
contentColor = MaterialTheme.colorScheme.onPrimary,
3434
)
3535
},
3636
onClick = {},
@@ -49,7 +49,7 @@ private fun PreviewExternalLinkComposeCell() {
4949
NavigationCellBody(
5050
contentBodyDescription = "content body",
5151
content = "content body",
52-
contentColor = MaterialTheme.colorScheme.onSecondary,
52+
contentColor = MaterialTheme.colorScheme.onPrimary,
5353
isExternalLink = true
5454
)
5555
},

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

+11-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ fun RelayItemCell(
155155
Name(modifier = Modifier.weight(1f), relay = item)
156156

157157
if (item.hasChildren) {
158-
ExpandButton(isExpanded = isExpanded, onClick = { onToggleExpand(!isExpanded) })
158+
ExpandButton(
159+
color = MaterialTheme.colorScheme.onSurface,
160+
isExpanded = isExpanded,
161+
onClick = { onToggleExpand(!isExpanded) }
162+
)
159163
}
160164
}
161165
}
@@ -208,12 +212,17 @@ private fun Name(modifier: Modifier = Modifier, relay: RelayItem) {
208212
}
209213

210214
@Composable
211-
private fun RowScope.ExpandButton(isExpanded: Boolean, onClick: (expand: Boolean) -> Unit) {
215+
private fun RowScope.ExpandButton(
216+
color: Color,
217+
isExpanded: Boolean,
218+
onClick: (expand: Boolean) -> Unit
219+
) {
212220
VerticalDivider(
213221
color = MaterialTheme.colorScheme.surface,
214222
modifier = Modifier.padding(vertical = Dimens.verticalDividerPadding)
215223
)
216224
Chevron(
225+
color = color,
217226
isExpanded = isExpanded,
218227
modifier =
219228
Modifier.fillMaxHeight()

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private fun PreviewTunnelingCell() {
3939
AppTheme {
4040
SpacedColumn(
4141
modifier =
42-
Modifier.background(color = MaterialTheme.colorScheme.background).padding(20.dp)
42+
Modifier.background(color = MaterialTheme.colorScheme.surface).padding(20.dp)
4343
) {
4444
SplitTunnelingCell(
4545
title = "Mullvad VPN",

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

+2-7
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import androidx.compose.animation.core.TweenSpec
55
import androidx.compose.animation.core.animateFloatAsState
66
import androidx.compose.material3.Icon
77
import androidx.compose.material3.IconButton
8-
import androidx.compose.material3.MaterialTheme
98
import androidx.compose.runtime.Composable
109
import androidx.compose.runtime.remember
1110
import androidx.compose.ui.Modifier
@@ -15,11 +14,7 @@ import androidx.compose.ui.res.painterResource
1514
import net.mullvad.mullvadvpn.R
1615

1716
@Composable
18-
fun Chevron(
19-
modifier: Modifier = Modifier,
20-
color: Color = MaterialTheme.colorScheme.onBackground,
21-
isExpanded: Boolean
22-
) {
17+
fun Chevron(modifier: Modifier = Modifier, color: Color, isExpanded: Boolean) {
2318

2419
val degree = remember(isExpanded) { if (isExpanded) 270f else 90f }
2520
val animatedRotation =
@@ -40,7 +35,7 @@ fun Chevron(
4035
@Composable
4136
fun ChevronButton(
4237
modifier: Modifier = Modifier,
43-
color: Color = MaterialTheme.colorScheme.onBackground,
38+
color: Color,
4439
onExpand: (Boolean) -> Unit,
4540
isExpanded: Boolean
4641
) {

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private fun PreviewMullvadProgressIndicator() {
3434
@Composable
3535
fun MullvadCircularProgressIndicatorLarge(
3636
modifier: Modifier = Modifier,
37-
color: Color = MaterialTheme.colorScheme.onBackground,
37+
color: Color = MaterialTheme.colorScheme.onSurface,
3838
trackColor: Color = color.copy(alpha = Alpha20),
3939
) {
4040
CircularProgressIndicator(
@@ -49,7 +49,7 @@ fun MullvadCircularProgressIndicatorLarge(
4949
@Composable
5050
fun MullvadCircularProgressIndicatorMedium(
5151
modifier: Modifier = Modifier,
52-
color: Color = MaterialTheme.colorScheme.onBackground,
52+
color: Color = MaterialTheme.colorScheme.onSurface,
5353
trackColor: Color = color.copy(alpha = Alpha20),
5454
) {
5555
CircularProgressIndicator(
@@ -64,7 +64,7 @@ fun MullvadCircularProgressIndicatorMedium(
6464
@Composable
6565
fun MullvadCircularProgressIndicatorSmall(
6666
modifier: Modifier = Modifier,
67-
color: Color = MaterialTheme.colorScheme.onBackground,
67+
color: Color = MaterialTheme.colorScheme.onSurface,
6868
trackColor: Color = color.copy(alpha = Alpha20),
6969
) {
7070
CircularProgressIndicator(

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import net.mullvad.mullvadvpn.lib.theme.Dimens
3333
@Composable
3434
private fun PreviewPlayPaymentPaymentAvailable() {
3535
AppTheme {
36-
Box(modifier = Modifier.background(color = MaterialTheme.colorScheme.background)) {
36+
Box(modifier = Modifier.background(color = MaterialTheme.colorScheme.surface)) {
3737
PlayPayment(
3838
billingPaymentState =
3939
PaymentState.PaymentAvailable(
@@ -58,7 +58,7 @@ private fun PreviewPlayPaymentPaymentAvailable() {
5858
@Composable
5959
private fun PreviewPlayPaymentLoading() {
6060
AppTheme {
61-
Box(modifier = Modifier.background(color = MaterialTheme.colorScheme.background)) {
61+
Box(modifier = Modifier.background(color = MaterialTheme.colorScheme.surface)) {
6262
PlayPayment(
6363
billingPaymentState = PaymentState.Loading,
6464
onPurchaseBillingProductClick = {},
@@ -73,7 +73,7 @@ private fun PreviewPlayPaymentLoading() {
7373
@Composable
7474
private fun PreviewPlayPaymentPaymentPending() {
7575
AppTheme {
76-
Box(modifier = Modifier.background(color = MaterialTheme.colorScheme.background)) {
76+
Box(modifier = Modifier.background(color = MaterialTheme.colorScheme.surface)) {
7777
PlayPayment(
7878
billingPaymentState =
7979
PaymentState.PaymentAvailable(
@@ -98,7 +98,7 @@ private fun PreviewPlayPaymentPaymentPending() {
9898
@Composable
9999
private fun PreviewPlayPaymentVerificationInProgress() {
100100
AppTheme {
101-
Box(modifier = Modifier.background(color = MaterialTheme.colorScheme.background)) {
101+
Box(modifier = Modifier.background(color = MaterialTheme.colorScheme.surface)) {
102102
PlayPayment(
103103
billingPaymentState =
104104
PaymentState.PaymentAvailable(
@@ -153,7 +153,7 @@ fun PlayPayment(
153153
Row(verticalAlignment = Alignment.Bottom) {
154154
Text(
155155
style = MaterialTheme.typography.labelLarge,
156-
color = MaterialTheme.colorScheme.onBackground,
156+
color = MaterialTheme.colorScheme.onSurface,
157157
text = statusMessage,
158158
modifier = Modifier.padding(bottom = Dimens.smallPadding)
159159
)
@@ -164,7 +164,7 @@ fun PlayPayment(
164164
Icon(
165165
painter = painterResource(id = R.drawable.icon_info),
166166
contentDescription = null,
167-
tint = MaterialTheme.colorScheme.onBackground
167+
tint = MaterialTheme.colorScheme.onSurface
168168
)
169169
}
170170
}

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import net.mullvad.mullvadvpn.lib.theme.color.selected
2525
@Composable
2626
private fun PreviewMullvadSwitch() {
2727
AppTheme {
28-
Surface(color = MaterialTheme.colorScheme.background) {
28+
Surface(color = MaterialTheme.colorScheme.surface) {
2929
Column(
3030
verticalArrangement = Arrangement.spacedBy(Dimens.mediumPadding),
3131
modifier = Modifier.padding(Dimens.sideMargin)

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ fun InAppNotification.toNotificationData(
5858
.toAnnotatedString(
5959
boldSpanStyle =
6060
SpanStyle(
61-
color = MaterialTheme.colorScheme.onBackground,
61+
color = MaterialTheme.colorScheme.onSurface,
6262
fontWeight = FontWeight.ExtraBold
6363
),
6464
),
@@ -109,7 +109,7 @@ private fun errorMessageBannerData(error: ErrorState) =
109109
.toAnnotatedString(
110110
boldSpanStyle =
111111
SpanStyle(
112-
color = MaterialTheme.colorScheme.onBackground,
112+
color = MaterialTheme.colorScheme.onSurface,
113113
fontWeight = FontWeight.ExtraBold
114114
)
115115
),

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/ChangelogDialog.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,14 @@ private fun ChangeListItem(text: String) {
8686
Text(
8787
text = "",
8888
style = MaterialTheme.typography.labelMedium,
89-
color = MaterialTheme.colorScheme.onBackground,
89+
color = MaterialTheme.colorScheme.onSurface,
9090
modifier = Modifier.width(Dimens.buttonSpacing),
9191
textAlign = TextAlign.Center
9292
)
9393
Text(
9494
text = text,
9595
style = MaterialTheme.typography.labelMedium,
96-
color = MaterialTheme.colorScheme.onBackground
96+
color = MaterialTheme.colorScheme.onSurface
9797
)
9898
}
9999
}

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ fun DnsDialog(
162162
}
163163
},
164164
onDismissRequest = onDismiss,
165-
containerColor = MaterialTheme.colorScheme.background,
166-
titleContentColor = MaterialTheme.colorScheme.onBackground,
165+
containerColor = MaterialTheme.colorScheme.surface,
166+
titleContentColor = MaterialTheme.colorScheme.onSurface,
167167
)
168168
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ private fun ApiAccessMethodItem(
185185
}
186186
),
187187
titleStyle = MaterialTheme.typography.titleMedium,
188-
subtitleColor = MaterialTheme.colorScheme.onSecondary,
188+
subtitleColor = MaterialTheme.colorScheme.onSurfaceVariant,
189189
bodyView = {
190190
DefaultNavigationView(
191191
chevronContentDescription = apiAccessMethodSetting.name.value,
192-
tint = MaterialTheme.colorScheme.onSecondary
192+
tint = MaterialTheme.colorScheme.onPrimary
193193
)
194194
},
195195
onCellClicked = { onApiAccessMethodClick(apiAccessMethodSetting) }

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

+5-5
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ private fun ConstraintLayoutScope.AutoConnectCarousel(
178178
modifier = Modifier.padding(horizontal = Dimens.largePadding),
179179
style =
180180
MaterialTheme.typography.titleMedium.copy(
181-
color = MaterialTheme.colorScheme.onSurface
181+
color = MaterialTheme.colorScheme.onSurfaceVariant
182182
),
183183
text = annotatedTopText,
184184
onClick = {
@@ -195,7 +195,7 @@ private fun ConstraintLayoutScope.AutoConnectCarousel(
195195
Text(
196196
modifier = Modifier.padding(horizontal = Dimens.largePadding),
197197
style = MaterialTheme.typography.titleMedium,
198-
color = MaterialTheme.colorScheme.onSurface,
198+
color = MaterialTheme.colorScheme.onSurfaceVariant,
199199
text =
200200
HtmlCompat.fromHtml(
201201
stringResource(id = page.bottomText),
@@ -269,15 +269,15 @@ private fun ConstraintLayoutScope.PageIndicator(
269269
@Composable
270270
private fun buildTopText(@StringRes id: Int) = buildAnnotatedString {
271271
withStyle(
272-
style = SpanStyle(color = MaterialTheme.colorScheme.onSecondary),
272+
style = SpanStyle(color = MaterialTheme.colorScheme.onSurfaceVariant),
273273
) {
274274
append(
275275
HtmlCompat.fromHtml(stringResource(id = id), HtmlCompat.FROM_HTML_MODE_COMPACT)
276276
.toAnnotatedString(
277277
boldSpanStyle =
278278
SpanStyle(
279279
fontWeight = FontWeight.ExtraBold,
280-
color = MaterialTheme.colorScheme.onPrimary
280+
color = MaterialTheme.colorScheme.onSurface
281281
)
282282
)
283283
)
@@ -298,7 +298,7 @@ private fun buildLockdownTopText() = buildAnnotatedString {
298298
withStyle(
299299
style =
300300
SpanStyle(
301-
color = MaterialTheme.colorScheme.onPrimary,
301+
color = MaterialTheme.colorScheme.onSurface,
302302
textDecoration = TextDecoration.Underline
303303
),
304304
) {

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

+1-2
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,7 @@ fun TunnelState.toMarker(location: GeoIpLocation?): Marker? {
429429
is TunnelState.Connected ->
430430
Marker(
431431
location.toLatLong(),
432-
colors =
433-
LocationMarkerColors(centerColor = MaterialTheme.colorScheme.inversePrimary),
432+
colors = LocationMarkerColors(centerColor = MaterialTheme.colorScheme.tertiary),
434433
)
435434
is TunnelState.Connecting -> null
436435
is TunnelState.Disconnected ->

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ fun CustomListLocationsScreen(
153153
Modifier.drawVerticalScrollbar(
154154
state = lazyListState,
155155
color =
156-
MaterialTheme.colorScheme.onBackground.copy(alpha = AlphaScrollbar)
156+
MaterialTheme.colorScheme.onSurface.copy(alpha = AlphaScrollbar)
157157
)
158158
.fillMaxWidth(),
159159
state = lazyListState,

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ private fun LazyListScope.empty() {
187187
text = stringResource(R.string.no_custom_lists_available),
188188
modifier = Modifier.padding(Dimens.screenVerticalMargin),
189189
style = MaterialTheme.typography.labelMedium,
190-
color = MaterialTheme.colorScheme.onSecondary
190+
color = MaterialTheme.colorScheme.onSurfaceVariant
191191
)
192192
}
193193
}

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ private fun ColumnScope.DeviceListHeader(state: DeviceListUiState) {
290290
}
291291
),
292292
style = MaterialTheme.typography.headlineSmall,
293-
color = MaterialTheme.colorScheme.onBackground,
293+
color = MaterialTheme.colorScheme.onSurface,
294294
modifier =
295295
Modifier.padding(
296296
start = Dimens.sideMargin,
@@ -311,7 +311,7 @@ private fun ColumnScope.DeviceListHeader(state: DeviceListUiState) {
311311
}
312312
),
313313
style = MaterialTheme.typography.bodySmall,
314-
color = MaterialTheme.colorScheme.onBackground,
314+
color = MaterialTheme.colorScheme.onSurface,
315315
modifier =
316316
Modifier.wrapContentHeight()
317317
.animateContentSize()

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ fun EditApiAccessMethodScreen(
221221
modifier
222222
.drawVerticalScrollbar(
223223
state = scrollState,
224-
color = MaterialTheme.colorScheme.onBackground.copy(alpha = AlphaScrollbar)
224+
color = MaterialTheme.colorScheme.onSurface.copy(alpha = AlphaScrollbar)
225225
)
226226
.verticalScroll(scrollState)
227227
.padding(horizontal = Dimens.sideMargin, vertical = Dimens.screenVerticalMargin)

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fun EditCustomListScreen(
160160
text = stringResource(id = R.string.not_found),
161161
modifier = Modifier.padding(Dimens.screenVerticalMargin),
162162
style = MaterialTheme.typography.labelMedium,
163-
color = MaterialTheme.colorScheme.onSecondary
163+
color = MaterialTheme.colorScheme.onSurface
164164
)
165165
}
166166
is EditCustomListState.Content -> {

0 commit comments

Comments
 (0)