Skip to content

Commit

Permalink
Merge branch 'update-and-remove-libraries'
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Jan 25, 2024
2 parents c92bff7 + 19794f9 commit 68f3c6e
Show file tree
Hide file tree
Showing 19 changed files with 364 additions and 250 deletions.
2 changes: 0 additions & 2 deletions android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -323,14 +323,12 @@ dependencies {
playImplementation(project(Dependencies.Mullvad.billingLib))

implementation(Dependencies.commonsValidator)
implementation(Dependencies.AndroidX.constraintlayout)
implementation(Dependencies.AndroidX.coreKtx)
implementation(Dependencies.AndroidX.lifecycleRuntimeKtx)
implementation(Dependencies.AndroidX.lifecycleViewmodelKtx)
implementation(Dependencies.Compose.constrainLayout)
implementation(Dependencies.Compose.foundation)
implementation(Dependencies.Compose.material3)
implementation(Dependencies.Compose.uiController)
implementation(Dependencies.Compose.ui)
implementation(Dependencies.Compose.uiUtil)
implementation(Dependencies.Compose.destinations)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ fun SplitTunnelingCell(
.clickable(onClick = onCellClicked)
) {
Image(
painter = icon?.let { iconImage -> BitmapPainter(iconImage) }
painter =
icon?.let { iconImage -> BitmapPainter(iconImage) }
?: painterResource(id = R.drawable.ic_icons_missing),
contentDescription = null,
modifier =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ fun LocationInfo(
TransportProtocol.Udp -> stringResource(id = R.string.udp)
}
"${inAddress.first}:${inAddress.second} $protocol"
}
?: ""
} ?: ""
Text(
text = "${stringResource(id = R.string.in_address)} $textInAddress",
color = colorExpanded,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,7 @@ fun MullvadTopBarWithDeviceName(
text =
deviceName?.let {
stringResource(id = R.string.top_bar_device_name, deviceName)
}
?: "",
} ?: "",
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.bodySmall,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ private fun DeviceListItem(
text =
deviceUiState.device.created.parseAsDateTime()?.let { creationDate ->
stringResource(id = R.string.created_x, creationDate.formatDate())
}
?: "",
} ?: "",
style = MaterialTheme.typography.listItemSubText,
color =
MaterialTheme.colorScheme.onPrimary
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ private fun List<RelayCountry>.expandItemForSelection(
}
}
}
}
?: this
} ?: this
}

private const val MIN_SEARCH_LENGTH = 2
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ class DeviceRepository(
withTimeoutOrNull(timeoutMillis) {
deviceListEvents.onStart { refreshDeviceList(accountToken) }.firstOrNull()
?: DeviceListEvent.Error
}
?: DeviceListEvent.Error
} ?: DeviceListEvent.Error

if (shouldOverrideCache) {
updateCache(result, accountToken)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ class OutOfTimeUseCase(

private fun TunnelState.isTunnelErrorStateDueToExpiredAccount(): Boolean {
return ((this as? TunnelState.Error)?.errorState?.cause as? ErrorStateCause.AuthFailed)
?.isCausedByExpiredAccount()
?: false
?.isCausedByExpiredAccount() ?: false
}

private fun pastAccountExpiry(): Flow<Boolean?> =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ class ConnectViewModel(
ConnectUiState(
location =
when (tunnelRealState) {
is TunnelState.Disconnected -> tunnelRealState.location()
?: lastKnownDisconnectedLocation
is TunnelState.Connecting -> tunnelRealState.location
?: relayLocation?.location?.location
is TunnelState.Disconnected ->
tunnelRealState.location() ?: lastKnownDisconnectedLocation
is TunnelState.Connecting ->
tunnelRealState.location ?: relayLocation?.location?.location
is TunnelState.Connected -> tunnelRealState.location
is TunnelState.Disconnecting -> lastKnownDisconnectedLocation
is TunnelState.Error -> null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ class DeviceRevokedViewModel(
} else {
DeviceRevokedUiState.UNSECURED
}
}
?: flowOf(DeviceRevokedUiState.UNKNOWN)
} ?: flowOf(DeviceRevokedUiState.UNKNOWN)
}
.stateIn(
scope = CoroutineScope(dispatcher),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ class FilterViewModel(
) { allProviders, selectedConstraintProviders ->
selectedConstraintProviders.toSelectedProviders(allProviders)
}
.first()
?: emptyList()
.first() ?: emptyList()

val ownershipConstraint = relayListFilterUseCase.selectedOwnership().first()
selectedOwnership.value = ownershipConstraint.toNullableOwnership()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ data class SplitTunnelingViewModelState(
.sortedBy { it.name },
showSystemApps = showSystemApps
)
}
?: SplitTunnelingUiState.Loading
} ?: SplitTunnelingUiState.Loading
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ class VpnSettingsViewModel(
isLocalNetworkSharingEnabled = settings?.allowLan ?: false,
isCustomDnsEnabled = settings?.isCustomDnsEnabled() ?: false,
customDnsList = settings?.addresses()?.asStringAddressList() ?: listOf(),
contentBlockersOptions = settings?.contentBlockersSettings()
?: DefaultDnsOptions(),
selectedObfuscation = settings?.selectedObfuscationSettings()
?: SelectedObfuscation.Off,
contentBlockersOptions =
settings?.contentBlockersSettings() ?: DefaultDnsOptions(),
selectedObfuscation =
settings?.selectedObfuscationSettings() ?: SelectedObfuscation.Off,
quantumResistant = settings?.quantumResistant() ?: QuantumResistantState.Off,
selectedWireguardPort = settings?.getWireguardPort() ?: Constraint.Any(),
customWireguardPort = customWgPort,
Expand Down
4 changes: 0 additions & 4 deletions android/buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ object Dependencies {

object AndroidX {
const val appcompat = "androidx.appcompat:appcompat:${Versions.AndroidX.appcompat}"
const val constraintlayout =
"androidx.constraintlayout:constraintlayout:${Versions.AndroidX.constraintlayout}"
const val coreKtx = "androidx.core:core-ktx:${Versions.AndroidX.coreKtx}"
const val fragmentTestning =
"androidx.fragment:fragment-testing:${Versions.AndroidX.fragment}"
Expand Down Expand Up @@ -53,8 +51,6 @@ object Dependencies {
const val material3 = "androidx.compose.material3:material3:${Versions.Compose.material3}"
const val testManifest = "androidx.compose.ui:ui-test-manifest:${Versions.Compose.base}"
const val ui = "androidx.compose.ui:ui:${Versions.Compose.base}"
const val uiController =
"com.google.accompanist:accompanist-systemuicontroller:${Versions.Compose.uiController}"
const val uiTestManifest = "androidx.compose.ui:ui-test-manifest:${Versions.Compose.base}"
const val uiTooling = "androidx.compose.ui:ui-tooling:${Versions.Compose.base}"
const val uiToolingAndroidPreview =
Expand Down
16 changes: 7 additions & 9 deletions android/buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
object Versions {
const val commonsValidator = "1.7"
const val commonsValidator = "1.8.0"
const val jodaTime = "2.12.5"
const val junit = "5.10.0"
const val jvmTarget = "17"
Expand All @@ -9,7 +9,7 @@ object Versions {
const val kotlinx = "1.7.3"
const val leakCanary = "2.12"
const val mockk = "1.13.8"
const val mockWebserver = "4.11.0"
const val mockWebserver = "4.12.0"
const val turbine = "1.0.0"
const val billingClient = "6.0.1"

Expand All @@ -23,10 +23,9 @@ object Versions {

object AndroidX {
const val appcompat = "1.6.1"
const val coreKtx = "1.9.0"
const val constraintlayout = "2.1.4"
const val coreKtx = "1.12.0"
const val espresso = "3.5.1"
const val lifecycle = "2.6.1"
const val lifecycle = "2.7.0"
const val fragment = "1.6.1"
const val test = "1.5.0"
const val testMonitor = "1.6.1"
Expand All @@ -41,7 +40,6 @@ object Versions {
const val constrainLayout = "1.0.1"
const val foundation = base
const val material3 = "1.1.1"
const val uiController = "0.30.1"
}

object Plugin {
Expand All @@ -54,14 +52,14 @@ object Versions {
const val dependencyCheck = "8.3.1"
const val gradleVersions = "0.47.0"
const val junit5 = "1.10.0.0"
const val ktfmt = "0.13.0"
const val ktfmt = "0.16.0"
// Ksp version is linked with kotlin version, find matching release here:
// https://github.com/google/ksp/releases
const val ksp = "${kotlin}-1.0.14"
}

object Koin {
const val base = "3.4.3"
const val compose = "3.4.6"
const val base = "3.5.3"
const val compose = "3.5.3"
}
}
Loading

0 comments on commit 68f3c6e

Please sign in to comment.