applying the accent color on a couple places

This commit is contained in:
tibbi 2021-02-09 14:18:26 +01:00
parent bfeb3930ee
commit e4fb654fd3
4 changed files with 14 additions and 5 deletions

View file

@ -6,7 +6,7 @@ buildscript {
propMinSdkVersion = 21
propTargetSdkVersion = propCompileSdkVersion
propVersionCode = 1
propVersionName = '5.33.20'
propVersionName = '5.33.22'
kotlin_version = '1.4.21'
}

View file

@ -455,7 +455,14 @@ class CustomizationActivity : BaseSimpleActivity() {
}
private fun pickAccentColor() {
ColorPickerDialog(this, curAccentColor) { wasPositivePressed, color ->
if (wasPositivePressed) {
if (hasColorChanged(curAccentColor, color)) {
curAccentColor = color
colorChanged()
}
}
}
}
private fun pickNavigationBarColor() {

View file

@ -65,7 +65,7 @@ fun Context.updateTextColors(viewGroup: ViewGroup, tmpTextColor: Int = 0, tmpAcc
val accentColor = if (tmpAccentColor == 0) {
when {
isBlackAndWhiteTheme() -> Color.WHITE
isWhiteTheme() -> DARK_GREY
isWhiteTheme() -> baseConfig.accentColor
else -> baseConfig.primaryColor
}
} else {
@ -105,13 +105,13 @@ fun Context.isWhiteTheme() = baseConfig.textColor == DARK_GREY && baseConfig.pri
fun Context.getAdjustedPrimaryColor() = when {
isBlackAndWhiteTheme() -> Color.WHITE
isWhiteTheme() -> DARK_GREY
isWhiteTheme() -> baseConfig.accentColor
else -> baseConfig.primaryColor
}
fun Context.getFABIconColor() = when {
isBlackAndWhiteTheme() -> Color.BLACK
isWhiteTheme() -> Color.WHITE
isWhiteTheme() -> baseConfig.accentColor
else -> baseConfig.primaryColor.getContrastColor()
}

View file

@ -23,6 +23,7 @@ class SharedThemeReceiver : BroadcastReceiver() {
textColor = it.textColor
backgroundColor = it.backgroundColor
primaryColor = it.primaryColor
accentColor = it.accentColor
appIconColor = it.appIconColor
navigationBarColor = it.navigationBarColor
checkAppIconColorChanged(oldColor, appIconColor, context)
@ -36,6 +37,7 @@ class SharedThemeReceiver : BroadcastReceiver() {
textColor = it.textColor
backgroundColor = it.backgroundColor
primaryColor = it.primaryColor
accentColor = it.accentColor
appIconColor = it.appIconColor
navigationBarColor = it.navigationBarColor
checkAppIconColorChanged(oldColor, appIconColor, context)