From 735d85291e801cf76fa3c7667d55a68a081f8828 Mon Sep 17 00:00:00 2001 From: Lucas Dupin Date: Tue, 24 Oct 2017 18:15:24 -0700 Subject: [PATCH] Customizable corner radius for dialogs Moved default corner radius into an xml config to make it overridable. Test: make # launch usb debugging, wifi, and other system dialogs Bug: 64122537 Change-Id: If9c102e37a6f998da2d97a8ad5aee2de4d25ae9d --- api/current.txt | 1 + api/system-current.txt | 1 + api/test-current.txt | 1 + .../res/drawable/dialog_background_material.xml | 2 +- core/res/res/values/attrs.xml | 2 + core/res/res/values/config.xml | 3 + core/res/res/values/dimens.xml | 3 + core/res/res/values/public.xml | 1 + core/res/res/values/themes_device_defaults.xml | 172 ++++++++++++++++++++- core/res/res/values/themes_material.xml | 2 + 10 files changed, 185 insertions(+), 3 deletions(-) diff --git a/api/current.txt b/api/current.txt index 5b986bccf017..631c62c16108 100644 --- a/api/current.txt +++ b/api/current.txt @@ -484,6 +484,7 @@ package android { field public static final int detailSocialSummary = 16843428; // 0x10102a4 field public static final int detailsElementBackground = 16843598; // 0x101034e field public static final int dial = 16843010; // 0x1010102 + field public static final int dialogCornerRadius = 16844145; // 0x1010571 field public static final int dialogIcon = 16843252; // 0x10101f4 field public static final int dialogLayout = 16843255; // 0x10101f7 field public static final int dialogMessage = 16843251; // 0x10101f3 diff --git a/api/system-current.txt b/api/system-current.txt index df8e0346e531..199e2a7de188 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -616,6 +616,7 @@ package android { field public static final int detailSocialSummary = 16843428; // 0x10102a4 field public static final int detailsElementBackground = 16843598; // 0x101034e field public static final int dial = 16843010; // 0x1010102 + field public static final int dialogCornerRadius = 16844145; // 0x1010571 field public static final int dialogIcon = 16843252; // 0x10101f4 field public static final int dialogLayout = 16843255; // 0x10101f7 field public static final int dialogMessage = 16843251; // 0x10101f3 diff --git a/api/test-current.txt b/api/test-current.txt index 6f251e965173..5bae5bda876c 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -484,6 +484,7 @@ package android { field public static final int detailSocialSummary = 16843428; // 0x10102a4 field public static final int detailsElementBackground = 16843598; // 0x101034e field public static final int dial = 16843010; // 0x1010102 + field public static final int dialogCornerRadius = 16844145; // 0x1010571 field public static final int dialogIcon = 16843252; // 0x10101f4 field public static final int dialogLayout = 16843255; // 0x10101f7 field public static final int dialogMessage = 16843251; // 0x10101f3 diff --git a/core/res/res/drawable/dialog_background_material.xml b/core/res/res/drawable/dialog_background_material.xml index 2f8d1fa13eed..e017d3c861a7 100644 --- a/core/res/res/drawable/dialog_background_material.xml +++ b/core/res/res/drawable/dialog_background_material.xml @@ -17,7 +17,7 @@ - + diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml index db4dcd2ec1a9..5e8e80944d44 100644 --- a/core/res/res/values/attrs.xml +++ b/core/res/res/values/attrs.xml @@ -984,6 +984,8 @@ + + diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 4a8bc13f7669..8a84cffe757f 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -3147,4 +3147,7 @@ com.android.systemui/com.android.systemui.media.MediaProjectionPermissionActivity + + + 2dp diff --git a/core/res/res/values/dimens.xml b/core/res/res/values/dimens.xml index dc75ba6077e7..947fcf127b9c 100644 --- a/core/res/res/values/dimens.xml +++ b/core/res/res/values/dimens.xml @@ -624,4 +624,7 @@ 24dp 16dp + + + 2dp diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml index 083bf90210a5..fdd56c410ed2 100644 --- a/core/res/res/values/public.xml +++ b/core/res/res/values/public.xml @@ -2847,6 +2847,7 @@ + diff --git a/core/res/res/values/themes_device_defaults.xml b/core/res/res/values/themes_device_defaults.xml index bf0c90660392..68d552367423 100644 --- a/core/res/res/values/themes_device_defaults.xml +++ b/core/res/res/values/themes_device_defaults.xml @@ -88,6 +88,7 @@ easier. @style/Theme.DeviceDefault.Dialog + @dimen/config_dialogCornerRadius @style/Theme.DeviceDefault.Dialog.Alert @@ -214,6 +215,10 @@ easier. @color/primary_device_default_dark @color/primary_dark_device_default_dark @color/accent_device_default_dark + + + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert @@ -280,6 +305,10 @@ easier. @color/primary_device_default_dark @color/primary_dark_device_default_dark @color/accent_device_default_dark + + + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert @@ -314,6 +347,10 @@ easier. @color/primary_device_default_dark @color/primary_dark_device_default_dark @color/accent_device_default_dark + + + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert @@ -332,6 +373,10 @@ easier. @color/primary_device_default_dark @color/primary_dark_device_default_dark @color/accent_device_default_dark + + + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert @@ -441,6 +518,7 @@ easier. @style/Theme.DeviceDefault.Light.Dialog + @dimen/config_dialogCornerRadius @style/Theme.DeviceDefault.Light.Dialog.Alert @@ -562,6 +640,10 @@ easier. @color/primary_device_default_dark @color/primary_dark_device_default_dark @color/accent_device_default_light + + + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert @@ -570,6 +652,10 @@ easier. @color/primary_device_default_light @color/primary_dark_device_default_light @color/accent_device_default_light + + + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert + @style/DeviceDefault.Light.ButtonBar.AlertDialog @style/Widget.DeviceDefault.Light.Button.Borderless.Small @@ -628,6 +730,10 @@ easier. @color/primary_device_default_light @color/primary_dark_device_default_light @color/accent_device_default_light + + + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert @@ -636,6 +742,10 @@ easier. @color/primary_device_default_light @color/primary_dark_device_default_light @color/accent_device_default_light + + + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert @@ -680,6 +794,10 @@ easier. @color/primary_device_default_light @color/primary_dark_device_default_light @color/accent_device_default_light + + + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert @@ -698,6 +820,10 @@ easier. @color/primary_device_default_light @color/primary_dark_device_default_light @color/accent_device_default_light + + + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert @@ -750,6 +892,10 @@ easier. #1f000000 @android:color/white true + + + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Light.Dialog.Alert @@ -778,6 +926,10 @@ easier. @color/primary_dark_device_default_settings @color/secondary_device_default_settings @color/accent_device_default_dark + + + @dimen/config_dialogCornerRadius + @style/Theme.DeviceDefault.Dialog.Alert -