From ad8baf8091c86f7c8e8b7c3cad302af27a02277a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Mon, 10 Jun 2019 14:13:14 +0200 Subject: [PATCH] Fix screen rotation issue --- .../im/vector/riotredesign/features/form/FormEditTextItem.kt | 5 +++-- .../im/vector/riotredesign/features/form/FormSwitchItem.kt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/vector/src/main/java/im/vector/riotredesign/features/form/FormEditTextItem.kt b/vector/src/main/java/im/vector/riotredesign/features/form/FormEditTextItem.kt index 046d09f715..e714f61e07 100644 --- a/vector/src/main/java/im/vector/riotredesign/features/form/FormEditTextItem.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/form/FormEditTextItem.kt @@ -16,6 +16,7 @@ package im.vector.riotredesign.features.form +import android.text.Editable import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass import com.google.android.material.textfield.TextInputEditText @@ -41,7 +42,7 @@ abstract class FormEditTextItem : VectorEpoxyModel() { var onTextChange: ((String) -> Unit)? = null private val onTextChangeListener = object : SimpleTextWatcher() { - override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) { + override fun afterTextChanged(s: Editable) { onTextChange?.invoke(s.toString()) } } @@ -60,7 +61,7 @@ abstract class FormEditTextItem : VectorEpoxyModel() { } override fun shouldSaveViewState(): Boolean { - return true + return false } override fun unbind(holder: Holder) { diff --git a/vector/src/main/java/im/vector/riotredesign/features/form/FormSwitchItem.kt b/vector/src/main/java/im/vector/riotredesign/features/form/FormSwitchItem.kt index 96bb2e0703..6d8f627202 100644 --- a/vector/src/main/java/im/vector/riotredesign/features/form/FormSwitchItem.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/form/FormSwitchItem.kt @@ -57,7 +57,7 @@ abstract class FormSwitchItem : VectorEpoxyModel() { } override fun shouldSaveViewState(): Boolean { - return true + return false } override fun unbind(holder: Holder) {