From b6717f4e46ee051b594c72c1797ac4833e4d2f72 Mon Sep 17 00:00:00 2001 From: Onuray Sahin Date: Thu, 11 Nov 2021 13:38:39 +0300 Subject: [PATCH] Code review fixes. --- .../features/form/FormEditTextWithDeleteItem.kt | 14 ++++++++------ .../features/poll/create/CreatePollController.kt | 4 +++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/form/FormEditTextWithDeleteItem.kt b/vector/src/main/java/im/vector/app/features/form/FormEditTextWithDeleteItem.kt index 19c94a1742..abcd1429d4 100644 --- a/vector/src/main/java/im/vector/app/features/form/FormEditTextWithDeleteItem.kt +++ b/vector/src/main/java/im/vector/app/features/form/FormEditTextWithDeleteItem.kt @@ -17,6 +17,7 @@ package im.vector.app.features.form import android.text.Editable +import android.view.inputmethod.EditorInfo import android.widget.ImageButton import com.airbnb.epoxy.EpoxyAttribute import com.airbnb.epoxy.EpoxyModelClass @@ -70,12 +71,13 @@ abstract class FormEditTextWithDeleteItem : VectorEpoxyModel EditorInfo.IME_ACTION_NEXT + false -> EditorInfo.IME_ACTION_NONE + } holder.textInputEditText.addTextChangedListenerOnce(onTextChangeListener) diff --git a/vector/src/main/java/im/vector/app/features/poll/create/CreatePollController.kt b/vector/src/main/java/im/vector/app/features/poll/create/CreatePollController.kt index 9d825fdaca..515f59a38c 100644 --- a/vector/src/main/java/im/vector/app/features/poll/create/CreatePollController.kt +++ b/vector/src/main/java/im/vector/app/features/poll/create/CreatePollController.kt @@ -52,12 +52,14 @@ class CreatePollController @Inject constructor( title(host.stringProvider.getString(R.string.create_poll_question_title)) } + val questionImeAction = if (currentState.options.isEmpty()) EditorInfo.IME_ACTION_DONE else EditorInfo.IME_ACTION_NEXT + formEditTextItem { id("question") value(currentState.question) hint(host.stringProvider.getString(R.string.create_poll_question_hint)) singleLine(true) - imeOptions(EditorInfo.IME_ACTION_NEXT) + imeOptions(questionImeAction) maxLength(500) onTextChange { host.callback?.onQuestionChanged(it)