fix BolusProgressDialog rotation

This commit is contained in:
Milos Kozak 2020-03-04 23:33:34 +01:00
parent 74e35643d1
commit 90a9b09395

View file

@ -30,8 +30,10 @@ class BolusProgressDialog : DialogFragment() {
companion object { companion object {
private val DEFAULT_STATE = MainApp.gs(R.string.waitingforpump) private val DEFAULT_STATE = MainApp.gs(R.string.waitingforpump)
@JvmField @JvmField
var bolusEnded = false var bolusEnded = false
@JvmField @JvmField
var stopPressed = false var stopPressed = false
} }
@ -62,6 +64,9 @@ class BolusProgressDialog : DialogFragment() {
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
savedInstanceState?.let {
amount = it.getDouble("amount")
}
overview_bolusprogress_title.text = String.format(MainApp.gs(R.string.overview_bolusprogress_goingtodeliver), amount) overview_bolusprogress_title.text = String.format(MainApp.gs(R.string.overview_bolusprogress_goingtodeliver), amount)
overview_bolusprogress_stop.setOnClickListener { overview_bolusprogress_stop.setOnClickListener {
if (L.isEnabled(L.UI)) log.debug("Stop bolus delivery button pressed") if (L.isEnabled(L.UI)) log.debug("Stop bolus delivery button pressed")
@ -136,6 +141,7 @@ class BolusProgressDialog : DialogFragment() {
override fun onSaveInstanceState(outState: Bundle) { override fun onSaveInstanceState(outState: Bundle) {
super.onSaveInstanceState(outState) super.onSaveInstanceState(outState)
outState.putString("state", state) outState.putString("state", state)
outState.putDouble("amount", amount)
} }
private fun scheduleDismiss() { private fun scheduleDismiss() {