diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity-themes.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity-themes.kt index cb1b10800..f12f52bcc 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity-themes.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/Activity-themes.kt @@ -1,12 +1,22 @@ package com.simplemobiletools.commons.extensions import android.app.Activity +import android.graphics.Color import com.simplemobiletools.commons.R +import com.simplemobiletools.commons.helpers.DARK_GREY fun Activity.getThemeId(color: Int = baseConfig.primaryColor, showTransparentTop: Boolean = false) = when { baseConfig.isUsingSystemTheme -> if (isUsingSystemDarkTheme()) R.style.AppTheme_Base_System else R.style.AppTheme_Base_System_Light - isBlackAndWhiteTheme() -> if (showTransparentTop) R.style.AppTheme_BlackAndWhite_NoActionBar else R.style.AppTheme_BlackAndWhite - isWhiteTheme() -> if (showTransparentTop) R.style.AppTheme_White_NoActionBar else R.style.AppTheme_White + isBlackAndWhiteTheme() -> when { + showTransparentTop -> R.style.AppTheme_BlackAndWhite_NoActionBar + baseConfig.accentColor.getContrastColor() == DARK_GREY -> R.style.AppTheme_BlackAndWhite_DarkTextColor + else -> R.style.AppTheme_BlackAndWhite + } + isWhiteTheme() -> when { + showTransparentTop -> R.style.AppTheme_White_NoActionBar + baseConfig.accentColor.getContrastColor() == Color.WHITE -> R.style.AppTheme_White_LightTextColor + else -> R.style.AppTheme_White + } showTransparentTop -> { when (color) { -12846 -> R.style.AppTheme_Red_100_core diff --git a/commons/src/main/res/values/styles.xml b/commons/src/main/res/values/styles.xml index 02330c868..a951df7ed 100644 --- a/commons/src/main/res/values/styles.xml +++ b/commons/src/main/res/values/styles.xml @@ -242,6 +242,10 @@ @style/BottomSheetDialogTheme + + @@ -271,6 +275,10 @@ @style/BottomSheetDialogTheme + +