diff --git a/app/build.gradle b/app/build.gradle index 5f9d9e25..26fafa0a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -62,7 +62,7 @@ android { } dependencies { - implementation 'com.github.SimpleMobileTools:Simple-Commons:9cb42cbf35' + implementation 'com.github.SimpleMobileTools:Simple-Commons:fe2610738c' implementation 'me.grantland:autofittextview:0.2.1' implementation 'net.objecthunter:exp4j:0.4.8' diff --git a/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt b/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt index f65d8335..d33760f4 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt @@ -288,7 +288,8 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) { } fun handleClear() { - val lastDeletedValue = inputDisplayedFormula.last().toString() + val lastDeletedValue = inputDisplayedFormula.lastOrNull().toString() + var newValue = inputDisplayedFormula.dropLast(1) if (newValue == "") { newValue = "0"