mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-27 12:00:03 +03:00
Code review fixes.
This commit is contained in:
parent
89db5a6ecd
commit
b6717f4e46
2 changed files with 11 additions and 7 deletions
|
@ -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,11 +71,12 @@ abstract class FormEditTextWithDeleteItem : VectorEpoxyModel<FormEditTextWithDel
|
|||
holder.textInputEditText.setTextIfDifferent(value)
|
||||
|
||||
holder.textInputEditText.isEnabled = enabled
|
||||
if (singleLine) {
|
||||
holder.textInputEditText.setSingleLine()
|
||||
}
|
||||
imeOptions?.let {
|
||||
holder.textInputEditText.imeOptions = it
|
||||
holder.textInputEditText.isSingleLine = singleLine
|
||||
|
||||
holder.textInputEditText.imeOptions =
|
||||
imeOptions ?: when (singleLine) {
|
||||
true -> EditorInfo.IME_ACTION_NEXT
|
||||
false -> EditorInfo.IME_ACTION_NONE
|
||||
}
|
||||
|
||||
holder.textInputEditText.addTextChangedListenerOnce(onTextChangeListener)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue