From a7805d4e6e62ffaf6c8c3fb23957168a6ed3365f Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Fri, 2 Feb 2024 12:46:09 +0100 Subject: [PATCH 1/6] Update compose to version 1.6.0 Fixes DROID-663 --- android/buildSrc/src/main/kotlin/Versions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/buildSrc/src/main/kotlin/Versions.kt b/android/buildSrc/src/main/kotlin/Versions.kt index 3c2470b2d031..8ca351af452c 100644 --- a/android/buildSrc/src/main/kotlin/Versions.kt +++ b/android/buildSrc/src/main/kotlin/Versions.kt @@ -36,7 +36,7 @@ object Versions { object Compose { const val destinations = "1.9.55" - const val base = "1.5.4" + const val base = "1.6.0" const val constrainLayout = "1.0.1" const val foundation = base const val material3 = "1.1.1" From 59e1ae7baaa4fc37031c2806a415d659d4d9b236 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Fri, 2 Feb 2024 12:47:39 +0100 Subject: [PATCH 2/6] Update compose navigations to 1.10.0 --- android/buildSrc/src/main/kotlin/Versions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/buildSrc/src/main/kotlin/Versions.kt b/android/buildSrc/src/main/kotlin/Versions.kt index 8ca351af452c..2d93cfb87ee1 100644 --- a/android/buildSrc/src/main/kotlin/Versions.kt +++ b/android/buildSrc/src/main/kotlin/Versions.kt @@ -35,7 +35,7 @@ object Versions { } object Compose { - const val destinations = "1.9.55" + const val destinations = "1.10.0" const val base = "1.6.0" const val constrainLayout = "1.0.1" const val foundation = base From 3a8a23d1e83a51bbe2719c96f71b06f5b0517961 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Fri, 2 Feb 2024 12:48:54 +0100 Subject: [PATCH 3/6] Update compose material 3 to 1.2.0-rc01 --- .../net/mullvad/mullvadvpn/compose/component/FilterChip.kt | 6 +++--- .../net/mullvad/mullvadvpn/compose/component/TopBar.kt | 1 + .../mullvadvpn/compose/screen/SelectLocationScreen.kt | 6 ++++-- android/buildSrc/src/main/kotlin/Versions.kt | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/FilterChip.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/FilterChip.kt index c38eafa24ed1..3bb092b0de35 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/FilterChip.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/FilterChip.kt @@ -6,7 +6,6 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.size import androidx.compose.material3.ButtonDefaults -import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.FilterChip import androidx.compose.material3.FilterChipDefaults import androidx.compose.material3.MaterialTheme @@ -33,7 +32,6 @@ private fun PreviewMullvadFilterChip() { } } -@OptIn(ExperimentalMaterial3Api::class) @Composable fun MullvadFilterChip(text: String, onRemoveClick: () -> Unit) { FilterChip( @@ -44,7 +42,9 @@ fun MullvadFilterChip(text: String, onRemoveClick: () -> Unit) { border = FilterChipDefaults.filterChipBorder( borderColor = Color.Transparent, - disabledBorderColor = Color.Transparent + disabledBorderColor = Color.Transparent, + enabled = true, + selected = false ), selected = false, onClick = {}, diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/TopBar.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/TopBar.kt index 319cd9e9542d..d7b454111693 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/TopBar.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/TopBar.kt @@ -230,6 +230,7 @@ fun MullvadMediumTopBar( colors = TopAppBarDefaults.mediumTopAppBarColors( containerColor = MaterialTheme.colorScheme.background, + scrolledContainerColor = MaterialTheme.colorScheme.background, actionIconContentColor = MaterialTheme.colorScheme.onPrimary.copy(AlphaTopBar), ), actions = actions diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt index 33414dcbaabc..cf5d4f02c7f5 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/SelectLocationScreen.kt @@ -181,8 +181,10 @@ fun SelectLocationScreen( uiState.relayListState.selectedRelay.location.location.country } - lazyListState.scrollToItem(index) - lazyListState.animateScrollAndCentralizeItem(index) + if (index >= 0) { + lazyListState.scrollToItem(index) + lazyListState.animateScrollAndCentralizeItem(index) + } } } LazyColumn( diff --git a/android/buildSrc/src/main/kotlin/Versions.kt b/android/buildSrc/src/main/kotlin/Versions.kt index 2d93cfb87ee1..bbf99515d0e7 100644 --- a/android/buildSrc/src/main/kotlin/Versions.kt +++ b/android/buildSrc/src/main/kotlin/Versions.kt @@ -39,7 +39,7 @@ object Versions { const val base = "1.6.0" const val constrainLayout = "1.0.1" const val foundation = base - const val material3 = "1.1.1" + const val material3 = "1.2.0-rc01" } object Plugin { From 29947752f8ce3f50a26b9b824cedacc371f8b3ed Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Mon, 5 Feb 2024 11:59:35 +0100 Subject: [PATCH 4/6] Update lint version to 8.3 to fix lint error in lib:theme --- android/app/src/main/AndroidManifest.xml | 3 ++- android/gradle.properties | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 71077054969a..b4043fdee507 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -39,7 +39,8 @@ android:launchMode="singleInstance" android:configChanges="orientation|screenSize|screenLayout" android:screenOrientation="fullUser" - android:windowSoftInputMode="adjustResize"> + android:windowSoftInputMode="adjustResize" + tools:ignore="DiscouragedApi"> diff --git a/android/gradle.properties b/android/gradle.properties index 4233d36b8265..6ee1f9ff67a3 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -4,3 +4,4 @@ android.nonTransitiveRClass=false android.useAndroidX=true kotlin.code.style=official org.gradle.jvmargs=-Xmx8192M -Dkotlin.daemon.jvm.options\="-Xmx8192M" +android.experimental.lint.version=8.3.0-beta02 From 9878b712191a54b74d21ccb15cf2c609fa0d2a95 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Tue, 6 Feb 2024 13:32:16 +0100 Subject: [PATCH 5/6] Remove common lib dependency from test mockapi --- android/test/mockapi/build.gradle.kts | 1 - .../mullvadvpn/test/mockapi/AccountHistoryMockApiTest.kt | 6 +++--- .../mullvadvpn/test/mockapi/CreateAccountMockApiTest.kt | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/android/test/mockapi/build.gradle.kts b/android/test/mockapi/build.gradle.kts index 5c88d90d8234..10fd4ca99d98 100644 --- a/android/test/mockapi/build.gradle.kts +++ b/android/test/mockapi/build.gradle.kts @@ -70,7 +70,6 @@ configure { dependencies { implementation(project(Projects.testCommon)) - implementation(project(Dependencies.Mullvad.commonLib)) implementation(project(Dependencies.Mullvad.endpointLib)) implementation(Dependencies.AndroidX.testCore) diff --git a/android/test/mockapi/src/main/kotlin/net/mullvad/mullvadvpn/test/mockapi/AccountHistoryMockApiTest.kt b/android/test/mockapi/src/main/kotlin/net/mullvad/mullvadvpn/test/mockapi/AccountHistoryMockApiTest.kt index f43eadf5c03e..9d1727cad7d7 100644 --- a/android/test/mockapi/src/main/kotlin/net/mullvad/mullvadvpn/test/mockapi/AccountHistoryMockApiTest.kt +++ b/android/test/mockapi/src/main/kotlin/net/mullvad/mullvadvpn/test/mockapi/AccountHistoryMockApiTest.kt @@ -2,7 +2,6 @@ package net.mullvad.mullvadvpn.test.mockapi import androidx.test.uiautomator.By import net.mullvad.mullvadvpn.compose.test.LOGIN_INPUT_TEST_TAG -import net.mullvad.mullvadvpn.lib.common.util.groupWithSpaces import net.mullvad.mullvadvpn.test.common.extension.clickAgreeOnPrivacyDisclaimer import net.mullvad.mullvadvpn.test.common.extension.clickAllowOnNotificationPermissionPromptIfApiLevel33AndAbove import net.mullvad.mullvadvpn.test.common.extension.dismissChangelogDialogIfShown @@ -40,10 +39,11 @@ class AccountHistoryMockApiTest : MockApiTest() { device.findObjectWithTimeout(By.res(LOGIN_INPUT_TEST_TAG)).click() // Assert - assertNotNull(device.findObjectWithTimeout(By.text(validAccountToken.groupWithSpaces()))) + val expectedResult = "1234 1234 1234 1234" + assertNotNull(device.findObjectWithTimeout(By.text(expectedResult))) // Try to login with the same account again - device.findObjectWithTimeout(By.text(validAccountToken.groupWithSpaces())).click() + device.findObjectWithTimeout(By.text(expectedResult)).click() app.ensureLoggedIn() } } diff --git a/android/test/mockapi/src/main/kotlin/net/mullvad/mullvadvpn/test/mockapi/CreateAccountMockApiTest.kt b/android/test/mockapi/src/main/kotlin/net/mullvad/mullvadvpn/test/mockapi/CreateAccountMockApiTest.kt index b0ad767e311b..538a1110960a 100644 --- a/android/test/mockapi/src/main/kotlin/net/mullvad/mullvadvpn/test/mockapi/CreateAccountMockApiTest.kt +++ b/android/test/mockapi/src/main/kotlin/net/mullvad/mullvadvpn/test/mockapi/CreateAccountMockApiTest.kt @@ -1,6 +1,5 @@ package net.mullvad.mullvadvpn.test.mockapi -import net.mullvad.mullvadvpn.lib.common.util.groupWithSpaces import net.mullvad.mullvadvpn.test.common.extension.clickAgreeOnPrivacyDisclaimer import net.mullvad.mullvadvpn.test.common.extension.clickAllowOnNotificationPermissionPromptIfApiLevel33AndAbove import net.mullvad.mullvadvpn.test.common.extension.dismissChangelogDialogIfShown @@ -27,7 +26,8 @@ class CreateAccountMockApiTest : MockApiTest() { app.attemptCreateAccount() // Assert - app.ensureAccountCreated(createdAccountToken.groupWithSpaces()) + val expectedResult = "1234 1234 1234 1234" + app.ensureAccountCreated(expectedResult) } @Test From 16e3bfbb2d380c42efff94902f79b9eff6ecacc8 Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Fri, 2 Feb 2024 14:43:06 +0100 Subject: [PATCH 6/6] Update gradle verification file --- android/gradle/verification-metadata.xml | 1149 ++++++++++++++-------- 1 file changed, 761 insertions(+), 388 deletions(-) diff --git a/android/gradle/verification-metadata.xml b/android/gradle/verification-metadata.xml index bd2f25605964..a85d2f0f5902 100644 --- a/android/gradle/verification-metadata.xml +++ b/android/gradle/verification-metadata.xml @@ -82,11 +82,6 @@ - - - - - @@ -108,11 +103,6 @@ - - - - - @@ -129,17 +119,17 @@ - - - - - - - + + + + + + + @@ -158,14 +148,27 @@ - - - + + + + + + + + + + + + + + + + @@ -223,72 +226,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - + + - - - + + + + + + - - - + + + - - + + - - - + + + - + - - - + + + - - + + + + + + + - - - + + + + + + - - - + + + - - + + - - - + + + - + + + + + + + + + + + + + + + + + + + + + + @@ -299,28 +371,44 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - + + + + + + + + + + + + + + + + + @@ -328,28 +416,44 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - + + + + + + + + + + + + + + + + + @@ -357,99 +461,189 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + + + + + + + + + + + + - - + + + + + + + + + + + + - - - + + + - + - - - + + + - - - - + + - - - + + + - - + + - - - + + + - + + + + + + + + + - - - + + + - - + + - - - + + + - + + + + + + + + + @@ -457,144 +651,197 @@ - - - + + + - - + + - - - + + + - + - - - + + + + + + - - - + + + - - + + - - - + + + + + + + + - + + + + + + + + + - - - + + + - - - + + + - + - - - + + + - - - + + + - + - - - + + + - - + + - - - + + + - - - + + + - - + + + + + + + - - - + + + - + + + + + + + + + - - - + + + - - + + - - - + + + - + - - - + + + - - + + - - - + + + - + - - - + + + - - + + - - - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + @@ -602,51 +849,57 @@ - - - + + + + + + - - - + + + + + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - - + + + - - + + - - - + + + - - + + @@ -678,14 +931,6 @@ - - - - - - - - @@ -694,11 +939,6 @@ - - - - - @@ -715,14 +955,6 @@ - - - - - - - - @@ -798,14 +1030,6 @@ - - - - - - - - @@ -822,14 +1046,6 @@ - - - - - - - - @@ -1280,44 +1496,44 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -1548,19 +1764,34 @@ + + + + + + + + + + - - - + + + + + + + + @@ -1568,16 +1799,31 @@ + + + + + + + + + + + + + + + @@ -1588,16 +1834,31 @@ + + + + + + + + + + + + + + + @@ -1617,6 +1878,14 @@ + + + + + + + + @@ -1651,6 +1920,14 @@ + + + + + + + + @@ -1696,6 +1973,14 @@ + + + + + + + + @@ -1722,24 +2007,29 @@ + + + + + - - - + + + - - - + + + - - - + + + @@ -1747,24 +2037,29 @@ - - - + + + - - - + + + - - - + + + - - - + + + + + + + + @@ -1772,11 +2067,21 @@ + + + + + + + + + + @@ -2101,6 +2406,11 @@ + + + + + @@ -2124,6 +2434,14 @@ + + + + + + + + @@ -2250,6 +2568,11 @@ + + + + + @@ -2700,28 +3023,28 @@ - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + @@ -3777,11 +4100,6 @@ - - - - - @@ -3875,11 +4193,6 @@ - - - - - @@ -3917,16 +4230,22 @@ + + + + + + + + + + + - - - - - @@ -3952,16 +4271,16 @@ + + + + + - - - - - @@ -3992,6 +4311,11 @@ + + + + + @@ -4002,11 +4326,6 @@ - - - - - @@ -4032,6 +4351,11 @@ + + + + + @@ -4143,12 +4467,12 @@ - - - + + + - - + + @@ -4183,6 +4507,14 @@ + + + + + + + + @@ -4209,12 +4541,12 @@ - - - + + + - - + + @@ -4249,12 +4581,12 @@ - - - + + + - - + + @@ -4265,9 +4597,22 @@ - - - + + + + + + + + + + + + + + + + @@ -4320,6 +4665,19 @@ + + + + + + + + + + + + + @@ -4498,11 +4856,21 @@ + + + + + + + + + + @@ -4513,6 +4881,11 @@ + + + + +