diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/activities/CustomizationActivity.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/activities/CustomizationActivity.kt index ce71ea476..1da2c4438 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/activities/CustomizationActivity.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/activities/CustomizationActivity.kt @@ -101,7 +101,7 @@ class CustomizationActivity : BaseSimpleActivity() { private fun setupColorsPickers() { customization_text_color.setBackgroundColor(curTextColor) customization_primary_color.setBackgroundColor(curPrimaryColor) - customization_background_color.setBackgroundWithStroke(curBackgroundColor) + customization_background_color.setBackgroundWithStroke(curBackgroundColor, curBackgroundColor) } private fun hasColorChanged(old: Int, new: Int) = Math.abs(old - new) > 1 diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/ColorPickerDialog.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/ColorPickerDialog.kt index 5b54627bc..e31b76f56 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/ColorPickerDialog.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/dialogs/ColorPickerDialog.kt @@ -29,6 +29,7 @@ class ColorPickerDialog(val context: Context, color: Int, val callback: (color: init { Color.colorToHSV(color, currentColorHsv) + val backgroundColor = BaseConfig.newInstance(context).backgroundColor val view = LayoutInflater.from(context).inflate(R.layout.dialog_colorpicker, null).apply { viewHue = color_picker_hue viewSatVal = color_picker_square @@ -39,8 +40,8 @@ class ColorPickerDialog(val context: Context, color: Int, val callback: (color: viewContainer = color_picker_holder viewSatVal.setHue(getHue()) - viewNewColor.setBackgroundWithStroke(getColor()) - color_picker_old_color.setBackgroundWithStroke(color) + viewNewColor.setBackgroundWithStroke(getColor(), backgroundColor) + color_picker_old_color.setBackgroundWithStroke(color, backgroundColor) } viewHue.setOnTouchListener(OnTouchListener { v, event -> @@ -55,7 +56,7 @@ class ColorPickerDialog(val context: Context, color: Int, val callback: (color: currentColorHsv[0] = hue viewSatVal.setHue(getHue()) moveHuePicker() - viewNewColor.setBackgroundWithStroke(getColor()) + viewNewColor.setBackgroundWithStroke(getColor(), backgroundColor) return@OnTouchListener true } false @@ -79,7 +80,7 @@ class ColorPickerDialog(val context: Context, color: Int, val callback: (color: currentColorHsv[2] = 1f - 1f / viewSatVal.measuredHeight * y moveColorPicker() - viewNewColor.setBackgroundWithStroke(getColor()) + viewNewColor.setBackgroundWithStroke(getColor(), backgroundColor) return@OnTouchListener true } false diff --git a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/ImageView.kt b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/ImageView.kt index fa4f6ae43..ed6fb1a88 100644 --- a/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/ImageView.kt +++ b/commons/src/main/kotlin/com/simplemobiletools/commons/extensions/ImageView.kt @@ -3,8 +3,8 @@ package com.simplemobiletools.commons.extensions import android.graphics.drawable.GradientDrawable import android.widget.ImageView -fun ImageView.setBackgroundWithStroke(backgroundColor: Int) { - val strokeColor = backgroundColor.getContrastColor() +fun ImageView.setBackgroundWithStroke(backgroundColor: Int, realStrokeColor: Int) { + val strokeColor = realStrokeColor.getContrastColor() GradientDrawable().apply { shape = GradientDrawable.RECTANGLE setColor(backgroundColor)