From 9a3b718428b2b2c80c5bef807e15b97fa7cea04e Mon Sep 17 00:00:00 2001 From: Jonatan Rhodin Date: Fri, 22 Sep 2023 13:58:47 +0200 Subject: [PATCH] Set default dialog radius to 11 and apply it to all dialogs --- .../mullvadvpn/compose/dialog/DnsDialog.kt | 26 ++++++++++++------- .../mullvadvpn/compose/dialog/MtuDialog.kt | 10 +++++-- .../net/mullvad/mullvadvpn/lib/theme/Theme.kt | 2 +- 3 files changed, 25 insertions(+), 13 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 7aae763574e5..06e2e8311c62 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 @@ -27,8 +27,8 @@ import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.DialogProperties import net.mullvad.mullvadvpn.R import net.mullvad.mullvadvpn.compose.textfield.DnsTextField +import net.mullvad.mullvadvpn.lib.theme.AppTheme import net.mullvad.mullvadvpn.lib.theme.MullvadBlue -import net.mullvad.mullvadvpn.lib.theme.MullvadDarkBlue import net.mullvad.mullvadvpn.lib.theme.MullvadRed import net.mullvad.mullvadvpn.lib.theme.MullvadWhite import net.mullvad.mullvadvpn.lib.theme.MullvadWhite20 @@ -39,14 +39,17 @@ import net.mullvad.mullvadvpn.viewmodel.StagedDns @Preview @Composable private fun PreviewDnsDialog() { - DnsDialog( - stagedDns = StagedDns.NewDns(CustomDnsItem.default(), StagedDns.ValidationResult.Success), - isAllowLanEnabled = true, - onIpAddressChanged = {}, - onAttemptToSave = {}, - onRemove = {}, - onDismiss = {} - ) + AppTheme { + DnsDialog( + stagedDns = + StagedDns.NewDns(CustomDnsItem.default(), StagedDns.ValidationResult.Success), + isAllowLanEnabled = true, + onIpAddressChanged = {}, + onAttemptToSave = {}, + onRemove = {}, + onDismiss = {} + ) + } } @Composable @@ -79,7 +82,10 @@ fun DnsDialog( Modifier // Related to the fix for https://issuetracker.google.com/issues/221643630 .fillMaxWidth(0.8f) - .background(color = MullvadDarkBlue) + .background( + color = MaterialTheme.colorScheme.background, + MaterialTheme.shapes.extraLarge + ) .padding(dialogPadding) ) { Text( 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 9af996c6849c..39f3302a993e 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 @@ -31,13 +31,16 @@ import net.mullvad.mullvadvpn.constant.MTU_MIN_VALUE import net.mullvad.mullvadvpn.lib.theme.AlphaDescription import net.mullvad.mullvadvpn.lib.theme.AlphaDisabled import net.mullvad.mullvadvpn.lib.theme.AlphaInactive +import net.mullvad.mullvadvpn.lib.theme.AppTheme import net.mullvad.mullvadvpn.lib.theme.Dimens import net.mullvad.mullvadvpn.util.isValidMtu @Preview @Composable private fun PreviewMtuDialog() { - MtuDialog(mtuInitial = 1234, onSave = {}, onRestoreDefaultValue = {}, onDismiss = {}) + AppTheme { + MtuDialog(mtuInitial = 1234, onSave = {}, onRestoreDefaultValue = {}, onDismiss = {}) + } } @Composable @@ -65,7 +68,10 @@ fun MtuDialog( Modifier // Related to the fix for https://issuetracker.google.com/issues/221643630 .fillMaxWidth(0.8f) - .background(color = MaterialTheme.colorScheme.background) + .background( + color = MaterialTheme.colorScheme.background, + shape = MaterialTheme.shapes.extraLarge + ) .padding(dialogPadding) ) { Text( 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 132f2f9dc397..ab3a2f61c0d0 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 @@ -82,7 +82,7 @@ val Shapes = small = RoundedCornerShape(4.dp), medium = RoundedCornerShape(4.dp), large = RoundedCornerShape(0.dp), - extraLarge = RoundedCornerShape(4.dp) + extraLarge = RoundedCornerShape(11.dp) ) val Dimens: Dimensions