take new color picker values into consideration only if OK was pressed

This commit is contained in:
tibbi 2018-09-18 21:36:44 +02:00
parent 7b8b19cdce
commit 07894ef11b

View File

@ -7,7 +7,6 @@ import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.widget.SeekBar import android.widget.SeekBar
import com.simplemobiletools.clock.R import com.simplemobiletools.clock.R
import com.simplemobiletools.clock.R.id.*
import com.simplemobiletools.clock.extensions.config import com.simplemobiletools.clock.extensions.config
import com.simplemobiletools.clock.extensions.getFormattedDate import com.simplemobiletools.clock.extensions.getFormattedDate
import com.simplemobiletools.clock.extensions.getFormattedTime import com.simplemobiletools.clock.extensions.getFormattedTime
@ -105,15 +104,19 @@ class WidgetDateTimeConfigureActivity : SimpleActivity() {
private fun pickBackgroundColor() { private fun pickBackgroundColor() {
ColorPickerDialog(this, mBgColorWithoutTransparency) { wasPositivePressed, color -> ColorPickerDialog(this, mBgColorWithoutTransparency) { wasPositivePressed, color ->
mBgColorWithoutTransparency = color if (wasPositivePressed) {
updateBgColor() mBgColorWithoutTransparency = color
updateBgColor()
}
} }
} }
private fun pickTextColor() { private fun pickTextColor() {
ColorPickerDialog(this, mTextColor) { wasPositivePressed, color -> ColorPickerDialog(this, mTextColor) { wasPositivePressed, color ->
mTextColorWithoutTransparency = color if (wasPositivePressed) {
updateColors() mTextColorWithoutTransparency = color
updateColors()
}
} }
} }