From 2ef6d8a03a14e98785845d55bb86df18289164bb Mon Sep 17 00:00:00 2001 From: tibbi Date: Fri, 8 Apr 2022 21:28:07 +0200 Subject: [PATCH] define the style of date and time pickers --- .../commons/extensions/Context-styling.kt | 6 +++++- commons/src/main/res/values/styles.xml | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-styling.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-styling.kt index cae0f27e8..d62bc0c3a 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-styling.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Context-styling.kt @@ -77,7 +77,11 @@ fun Context.isWhiteTheme() = baseConfig.textColor == DARK_GREY && baseConfig.pri fun Context.isUsingSystemDarkTheme() = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_YES != 0 -fun Context.getDialogTheme() = if (baseConfig.backgroundColor.getContrastColor() == Color.WHITE) R.style.MyDialogTheme_Dark else R.style.MyDialogTheme +fun Context.getDialogTheme() = when { + baseConfig.isUsingSystemTheme -> R.style.MyDialogMaterialTheme + baseConfig.backgroundColor.getContrastColor() == Color.WHITE -> R.style.MyDialogTheme_Dark + else -> R.style.MyDialogTheme +} fun Context.getSharedTheme(callback: (sharedTheme: SharedTheme?) -> Unit) { if (!isThankYouInstalled()) { diff --git a/commons/src/main/res/values/styles.xml b/commons/src/main/res/values/styles.xml index e99e1f00c..70d1865c3 100644 --- a/commons/src/main/res/values/styles.xml +++ b/commons/src/main/res/values/styles.xml @@ -113,6 +113,16 @@ @color/theme_dark_text_color + + +