add autoCapitalize in FormEditTextItem
This commit is contained in:
parent
ce23303b97
commit
d9fbc4a011
@ -58,6 +58,9 @@ abstract class FormEditTextItem : VectorEpoxyModel<FormEditTextItem.Holder>(R.la
|
|||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var singleLine: Boolean = true
|
var singleLine: Boolean = true
|
||||||
|
|
||||||
|
@EpoxyAttribute
|
||||||
|
var autoCapitalize: Boolean = false
|
||||||
|
|
||||||
@EpoxyAttribute
|
@EpoxyAttribute
|
||||||
var imeOptions: Int? = null
|
var imeOptions: Int? = null
|
||||||
|
|
||||||
@ -133,8 +136,14 @@ abstract class FormEditTextItem : VectorEpoxyModel<FormEditTextItem.Holder>(R.la
|
|||||||
private fun configureInputType(holder: Holder) {
|
private fun configureInputType(holder: Holder) {
|
||||||
val newInputType =
|
val newInputType =
|
||||||
inputType ?: when (singleLine) {
|
inputType ?: when (singleLine) {
|
||||||
true -> InputType.TYPE_CLASS_TEXT
|
true -> {
|
||||||
false -> InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE
|
if (autoCapitalize) InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_CAP_SENTENCES
|
||||||
|
else InputType.TYPE_CLASS_TEXT
|
||||||
|
}
|
||||||
|
false -> {
|
||||||
|
if (autoCapitalize) InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE or InputType.TYPE_TEXT_FLAG_CAP_SENTENCES
|
||||||
|
else InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_FLAG_MULTI_LINE
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is a must in order to avoid extreme lag in some devices, on fast typing
|
// This is a must in order to avoid extreme lag in some devices, on fast typing
|
||||||
|
@ -68,7 +68,7 @@ class CreateRoomController @Inject constructor(
|
|||||||
enabled(enableFormElement)
|
enabled(enableFormElement)
|
||||||
value(viewState.roomName)
|
value(viewState.roomName)
|
||||||
hint(host.stringProvider.getString(R.string.create_room_name_hint))
|
hint(host.stringProvider.getString(R.string.create_room_name_hint))
|
||||||
inputType(InputType.TYPE_TEXT_FLAG_CAP_SENTENCES)
|
autoCapitalize(true)
|
||||||
|
|
||||||
onTextChange { text ->
|
onTextChange { text ->
|
||||||
host.listener?.onNameChange(text)
|
host.listener?.onNameChange(text)
|
||||||
|
@ -92,7 +92,7 @@ class RoomSettingsController @Inject constructor(
|
|||||||
enabled(data.actionPermissions.canChangeName)
|
enabled(data.actionPermissions.canChangeName)
|
||||||
value(data.newName ?: roomSummary.displayName)
|
value(data.newName ?: roomSummary.displayName)
|
||||||
hint(host.stringProvider.getString(R.string.room_settings_name_hint))
|
hint(host.stringProvider.getString(R.string.room_settings_name_hint))
|
||||||
inputType(InputType.TYPE_TEXT_FLAG_CAP_SENTENCES)
|
autoCapitalize(true)
|
||||||
|
|
||||||
onTextChange { text ->
|
onTextChange { text ->
|
||||||
host.callback?.onNameChanged(text)
|
host.callback?.onNameChanged(text)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user