From 730f6bca35b8e1e454854c1a83ef16362f84dce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20G=C3=B6ransson?= Date: Fri, 22 Dec 2023 10:37:12 +0100 Subject: [PATCH] Align dialog titles --- .../mullvadvpn/compose/dialog/DnsDialog.kt | 2 -- .../mullvadvpn/compose/dialog/InfoDialog.kt | 2 +- .../mullvadvpn/compose/dialog/MtuDialog.kt | 1 - .../compose/dialog/RedeemVoucherDialog.kt | 1 - .../dialog/RemoveDeviceConfirmationDialog.kt | 25 +++++++------------ .../dialog/WireguardCustomPortDialog.kt | 1 - 6 files changed, 10 insertions(+), 22 deletions(-) diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt index e31e41be805b..a5b23eb253d8 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/DnsDialog.kt @@ -14,7 +14,6 @@ import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.stringResource -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import com.ramcosta.composedestinations.annotation.Destination import com.ramcosta.composedestinations.result.ResultBackNavigator @@ -138,7 +137,6 @@ fun DnsDialog( stringResource(R.string.update_dns_server_dialog_title) }, color = Color.White, - style = MaterialTheme.typography.headlineSmall.copy(fontWeight = FontWeight.Normal) ) }, text = { diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/InfoDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/InfoDialog.kt index d032a9fa8e08..0314cd955a23 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/InfoDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/InfoDialog.kt @@ -45,7 +45,7 @@ private fun PreviewChangelogDialogWithTwoLongItems() { fun InfoDialog(message: String, additionalInfo: String? = null, onDismiss: () -> Unit) { AlertDialog( onDismissRequest = { onDismiss() }, - title = { + icon = { Icon( modifier = Modifier.fillMaxWidth().height(Dimens.dialogIconHeight), painter = painterResource(id = R.drawable.icon_info), diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt index d0d8da8b5725..91fb0287c915 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/MtuDialog.kt @@ -74,7 +74,6 @@ fun MtuDialog( Text( text = stringResource(id = R.string.wireguard_mtu), color = MaterialTheme.colorScheme.onBackground, - style = MaterialTheme.typography.headlineSmall ) }, text = { diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RedeemVoucherDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RedeemVoucherDialog.kt index 15d8e9f3c763..339de8f3a9a2 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RedeemVoucherDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RedeemVoucherDialog.kt @@ -122,7 +122,6 @@ fun RedeemVoucherDialog( if (uiState.voucherViewModelState !is VoucherDialogState.Success) Text( text = stringResource(id = R.string.enter_voucher_code), - style = MaterialTheme.typography.titleMedium ) }, confirmButton = { diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RemoveDeviceConfirmationDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RemoveDeviceConfirmationDialog.kt index 859f28fea339..9c48c0a1e8dd 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RemoveDeviceConfirmationDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/RemoveDeviceConfirmationDialog.kt @@ -1,18 +1,15 @@ package net.mullvad.mullvadvpn.compose.dialog -import androidx.compose.foundation.Image -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width import androidx.compose.material3.AlertDialog +import androidx.compose.material3.Icon import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable -import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.focusRequester +import androidx.compose.ui.graphics.Color import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.stringResource import androidx.compose.ui.tooling.preview.Preview @@ -46,17 +43,13 @@ private fun PreviewRemoveDeviceConfirmationDialog() { fun RemoveDeviceConfirmationDialog(navigator: ResultBackNavigator, device: Device) { AlertDialog( onDismissRequest = { navigator.navigateBack() }, - title = { - Column( - horizontalAlignment = Alignment.CenterHorizontally, - modifier = Modifier.padding(top = 0.dp).fillMaxWidth() - ) { - Image( - painter = painterResource(id = R.drawable.icon_alert), - contentDescription = "Remove", - modifier = Modifier.width(50.dp).height(50.dp) - ) - } + icon = { + Icon( + painter = painterResource(id = R.drawable.icon_alert), + contentDescription = "Remove", + modifier = Modifier.width(50.dp).height(50.dp), + tint = Color.Unspecified + ) }, text = { val htmlFormattedDialogText = diff --git a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/WireguardCustomPortDialog.kt b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/WireguardCustomPortDialog.kt index 9b2f495f4d4f..44901ce65649 100644 --- a/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/WireguardCustomPortDialog.kt +++ b/android/app/src/main/kotlin/net/mullvad/mullvadvpn/compose/dialog/WireguardCustomPortDialog.kt @@ -80,7 +80,6 @@ fun WireguardCustomPortDialog( title = { Text( text = stringResource(id = R.string.custom_port_dialog_title), - style = MaterialTheme.typography.headlineSmall ) }, confirmButton = {