File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
app/src/main/kotlin/com/simplemobiletools/flashlight/activities Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import com.simplemobiletools.commons.dialogs.ColorPickerDialog
1010import com.simplemobiletools.commons.extensions.adjustAlpha
1111import com.simplemobiletools.commons.extensions.applyColorFilter
1212import com.simplemobiletools.commons.extensions.setFillWithStroke
13+ import com.simplemobiletools.commons.helpers.DEFAULT_WIDGET_BG_COLOR
1314import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS
1415import com.simplemobiletools.flashlight.R
1516import com.simplemobiletools.flashlight.extensions.config
@@ -42,11 +43,10 @@ class WidgetConfigureActivity : SimpleActivity() {
4243
4344 private fun initVariables () {
4445 mWidgetColor = config.widgetBgColor
45- if (mWidgetColor == 1 ) {
46- mWidgetColor = resources.getColor(R .color.color_primary)
47- mWidgetAlpha = 1f
46+ mWidgetAlpha = if (mWidgetColor == DEFAULT_WIDGET_BG_COLOR ) {
47+ 1f
4848 } else {
49- mWidgetAlpha = Color .alpha(mWidgetColor) / 255 .toFloat()
49+ Color .alpha(mWidgetColor) / 255 .toFloat()
5050 }
5151
5252 mWidgetColorWithoutTransparency = Color .rgb(Color .red(mWidgetColor), Color .green(mWidgetColor), Color .blue(mWidgetColor))
You can’t perform that action at this time.
0 commit comments