using clear error on change extension
This commit is contained in:
parent
be3d419290
commit
5e9e65e10f
@ -25,6 +25,7 @@ import androidx.lifecycle.lifecycleScope
|
||||
import com.airbnb.mvrx.args
|
||||
import im.vector.app.R
|
||||
import im.vector.app.core.extensions.associateContentStateWith
|
||||
import im.vector.app.core.extensions.clearErrorOnChange
|
||||
import im.vector.app.core.extensions.content
|
||||
import im.vector.app.core.extensions.editText
|
||||
import im.vector.app.core.extensions.setOnImeDoneListener
|
||||
@ -60,15 +61,8 @@ class FtueAuthPhoneConfirmationFragment @Inject constructor() : AbstractFtueAuth
|
||||
views.phoneConfirmationHeaderSubtitle.text = getString(R.string.ftue_auth_phone_confirmation_subtitle, params.msisdn)
|
||||
views.phoneConfirmationInput.associateContentStateWith(button = views.phoneConfirmationSubmit)
|
||||
views.phoneConfirmationInput.setOnImeDoneListener { submitConfirmationCode() }
|
||||
views.phoneConfirmationInput.clearErrorOnChange(viewLifecycleOwner)
|
||||
views.phoneConfirmationSubmit.debouncedClicks { submitConfirmationCode() }
|
||||
|
||||
views.phoneConfirmationInput.editText().textChanges()
|
||||
.onEach {
|
||||
views.phoneConfirmationInput.error = null
|
||||
views.phoneConfirmationSubmit.isEnabled = it.isNotBlank()
|
||||
}
|
||||
.launchIn(viewLifecycleOwner.lifecycleScope)
|
||||
|
||||
views.phoneConfirmationResend.debouncedClicks { viewModel.handle(OnboardingAction.PostRegisterAction(RegisterAction.SendAgainThreePid)) }
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user