mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
adding missing IME handling for the register next focus and server selection submit
This commit is contained in:
parent
c022a38dd4
commit
89f182ac35
3 changed files with 18 additions and 4 deletions
|
@ -20,7 +20,7 @@ import android.os.Bundle
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
import androidx.core.view.isEmpty
|
import android.view.inputmethod.EditorInfo
|
||||||
import im.vector.app.core.extensions.content
|
import im.vector.app.core.extensions.content
|
||||||
import im.vector.app.core.extensions.editText
|
import im.vector.app.core.extensions.editText
|
||||||
import im.vector.app.core.extensions.realignPercentagesToParent
|
import im.vector.app.core.extensions.realignPercentagesToParent
|
||||||
|
@ -47,9 +47,22 @@ class FtueAuthCombinedServerSelectionFragment @Inject constructor() : AbstractFt
|
||||||
viewModel.handle(OnboardingAction.PostViewEvent(OnboardingViewEvents.OnBack))
|
viewModel.handle(OnboardingAction.PostViewEvent(OnboardingViewEvents.OnBack))
|
||||||
}
|
}
|
||||||
|
|
||||||
views.chooseServerSubmit.debouncedClicks {
|
views.chooseServerInput.editText?.setOnEditorActionListener { _, actionId, _ ->
|
||||||
viewModel.handle(OnboardingAction.EditHomeServer(views.chooseServerInput.content().ensureProtocol().ensureTrailingSlash()))
|
when (actionId) {
|
||||||
|
EditorInfo.IME_ACTION_DONE -> {
|
||||||
|
updateServerUrl()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
views.chooseServerSubmit.debouncedClicks {
|
||||||
|
updateServerUrl()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun updateServerUrl() {
|
||||||
|
viewModel.handle(OnboardingAction.EditHomeServer(views.chooseServerInput.content().ensureProtocol().ensureTrailingSlash()))
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun resetViewModel() {
|
override fun resetViewModel() {
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
<com.google.android.material.textfield.TextInputEditText
|
<com.google.android.material.textfield.TextInputEditText
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:imeOptions="actionNext"
|
android:imeOptions="actionDone"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:maxLines="1" />
|
android:maxLines="1" />
|
||||||
|
|
||||||
|
|
|
@ -173,6 +173,7 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:imeOptions="actionNext"
|
android:imeOptions="actionNext"
|
||||||
|
android:nextFocusForward="@id/createAccountPasswordInput"
|
||||||
android:inputType="text"
|
android:inputType="text"
|
||||||
android:maxLines="1" />
|
android:maxLines="1" />
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue