remove empty lines
This commit is contained in:
parent
74071bee5a
commit
9734007b59
|
@ -29,12 +29,9 @@ class MainActivity : SimpleActivity(), Calculator {
|
||||||
private var storedUseCommaAsDecimalMark = false
|
private var storedUseCommaAsDecimalMark = false
|
||||||
private var decimalSeparator = DOT
|
private var decimalSeparator = DOT
|
||||||
private var groupingSeparator = COMMA
|
private var groupingSeparator = COMMA
|
||||||
|
|
||||||
private var saveCalculatorState: String = ""
|
private var saveCalculatorState: String = ""
|
||||||
|
|
||||||
private lateinit var calc: CalculatorImpl
|
private lateinit var calc: CalculatorImpl
|
||||||
|
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
isMaterialActivity = true
|
isMaterialActivity = true
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
@ -42,8 +39,6 @@ class MainActivity : SimpleActivity(), Calculator {
|
||||||
appLaunched(BuildConfig.APPLICATION_ID)
|
appLaunched(BuildConfig.APPLICATION_ID)
|
||||||
setupOptionsMenu()
|
setupOptionsMenu()
|
||||||
refreshMenuItems()
|
refreshMenuItems()
|
||||||
|
|
||||||
|
|
||||||
updateMaterialActivityViews(main_coordinator, null, useTransparentNavigation = false, useTopSearchMenu = false)
|
updateMaterialActivityViews(main_coordinator, null, useTransparentNavigation = false, useTopSearchMenu = false)
|
||||||
setupMaterialScrollListener(main_nested_scrollview, main_toolbar)
|
setupMaterialScrollListener(main_nested_scrollview, main_toolbar)
|
||||||
|
|
||||||
|
@ -52,8 +47,6 @@ class MainActivity : SimpleActivity(), Calculator {
|
||||||
}
|
}
|
||||||
|
|
||||||
calc = CalculatorImpl(this, applicationContext, decimalSeparator, groupingSeparator, saveCalculatorState)
|
calc = CalculatorImpl(this, applicationContext, decimalSeparator, groupingSeparator, saveCalculatorState)
|
||||||
|
|
||||||
|
|
||||||
btn_plus.setOnClickOperation(PLUS)
|
btn_plus.setOnClickOperation(PLUS)
|
||||||
btn_minus.setOnClickOperation(MINUS)
|
btn_minus.setOnClickOperation(MINUS)
|
||||||
btn_multiply.setOnClickOperation(MULTIPLY)
|
btn_multiply.setOnClickOperation(MULTIPLY)
|
||||||
|
@ -62,7 +55,6 @@ class MainActivity : SimpleActivity(), Calculator {
|
||||||
btn_power.setOnClickOperation(POWER)
|
btn_power.setOnClickOperation(POWER)
|
||||||
btn_root.setOnClickOperation(ROOT)
|
btn_root.setOnClickOperation(ROOT)
|
||||||
btn_minus.setOnLongClickListener { calc.turnToNegative() }
|
btn_minus.setOnLongClickListener { calc.turnToNegative() }
|
||||||
|
|
||||||
btn_clear.setVibratingOnClickListener { calc.handleClear() }
|
btn_clear.setVibratingOnClickListener { calc.handleClear() }
|
||||||
btn_clear.setOnLongClickListener {
|
btn_clear.setOnLongClickListener {
|
||||||
calc.handleReset()
|
calc.handleReset()
|
||||||
|
@ -78,7 +70,6 @@ class MainActivity : SimpleActivity(), Calculator {
|
||||||
btn_equals.setVibratingOnClickListener { calc.handleEquals() }
|
btn_equals.setVibratingOnClickListener { calc.handleEquals() }
|
||||||
formula.setOnLongClickListener { copyToClipboard(false) }
|
formula.setOnLongClickListener { copyToClipboard(false) }
|
||||||
result.setOnLongClickListener { copyToClipboard(true) }
|
result.setOnLongClickListener { copyToClipboard(true) }
|
||||||
|
|
||||||
AutofitHelper.create(result)
|
AutofitHelper.create(result)
|
||||||
AutofitHelper.create(formula)
|
AutofitHelper.create(formula)
|
||||||
storeStateVariables()
|
storeStateVariables()
|
||||||
|
|
|
@ -433,7 +433,6 @@ class CalculatorImpl(
|
||||||
|
|
||||||
private fun String.removeGroupSeparator() = formatter.removeGroupingSeparator(this)
|
private fun String.removeGroupSeparator() = formatter.removeGroupingSeparator(this)
|
||||||
|
|
||||||
|
|
||||||
fun getCalculatorStateJson(): JSONObject {
|
fun getCalculatorStateJson(): JSONObject {
|
||||||
val jsonObj = JSONObject()
|
val jsonObj = JSONObject()
|
||||||
jsonObj.put(RES, currentResult)
|
jsonObj.put(RES, currentResult)
|
||||||
|
|
|
@ -30,7 +30,6 @@ const val COMMA = ","
|
||||||
|
|
||||||
// shared prefs
|
// shared prefs
|
||||||
const val USE_COMMA_AS_DECIMAL_MARK = "use_comma_as_decimal_mark"
|
const val USE_COMMA_AS_DECIMAL_MARK = "use_comma_as_decimal_mark"
|
||||||
|
|
||||||
const val RES = "res"
|
const val RES = "res"
|
||||||
const val PREVIOUS_CALCULATION = "previousCalculation"
|
const val PREVIOUS_CALCULATION = "previousCalculation"
|
||||||
const val LAST_KEY = "lastKey"
|
const val LAST_KEY = "lastKey"
|
||||||
|
@ -38,5 +37,4 @@ const val LAST_OPERATION = "lastOperation"
|
||||||
const val BASE_VALUE = "baseValue"
|
const val BASE_VALUE = "baseValue"
|
||||||
const val SECOND_VALUE = "secondValue"
|
const val SECOND_VALUE = "secondValue"
|
||||||
const val INPUT_DISPLAYED_FORMULA = "inputDisplayedFormula"
|
const val INPUT_DISPLAYED_FORMULA = "inputDisplayedFormula"
|
||||||
|
|
||||||
const val CALCULATOR_STATE = "calculatorState"
|
const val CALCULATOR_STATE = "calculatorState"
|
||||||
|
|
Loading…
Reference in New Issue