diff options
| author | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-08-14 12:05:03 +0200 |
|---|---|---|
| committer | Jonatan Rhodin <jonatan.rhodin@mullvad.net> | 2025-08-15 10:31:11 +0200 |
| commit | 4264afea4965653ed1e18da9deab4e4fdb025f1f (patch) | |
| tree | 62e61123671a6407bc10b0dc41e2beb6361b0626 /android | |
| parent | 02236af9f2f9e6c615c4d833f7f95de73bc8fbb0 (diff) | |
| download | mullvadvpn-4264afea4965653ed1e18da9deab4e4fdb025f1f.tar.xz mullvadvpn-4264afea4965653ed1e18da9deab4e4fdb025f1f.zip | |
Fix lint issues
Diffstat (limited to 'android')
3 files changed, 7 insertions, 5 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, ) diff --git a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/NotificationData.kt b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/NotificationData.kt index ed3da5b1b1..3af3b8b4ae 100644 --- a/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/NotificationData.kt +++ b/android/lib/ui/component/src/main/kotlin/net/mullvad/mullvadvpn/lib/ui/component/NotificationData.kt @@ -6,7 +6,7 @@ import androidx.compose.material.icons.filled.Clear import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.graphics.vector.ImageVector -import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.platform.LocalResources import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.LinkAnnotation @@ -101,7 +101,7 @@ fun InAppNotification.toNotificationData( is InAppNotification.AccountExpiry -> NotificationData( title = stringResource(id = R.string.account_credit_expires_soon), - message = LocalContext.current.resources.getExpiryQuantityString(expiry), + message = LocalResources.current.getExpiryQuantityString(expiry), statusLevel = statusLevel, action = if (isPlayBuild) null |
