resolve merge conflicts

This commit is contained in:
Axel Labarre 2023-02-22 17:07:59 +01:00
commit f1a8e8c03d
2 changed files with 27 additions and 1 deletions

View File

@ -290,7 +290,17 @@ class MainActivity : SimpleActivity(), Calculator {
// ****** ADD ONSAVEINSTANCESTATE FUNCTION ******
override fun onSaveInstanceState(bundle: Bundle) {
super.onSaveInstanceState(bundle)
/*
bundle.putString("res", calc.mResult)
bundle.putString("savedPreviousCalculation", calc.previousCalculation)
bundle.putString("savedLastKey", calc.lastKey)
bundle.putString("savedLastOperation", calc.lastOperation)
bundle.putDouble("savedBaseValue", calc.baseValue)
bundle.putDouble("savedSecondValue", calc.getSecondValueV2())
bundle.putString("savedInputDisplayedFormula", calc.inputDisplayedFormula)
*/
//JSON
bundle.putString("myJsonObject", calc.getjson())
}
//============================================================
}

View File

@ -484,4 +484,20 @@ class CalculatorImpl(
return this.secondValue
}
//JSON
public fun getJson() : String
{
val jsonObject = buildJsonObject{
put("res", mResult)
put("savedPreviousCalculation", previousCalculation)
put("savedLastKey", lastKey)
put("savedLastOperation", lastOperation)
put("savedBaseValue", baseValue)
put("savedSecondValue", secondValue)
put("savedInputDisplayedFormula", inputDisplayedFormula)
return jsonObject.toString()
}
}
}