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
1 changed files with 8 additions and 5 deletions

View File

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