Core review rename input Suffix|Prefix

This commit is contained in:
Valere 2021-06-15 11:22:29 +02:00
parent b6b80120b2
commit 88119a15bf
4 changed files with 10 additions and 10 deletions

View File

@ -72,10 +72,10 @@ abstract class FormEditTextItem : VectorEpoxyModel<FormEditTextItem.Holder>() {
var onFocusChange: ((Boolean) -> Unit)? = null
@EpoxyAttribute
var inputPrefix: String? = null
var prefixText: String? = null
@EpoxyAttribute
var inputSuffix: String? = null
var suffixText: String? = null
private val onTextChangeListener = object : SimpleTextWatcher() {
override fun afterTextChanged(s: Editable) {
@ -92,8 +92,8 @@ abstract class FormEditTextItem : VectorEpoxyModel<FormEditTextItem.Holder>() {
holder.textInputLayout.error = errorMessage
holder.textInputLayout.endIconMode = endIconMode ?: TextInputLayout.END_ICON_NONE
holder.textInputLayout.prefixText = inputPrefix
holder.textInputLayout.suffixText = inputSuffix
holder.textInputLayout.prefixText = prefixText
holder.textInputLayout.suffixText = suffixText
if (forceUpdateValue) {
holder.textInputEditText.setText(value)

View File

@ -103,8 +103,8 @@ class CreateRoomController @Inject constructor(
id("alias")
enabled(enableFormElement)
value(viewState.roomVisibilityType.aliasLocalPart)
inputSuffix(":" + viewState.homeServerName)
inputPrefix("#")
suffixText(":" + viewState.homeServerName)
prefixText("#")
hint(host.stringProvider.getString(R.string.room_alias_address_hint))
errorMessage(
host.roomAliasErrorFormatter.format(

View File

@ -248,8 +248,8 @@ class RoomAliasController @Inject constructor(
formEditTextItem {
id("newLocalAlias")
value(data.newLocalAliasState.value)
inputSuffix(":" + data.homeServerName)
inputPrefix("#")
suffixText(":" + data.homeServerName)
prefixText("#")
hint(host.stringProvider.getString(R.string.room_alias_address_hint))
errorMessage(host.roomAliasErrorFormatter.format((data.newLocalAliasState.asyncRequest as? Fail)?.error as? RoomAliasError))
onTextChange { value ->

View File

@ -92,8 +92,8 @@ class SpaceDetailEpoxyController @Inject constructor(
forceUpdateValue(!data.aliasManuallyModified)
value(data.aliasLocalPart)
hint(host.stringProvider.getString(R.string.create_space_alias_hint))
inputSuffix(":" + data.homeServerName)
inputPrefix("#")
suffixText(":" + data.homeServerName)
prefixText("#")
onFocusChange { hasFocus ->
host.aliasTextIsFocused = hasFocus
}