diff options
| author | Albin <albin@mullvad.net> | 2024-08-19 11:27:39 +0200 |
|---|---|---|
| committer | Albin <albin@mullvad.net> | 2024-08-19 11:27:39 +0200 |
| commit | 58a811f70b0d9da7ad052ec98b25eff65ee4a1be (patch) | |
| tree | d3320e7b3f36b92c6da11bdd7bf43397871198e2 /android | |
| parent | ed5b060f39f8739673ca9470f1fea24abc729211 (diff) | |
| parent | b6f78500e1b6c358c8a21ffcaef9fd157f2c5731 (diff) | |
| download | mullvadvpn-58a811f70b0d9da7ad052ec98b25eff65ee4a1be.tar.xz mullvadvpn-58a811f70b0d9da7ad052ec98b25eff65ee4a1be.zip | |
Merge branch 'auto-connect-lockdown-mode-title-is-not-translated-droid-1257'
Diffstat (limited to 'android')
5 files changed, 20 insertions, 3 deletions
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 a9db7e0e62..51ba207165 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 @@ -21,6 +21,7 @@ import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.LargeTopAppBar +import androidx.compose.material3.LocalTextStyle import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MediumTopAppBar import androidx.compose.material3.Surface @@ -38,6 +39,7 @@ import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.pluralStringResource import androidx.compose.ui.res.stringResource +import androidx.compose.ui.text.style.LineBreak import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp @@ -276,7 +278,14 @@ fun MullvadLargeTopBar( scrollBehavior: TopAppBarScrollBehavior? = null ) { LargeTopAppBar( - title = { Text(text = title, maxLines = 2, overflow = TextOverflow.Ellipsis) }, + title = { + Text( + text = title, + maxLines = 2, + overflow = TextOverflow.Ellipsis, + style = LocalTextStyle.current.copy(lineBreak = LineBreak.Heading) + ) + }, navigationIcon = navigationIcon, scrollBehavior = scrollBehavior, colors = diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AutoConnectAndLockdownModeScreen.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AutoConnectAndLockdownModeScreen.kt index a372eab354..f5f24a635c 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AutoConnectAndLockdownModeScreen.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/screen/AutoConnectAndLockdownModeScreen.kt @@ -84,7 +84,7 @@ fun AutoConnectAndLockdownMode(navigator: DestinationsNavigator) { fun AutoConnectAndLockdownModeScreen(onBackClick: () -> Unit = {}) { val context = LocalContext.current ScaffoldWithLargeTopBarAndButton( - appBarTitle = stringResource(id = R.string.auto_connect_and_lockdown_mode_two_lines), + appBarTitle = stringResource(id = R.string.auto_connect_and_lockdown_mode), navigationIcon = { NavigateBackIconButton(onNavigateBack = onBackClick) }, buttonTitle = stringResource(id = R.string.go_to_vpn_settings), onButtonClick = { context.openVpnSettings() }, diff --git a/android/lib/resource/src/main/res/values/strings.xml b/android/lib/resource/src/main/res/values/strings.xml index c5b884b745..ef6b0bce7a 100644 --- a/android/lib/resource/src/main/res/values/strings.xml +++ b/android/lib/resource/src/main/res/values/strings.xml @@ -74,7 +74,6 @@ <string name="allow_lan_footer">Allows access to other devices on the same network for sharing, printing etc.</string> <string name="auto_connect">Auto-connect</string> <string name="auto_connect_and_lockdown_mode">Auto-connect & Lockdown mode</string> - <string name="auto_connect_and_lockdown_mode_two_lines">Auto-connect & \nLockdown mode</string> <string name="auto_connect_and_lockdown_mode_footer">Makes sure the device is always on the VPN tunnel.</string> <string name="go_to_vpn_settings">Go to VPN settings</string> <string name="vpn_settings_not_found">There is no VPN settings on your device</string> diff --git a/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt b/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt index 554eb6d421..51879c4a66 100644 --- a/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt +++ b/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/Theme.kt @@ -48,6 +48,12 @@ import net.mullvad.mullvadvpn.lib.theme.typeface.TypeScale private val MullvadTypography = Typography( headlineLarge = TextStyle(fontSize = TypeScale.TextHuge, fontWeight = FontWeight.Bold), + headlineMedium = + TextStyle( + fontWeight = FontWeight.Bold, + fontSize = TypeScale.TextHeadline, + lineHeight = TypeScale.HeadlineMediumLineHeight, + ), headlineSmall = TextStyle(fontSize = TypeScale.TextBig, fontWeight = FontWeight.Bold), bodySmall = TextStyle(fontSize = TypeScale.TextSmall), titleSmall = TextStyle(fontSize = TypeScale.TextMedium, fontWeight = FontWeight.SemiBold), diff --git a/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/typeface/TypeScale.kt b/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/typeface/TypeScale.kt index 524461c07e..4e5492a630 100644 --- a/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/typeface/TypeScale.kt +++ b/android/lib/theme/src/main/kotlin/net/mullvad/mullvadvpn/lib/theme/typeface/TypeScale.kt @@ -12,9 +12,12 @@ import androidx.compose.ui.unit.sp */ internal object TypeScale { val TextHuge = 30.sp + val TextHeadline = 28.sp val TextBig = 24.sp val TextMediumPlus = 18.sp val TextMedium = 16.sp val TextSmall = 13.sp val TitleLarge = 22.sp + + val HeadlineMediumLineHeight = 36.0.sp } |
