mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
Login screens: re-click on an item submit it
This commit is contained in:
parent
d50b690523
commit
adf299081d
1 changed files with 19 additions and 4 deletions
|
@ -52,7 +52,7 @@ class LoginServerSelectionFragment @Inject constructor() : AbstractLoginFragment
|
|||
text = getString(R.string.login_server_modular_learn_more)
|
||||
textDecorationLine = "underline"
|
||||
onClick = {
|
||||
// TODO
|
||||
// TODO this does not work
|
||||
openUrlInExternalBrowser(requireActivity(), "https://example.org")
|
||||
}
|
||||
}
|
||||
|
@ -61,18 +61,33 @@ class LoginServerSelectionFragment @Inject constructor() : AbstractLoginFragment
|
|||
|
||||
@OnClick(R.id.loginServerChoiceMatrixOrg)
|
||||
fun selectMatrixOrg() {
|
||||
if (loginServerChoiceMatrixOrg.isChecked) {
|
||||
// Consider this is a submit
|
||||
submit()
|
||||
} else {
|
||||
viewModel.handle(LoginAction.UpdateServerType(ServerType.MatrixOrg))
|
||||
}
|
||||
}
|
||||
|
||||
@OnClick(R.id.loginServerChoiceModular)
|
||||
fun selectModular() {
|
||||
if (loginServerChoiceModular.isChecked) {
|
||||
// Consider this is a submit
|
||||
submit()
|
||||
} else {
|
||||
viewModel.handle(LoginAction.UpdateServerType(ServerType.Modular))
|
||||
}
|
||||
}
|
||||
|
||||
@OnClick(R.id.loginServerChoiceOther)
|
||||
fun selectOther() {
|
||||
if (loginServerChoiceOther.isChecked) {
|
||||
// Consider this is a submit
|
||||
submit()
|
||||
} else {
|
||||
viewModel.handle(LoginAction.UpdateServerType(ServerType.Other))
|
||||
}
|
||||
}
|
||||
|
||||
@OnClick(R.id.loginServerSubmit)
|
||||
fun submit() = withState(viewModel) {
|
||||
|
|
Loading…
Reference in a new issue