fix CareDialog rotation
This commit is contained in:
parent
c30674036d
commit
a8e8659e18
1 changed files with 7 additions and 0 deletions
|
@ -54,6 +54,8 @@ class CareDialog : DialogFragmentWithDate() {
|
||||||
super.onSaveInstanceState(savedInstanceState)
|
super.onSaveInstanceState(savedInstanceState)
|
||||||
savedInstanceState.putDouble("actions_care_bg", actions_care_bg.value)
|
savedInstanceState.putDouble("actions_care_bg", actions_care_bg.value)
|
||||||
savedInstanceState.putDouble("actions_care_duration", actions_care_duration.value)
|
savedInstanceState.putDouble("actions_care_duration", actions_care_duration.value)
|
||||||
|
savedInstanceState.putInt("event", event)
|
||||||
|
savedInstanceState.putInt("options", options.ordinal)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?,
|
||||||
|
@ -65,6 +67,11 @@ class CareDialog : DialogFragmentWithDate() {
|
||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
savedInstanceState?.let {
|
||||||
|
event = savedInstanceState.getInt("event", R.string.error)
|
||||||
|
options = EventType.values()[savedInstanceState.getInt("options", 0)]
|
||||||
|
}
|
||||||
|
|
||||||
actions_care_icon.setImageResource(when (options) {
|
actions_care_icon.setImageResource(when (options) {
|
||||||
EventType.BGCHECK -> R.drawable.icon_cp_bgcheck
|
EventType.BGCHECK -> R.drawable.icon_cp_bgcheck
|
||||||
EventType.SENSOR_INSERT -> R.drawable.icon_cp_cgm_insert
|
EventType.SENSOR_INSERT -> R.drawable.icon_cp_cgm_insert
|
||||||
|
|
Loading…
Reference in a new issue