Skip to content

Commit

Permalink
Merge branch 'compose-1-6-0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Pururun committed Feb 6, 2024
2 parents f42dcb3 + 16e3bfb commit 48c023e
Show file tree
Hide file tree
Showing 10 changed files with 780 additions and 403 deletions.
3 changes: 2 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
android:launchMode="singleInstance"
android:configChanges="orientation|screenSize|screenLayout"
android:screenOrientation="fullUser"
android:windowSoftInputMode="adjustResize">
android:windowSoftInputMode="adjustResize"
tools:ignore="DiscouragedApi">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,7 +32,6 @@ private fun PreviewMullvadFilterChip() {
}
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun MullvadFilterChip(text: String, onRemoveClick: () -> Unit) {
FilterChip(
Expand All @@ -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 = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions android/buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ object Versions {
}

object Compose {
const val destinations = "1.9.55"
const val base = "1.5.4"
const val destinations = "1.10.0"
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 {
Expand Down
1 change: 1 addition & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
1,149 changes: 761 additions & 388 deletions android/gradle/verification-metadata.xml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion android/test/mockapi/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ configure<org.owasp.dependencycheck.gradle.extension.DependencyCheckExtension> {

dependencies {
implementation(project(Projects.testCommon))
implementation(project(Dependencies.Mullvad.commonLib))
implementation(project(Dependencies.Mullvad.endpointLib))

implementation(Dependencies.AndroidX.testCore)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
}
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -27,7 +26,8 @@ class CreateAccountMockApiTest : MockApiTest() {
app.attemptCreateAccount()

// Assert
app.ensureAccountCreated(createdAccountToken.groupWithSpaces())
val expectedResult = "1234 1234 1234 1234"
app.ensureAccountCreated(expectedResult)
}

@Test
Expand Down

0 comments on commit 48c023e

Please sign in to comment.