Skip to content

Commit fba5a32

Browse files
committed
Merge branch 'bump-dependencies-5'
2 parents cb538fc + 41e9f18 commit fba5a32

14 files changed

+538
-660
lines changed

.github/workflows/android-audit.yml

+3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ jobs:
8484
- name: Fix git dir
8585
run: git config --global --add safe.directory $(pwd)
8686

87+
- name: Create Android rustJniLibs dir
88+
run: mkdir -p android/app/build/rustJniLibs/android
89+
8790
- name: Re-generate lockfile
8891
run: android/scripts/update-lockfile.sh
8992

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ fun NegativeButton(
7676
),
7777
isEnabled: Boolean = true,
7878
isLoading: Boolean = false,
79-
icon: @Composable (() -> Unit)? = null,
79+
content: @Composable (() -> Unit)? = null,
8080
) {
8181
BaseButton(
8282
onClick = onClick,
@@ -85,7 +85,7 @@ fun NegativeButton(
8585
modifier = modifier,
8686
isEnabled = isEnabled,
8787
isLoading = isLoading,
88-
trailingIcon = icon,
88+
trailingIcon = content,
8989
)
9090
}
9191

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

+15-16
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ private fun PreviewCheckableRelayLocationCell(
6868
}
6969
}
7070

71-
@OptIn(ExperimentalFoundationApi::class)
7271
@Composable
7372
fun StatusRelayItemCell(
7473
item: RelayItem,
@@ -89,7 +88,12 @@ fun StatusRelayItemCell(
8988
item = item,
9089
isSelected = isSelected,
9190
state = state,
92-
leadingContent = {
91+
onClick = onClick,
92+
onLongClick = onLongClick,
93+
onToggleExpand = onToggleExpand,
94+
isExpanded = isExpanded,
95+
depth = depth,
96+
content = {
9397
if (isSelected) {
9498
Icon(imageVector = Icons.Default.Check, contentDescription = null)
9599
} else {
@@ -111,11 +115,6 @@ fun StatusRelayItemCell(
111115
)
112116
}
113117
},
114-
onClick = onClick,
115-
onLongClick = onLongClick,
116-
onToggleExpand = onToggleExpand,
117-
isExpanded = isExpanded,
118-
depth = depth,
119118
)
120119
}
121120

@@ -126,12 +125,12 @@ fun RelayItemCell(
126125
item: RelayItem,
127126
isSelected: Boolean,
128127
state: RelayListItemState?,
129-
leadingContent: (@Composable RowScope.() -> Unit)? = null,
130128
onClick: () -> Unit,
131129
onLongClick: (() -> Unit)? = null,
132-
onToggleExpand: ((Boolean) -> Unit),
130+
onToggleExpand: (Boolean) -> Unit,
133131
isExpanded: Boolean,
134132
depth: Int,
133+
content: @Composable (RowScope.() -> Unit)? = null,
135134
) {
136135

137136
val leadingContentStartPadding = Dimens.cellStartPadding
@@ -162,8 +161,8 @@ fun RelayItemCell(
162161
.weight(1f),
163162
verticalAlignment = Alignment.CenterVertically,
164163
) {
165-
if (leadingContent != null) {
166-
leadingContent()
164+
if (content != null) {
165+
content()
167166
}
168167
Name(name = item.name, state = state)
169168
}
@@ -194,16 +193,16 @@ fun CheckableRelayLocationCell(
194193
item = item,
195194
isSelected = false,
196195
state = null,
197-
leadingContent = {
196+
onClick = { onRelayCheckedChange(!checked) },
197+
onToggleExpand = onExpand,
198+
isExpanded = expanded,
199+
depth = depth,
200+
content = {
198201
MullvadCheckbox(
199202
checked = checked,
200203
onCheckedChange = { isChecked -> onRelayCheckedChange(isChecked) },
201204
)
202205
},
203-
onClick = { onRelayCheckedChange(!checked) },
204-
onToggleExpand = onExpand,
205-
isExpanded = expanded,
206-
depth = depth,
207206
)
208207
}
209208

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ fun SwitchCellView(
177177
}
178178
}
179179

180-
MullvadSwitch(checked = isToggled, enabled = isEnabled, onCheckedChange = onSwitchClicked)
180+
MullvadSwitch(checked = isToggled, onCheckedChange = onSwitchClicked, enabled = isEnabled)
181181
}
182182
}
183183

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,12 @@ fun MullvadExposedDropdownMenuBox(
5757

5858
@Composable
5959
fun MullvadDropdownMenuItem(
60-
leadingIcon: @Composable (() -> Unit)? = null,
6160
text: String,
6261
onClick: () -> Unit,
62+
content: @Composable (() -> Unit)? = null,
6363
) {
6464
DropdownMenuItem(
65-
leadingIcon = leadingIcon,
65+
leadingIcon = content,
6666
colors = menuItemColors,
6767
text = { Text(text = text) },
6868
onClick = onClick,

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ private fun PreviewMullvadSwitch() {
3434
) {
3535
MullvadSwitch(checked = true, onCheckedChange = null)
3636
MullvadSwitch(checked = false, onCheckedChange = null)
37-
MullvadSwitch(checked = true, enabled = false, onCheckedChange = null)
38-
MullvadSwitch(checked = false, enabled = false, onCheckedChange = null)
37+
MullvadSwitch(checked = true, onCheckedChange = null, enabled = false)
38+
MullvadSwitch(checked = false, onCheckedChange = null, enabled = false)
3939
}
4040
}
4141
}
@@ -46,19 +46,19 @@ fun MullvadSwitch(
4646
checked: Boolean,
4747
onCheckedChange: ((Boolean) -> Unit)?,
4848
modifier: Modifier = Modifier,
49-
thumbContent: (@Composable () -> Unit)? = {
50-
// This is needed to ensure the thumb always is big in off mode
51-
Spacer(modifier = Modifier.size(Dimens.switchIconSize))
52-
},
5349
enabled: Boolean = true,
5450
colors: SwitchColors = mullvadSwitchColors(),
5551
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
52+
content: @Composable (() -> Unit)? = {
53+
// This is needed to ensure the thumb always is big in off mode
54+
Spacer(modifier = Modifier.size(Dimens.switchIconSize))
55+
},
5656
) {
5757
Switch(
5858
checked = checked,
5959
onCheckedChange = onCheckedChange,
6060
modifier = modifier.testTag(SWITCH_TEST_TAG),
61-
thumbContent = thumbContent,
61+
thumbContent = content,
6262
enabled = enabled,
6363
colors = colors,
6464
interactionSource = interactionSource,

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/preview/AccountUiStatePreviewParameterProvider.kt

+18-18
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ class AccountUiStatePreviewParameterProvider : PreviewParameterProvider<AccountU
3737
showManageAccountLoading = false,
3838
)
3939
) + generateOtherStates()
40-
}
4140

42-
private fun generateOtherStates(): Sequence<AccountUiState> =
43-
sequenceOf(
44-
PaymentState.Loading,
45-
PaymentState.NoPayment,
46-
PaymentState.NoProductsFounds,
47-
PaymentState.Error.Billing,
48-
)
49-
.map { state ->
50-
AccountUiState(
51-
deviceName = "Test Name",
52-
accountNumber = AccountNumber("1234123412341234"),
53-
accountExpiry = null,
54-
showSitePayment = false,
55-
billingPaymentState = state,
56-
showLogoutLoading = false,
57-
showManageAccountLoading = false,
41+
private fun generateOtherStates(): Sequence<AccountUiState> =
42+
sequenceOf(
43+
PaymentState.Loading,
44+
PaymentState.NoPayment,
45+
PaymentState.NoProductsFounds,
46+
PaymentState.Error.Billing,
5847
)
59-
}
48+
.map { state ->
49+
AccountUiState(
50+
deviceName = "Test Name",
51+
accountNumber = AccountNumber("1234123412341234"),
52+
accountExpiry = null,
53+
showSitePayment = false,
54+
billingPaymentState = state,
55+
showLogoutLoading = false,
56+
showManageAccountLoading = false,
57+
)
58+
}
59+
}

android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/preview/TunnelStatePreviewData.kt

+27-27
Original file line numberDiff line numberDiff line change
@@ -37,36 +37,36 @@ object TunnelStatePreviewData {
3737
TunnelState.Error(
3838
errorState = ErrorState(cause = ErrorStateCause.DnsError, isBlocking = isBlocking)
3939
)
40-
}
4140

42-
private fun generateTunnelEndpoint(quantumResistant: Boolean, daita: Boolean): TunnelEndpoint =
43-
TunnelEndpoint(
44-
endpoint = generateEndpoint(TransportProtocol.Udp),
45-
quantumResistant = quantumResistant,
46-
obfuscation =
47-
ObfuscationEndpoint(
48-
endpoint = generateEndpoint(TransportProtocol.Tcp),
49-
ObfuscationType.Udp2Tcp,
50-
),
51-
daita = daita,
52-
)
41+
private fun generateTunnelEndpoint(quantumResistant: Boolean, daita: Boolean): TunnelEndpoint =
42+
TunnelEndpoint(
43+
endpoint = generateEndpoint(TransportProtocol.Udp),
44+
quantumResistant = quantumResistant,
45+
obfuscation =
46+
ObfuscationEndpoint(
47+
endpoint = generateEndpoint(TransportProtocol.Tcp),
48+
ObfuscationType.Udp2Tcp,
49+
),
50+
daita = daita,
51+
)
5352

54-
private fun generateEndpoint(transportProtocol: TransportProtocol) =
55-
Endpoint(address = InetSocketAddress(DEFAULT_ENDPOINT_PORT), protocol = transportProtocol)
53+
private fun generateEndpoint(transportProtocol: TransportProtocol) =
54+
Endpoint(address = InetSocketAddress(DEFAULT_ENDPOINT_PORT), protocol = transportProtocol)
5655

57-
private fun generateLocation(): GeoIpLocation =
58-
GeoIpLocation(
59-
ipv4 = null,
60-
ipv6 = null,
61-
country = "",
62-
city = "",
63-
hostname = "",
64-
entryHostname = "",
65-
latitude = 0.0,
66-
longitude = 0.0,
67-
)
56+
private fun generateLocation(): GeoIpLocation =
57+
GeoIpLocation(
58+
ipv4 = null,
59+
ipv6 = null,
60+
country = "",
61+
city = "",
62+
hostname = "",
63+
entryHostname = "",
64+
latitude = 0.0,
65+
longitude = 0.0,
66+
)
6867

69-
private fun generateFeatureIndicators(size: Int): List<FeatureIndicator> =
70-
FeatureIndicator.entries.subList(0, size)
68+
private fun generateFeatureIndicators(size: Int): List<FeatureIndicator> =
69+
FeatureIndicator.entries.subList(0, size)
70+
}
7171

7272
private const val DEFAULT_ENDPOINT_PORT = 100

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ private fun ApiAccessMethodTypeSelection(
333333
close()
334334
onTypeSelected(it)
335335
},
336-
leadingIcon = {
336+
content = {
337337
Icon(
338338
imageVector = Icons.Default.Check,
339339
contentDescription = null,
@@ -510,7 +510,7 @@ private fun CipherSelection(cipher: Cipher, onCipherChange: (Cipher) -> Unit) {
510510
close()
511511
onCipherChange(it)
512512
},
513-
leadingIcon = {
513+
content = {
514514
Icon(
515515
imageVector = Icons.Default.Check,
516516
contentDescription = null,
@@ -549,7 +549,7 @@ private fun EnableAuthentication(
549549
close()
550550
onToggleAuthenticationEnabled(true)
551551
},
552-
leadingIcon = {
552+
content = {
553553
Icon(
554554
imageVector = Icons.Default.Check,
555555
contentDescription = null,
@@ -565,7 +565,7 @@ private fun EnableAuthentication(
565565
close()
566566
onToggleAuthenticationEnabled(false)
567567
},
568-
leadingIcon = {
568+
content = {
569569
Icon(
570570
imageVector = Icons.Default.Check,
571571
contentDescription = null,

0 commit comments

Comments
 (0)