Clear history on decimal separator toggle

This commit is contained in:
Naveen 2022-06-04 11:41:43 +05:30
parent 2af2a6175f
commit a82ee7b113
1 changed files with 3 additions and 0 deletions

View File

@ -4,11 +4,13 @@ import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.view.Menu import android.view.Menu
import com.simplemobiletools.calculator.R import com.simplemobiletools.calculator.R
import com.simplemobiletools.calculator.extensions.calculatorDB
import com.simplemobiletools.calculator.extensions.config import com.simplemobiletools.calculator.extensions.config
import com.simplemobiletools.calculator.extensions.refreshAppWidget import com.simplemobiletools.calculator.extensions.refreshAppWidget
import com.simplemobiletools.calculator.helpers.MyWidgetProvider import com.simplemobiletools.calculator.helpers.MyWidgetProvider
import com.simplemobiletools.commons.extensions.* import com.simplemobiletools.commons.extensions.*
import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS import com.simplemobiletools.commons.helpers.IS_CUSTOMIZING_COLORS
import com.simplemobiletools.commons.helpers.ensureBackgroundThread
import kotlinx.android.synthetic.main.activity_settings.* import kotlinx.android.synthetic.main.activity_settings.*
import java.util.* import java.util.*
import kotlin.system.exitProcess import kotlin.system.exitProcess
@ -104,6 +106,7 @@ class SettingsActivity : SimpleActivity() {
settings_use_comma_as_decimal_mark.toggle() settings_use_comma_as_decimal_mark.toggle()
config.useCommaAsDecimalMark = settings_use_comma_as_decimal_mark.isChecked config.useCommaAsDecimalMark = settings_use_comma_as_decimal_mark.isChecked
refreshAppWidget<MyWidgetProvider>() refreshAppWidget<MyWidgetProvider>()
ensureBackgroundThread { applicationContext.calculatorDB.deleteHistory() }
} }
} }