mirror of
https://github.com/SimpleMobileTools/Simple-Flashlight.git
synced 2025-01-07 14:45:48 +01:00
do not set the widget to transparent by default
This commit is contained in:
parent
874542e1af
commit
591697e4ec
@ -10,6 +10,7 @@ import com.simplemobiletools.commons.dialogs.ColorPickerDialog
|
||||
import com.simplemobiletools.commons.extensions.adjustAlpha
|
||||
import com.simplemobiletools.commons.extensions.applyColorFilter
|
||||
import com.simplemobiletools.commons.extensions.setFillWithStroke
|
||||
import com.simplemobiletools.commons.helpers.DEFAULT_WIDGET_BG_COLOR
|
||||
import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS
|
||||
import com.simplemobiletools.flashlight.R
|
||||
import com.simplemobiletools.flashlight.extensions.config
|
||||
@ -42,11 +43,10 @@ class WidgetConfigureActivity : SimpleActivity() {
|
||||
|
||||
private fun initVariables() {
|
||||
mWidgetColor = config.widgetBgColor
|
||||
if (mWidgetColor == 1) {
|
||||
mWidgetColor = resources.getColor(R.color.color_primary)
|
||||
mWidgetAlpha = 1f
|
||||
mWidgetAlpha = if (mWidgetColor == DEFAULT_WIDGET_BG_COLOR) {
|
||||
1f
|
||||
} else {
|
||||
mWidgetAlpha = Color.alpha(mWidgetColor) / 255.toFloat()
|
||||
Color.alpha(mWidgetColor) / 255.toFloat()
|
||||
}
|
||||
|
||||
mWidgetColorWithoutTransparency = Color.rgb(Color.red(mWidgetColor), Color.green(mWidgetColor), Color.blue(mWidgetColor))
|
||||
|
Loading…
Reference in New Issue
Block a user