Fix Broken EditText when using FromEditTextItem

This commit is contained in:
ariskotsomitopoulos 2021-10-21 01:44:08 +03:00
parent 7c9c4ecf5f
commit b3f6b5e142
2 changed files with 9 additions and 2 deletions

1
changelog.d/4276.bugfix Normal file
View File

@ -0,0 +1 @@
Fix Broken EditText when using FromEditTextItem

View File

@ -18,6 +18,7 @@ package im.vector.app.features.form
import android.text.Editable
import android.text.InputFilter
import android.text.InputType
import android.view.View
import android.view.inputmethod.EditorInfo
import android.widget.TextView
@ -107,8 +108,13 @@ abstract class FormEditTextItem : VectorEpoxyModel<FormEditTextItem.Holder>() {
holder.textInputEditText.isEnabled = enabled
inputType?.let { holder.textInputEditText.inputType = it }
holder.textInputEditText.isSingleLine = singleLine
holder.textInputEditText.imeOptions = imeOptions ?: EditorInfo.IME_ACTION_NONE
if (singleLine) {
holder.textInputEditText.maxLines = 1
holder.textInputEditText.minLines = 1
imeOptions ?: run { holder.textInputEditText.imeOptions = EditorInfo.IME_ACTION_NEXT }
inputType ?: run { holder.textInputEditText.setRawInputType(InputType.TYPE_CLASS_TEXT) }
}
holder.textInputEditText.addTextChangedListenerOnce(onTextChangeListener)
holder.textInputEditText.setOnEditorActionListener(editorActionListener)