diff options
Diffstat (limited to 'android/app')
2 files changed, 5 insertions, 3 deletions
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, ) |
