diff options
| author | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-08-15 11:29:13 +0200 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-08-15 11:29:13 +0200 |
| commit | 64eb7efdca5862921d547dd8894d9447a7790baf (patch) | |
| tree | 6b2d45848a0ac7f5fedc263bf0570c079c3adc78 /android/app | |
| parent | 5eb54c409647ff43b807617df0486d5a70603f51 (diff) | |
| parent | 3ad42193545fc032a6f29509ef3dccefc0466fd2 (diff) | |
| download | mullvadvpn-64eb7efdca5862921d547dd8894d9447a7790baf.tar.xz mullvadvpn-64eb7efdca5862921d547dd8894d9447a7790baf.zip | |
Merge branch 'update-dependencies-droid-2133'
Diffstat (limited to 'android/app')
4 files changed, 12 insertions, 11 deletions
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/Actions.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/Actions.kt index c87672108f..2d2a2b392f 100644 --- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/Actions.kt +++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/Actions.kt @@ -1,16 +1,9 @@ package net.mullvad.mullvadvpn -import androidx.compose.ui.test.ExperimentalTestApi import androidx.compose.ui.test.SemanticsNodeInteraction -import androidx.compose.ui.test.invokeGlobalAssertions import androidx.compose.ui.test.longClick import androidx.compose.ui.test.performTouchInput fun SemanticsNodeInteraction.performLongClick(): SemanticsNodeInteraction { - @OptIn(ExperimentalTestApi::class) - return this.invokeGlobalAssertions().performLongClickImpl() -} - -private fun SemanticsNodeInteraction.performLongClickImpl(): SemanticsNodeInteraction { - return performTouchInput { longClick() } + return this.performTouchInput { longClick() } } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/MullvadApplication.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/MullvadApplication.kt index 458ab784cd..43686b723b 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/MullvadApplication.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/MullvadApplication.kt @@ -1,6 +1,8 @@ package net.mullvad.mullvadvpn import android.app.Application +import androidx.compose.runtime.Composer +import androidx.compose.runtime.ExperimentalComposeRuntimeApi import co.touchlab.kermit.Logger import co.touchlab.kermit.Severity import kotlinx.coroutines.CoroutineScope @@ -20,6 +22,7 @@ import org.koin.core.context.startKoin private const val LOG_TAG = "mullvad" +@OptIn(ExperimentalComposeRuntimeApi::class) class MullvadApplication : Application() { override fun onCreate() { super.onCreate() @@ -27,6 +30,9 @@ class MullvadApplication : Application() { if (!BuildConfig.DEBUG) { Logger.setMinSeverity(Severity.Info) } + // Improve compose stack traces + // Comes with a performance penalty, so only enable in debug builds + Composer.setDiagnosticStackTraceEnabled(BuildConfig.DEBUG) startKoin { androidContext(this@MullvadApplication) } loadKoinModules(listOf(appModule)) with(getKoin()) { diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/ReadOnlyComposables.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/ReadOnlyComposables.kt index 8fe7d44c75..e3a555b1d9 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/ReadOnlyComposables.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/component/ReadOnlyComposables.kt @@ -3,10 +3,10 @@ package net.mullvad.mullvadvpn.compose.component import androidx.annotation.StringRes import androidx.compose.runtime.Composable import androidx.compose.runtime.ReadOnlyComposable -import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalResources @Composable @ReadOnlyComposable fun textResource(@StringRes id: Int, vararg formatArgs: Any): String { - return LocalContext.current.resources.getString(id, *formatArgs) + return LocalResources.current.getString(id, *formatArgs) } diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/NegativeConfirmationDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/NegativeConfirmationDialog.kt index 5337f9a213..bf8b5913dd 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/NegativeConfirmationDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/NegativeConfirmationDialog.kt @@ -12,6 +12,7 @@ import androidx.compose.material3.LocalTextStyle import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester @@ -115,8 +116,9 @@ fun NegativeConfirmationDialog( } }, dismissButton = { + val focusRequester = remember { FocusRequester() } PrimaryButton( - modifier = Modifier.focusRequester(FocusRequester()), + modifier = Modifier.focusRequester(focusRequester), onClick = onBack, text = cancelText, ) |
