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 046d09f7..e714f61e 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 96bb2e07..6d8f6272 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) {