define the style of date and time pickers

This commit is contained in:
tibbi 2022-04-08 21:28:07 +02:00
parent 266b95747d
commit 2ef6d8a03a
2 changed files with 15 additions and 1 deletions

View file

@ -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()) {

View file

@ -113,6 +113,16 @@
<item name="android:textColor">@color/theme_dark_text_color</item>
</style>
<!-- used at Date and Time pickers -->
<style name="MyDialogMaterialTheme" parent="@style/Theme.AppCompat.Light.Dialog">
<item name="colorAccent">@color/you_primary_color</item>
<item name="android:colorAccent">@color/you_primary_color</item>
<item name="android:windowBackground">@drawable/dialog_you_background</item>
<item name="android:textColor">@color/you_primary_color</item>
<item name="android:textColorSecondary">@color/you_neutral_text_color</item>
<item name="android:textColorPrimary">@color/you_neutral_text_color</item>
</style>
<style name="Theme.Transparent" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowBackground">@android:color/transparent</item>