improving the way default widget color is set

This commit is contained in:
tibbi 2019-02-14 21:13:33 +01:00
parent 851493865b
commit 1aade9c055
3 changed files with 3 additions and 13 deletions

View File

@ -52,7 +52,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.simplemobiletools:commons:5.7.8' implementation 'com.simplemobiletools:commons:5.7.9'
implementation 'joda-time:joda-time:2.10.1' implementation 'joda-time:joda-time:2.10.1'
implementation 'androidx.multidex:multidex:2.0.1' implementation 'androidx.multidex:multidex:2.0.1'

View File

@ -68,12 +68,7 @@ class WidgetListConfigureActivity : SimpleActivity() {
updateColors() updateColors()
mBgColor = config.widgetBgColor mBgColor = config.widgetBgColor
if (mBgColor == 1) { mBgAlpha = Color.alpha(mBgColor) / 255.toFloat()
mBgColor = Color.BLACK
mBgAlpha = .2f
} else {
mBgAlpha = Color.alpha(mBgColor) / 255.toFloat()
}
mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor)) mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor))
config_bg_seekbar.setOnSeekBarChangeListener(bgSeekbarChangeListener) config_bg_seekbar.setOnSeekBarChangeListener(bgSeekbarChangeListener)

View File

@ -77,12 +77,7 @@ class WidgetMonthlyConfigureActivity : SimpleActivity(), MonthlyCalendar {
updateColors() updateColors()
mBgColor = config.widgetBgColor mBgColor = config.widgetBgColor
if (mBgColor == 1) { mBgAlpha = Color.alpha(mBgColor) / 255.toFloat()
mBgColor = Color.BLACK
mBgAlpha = .2f
} else {
mBgAlpha = Color.alpha(mBgColor) / 255.toFloat()
}
mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor)) mBgColorWithoutTransparency = Color.rgb(Color.red(mBgColor), Color.green(mBgColor), Color.blue(mBgColor))
config_bg_seekbar.setOnSeekBarChangeListener(bgSeekbarChangeListener) config_bg_seekbar.setOnSeekBarChangeListener(bgSeekbarChangeListener)