From adf299081dc8ca87ed1c29dff8eda682c69e11d3 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 14 Nov 2019 21:54:03 +0100 Subject: [PATCH] Login screens: re-click on an item submit it --- .../login/LoginServerSelectionFragment.kt | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/vector/src/main/java/im/vector/riotx/features/login/LoginServerSelectionFragment.kt b/vector/src/main/java/im/vector/riotx/features/login/LoginServerSelectionFragment.kt index 59be9c7aa8..fb0ec25ab0 100644 --- a/vector/src/main/java/im/vector/riotx/features/login/LoginServerSelectionFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/login/LoginServerSelectionFragment.kt @@ -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,17 +61,32 @@ class LoginServerSelectionFragment @Inject constructor() : AbstractLoginFragment @OnClick(R.id.loginServerChoiceMatrixOrg) fun selectMatrixOrg() { - viewModel.handle(LoginAction.UpdateServerType(ServerType.MatrixOrg)) + if (loginServerChoiceMatrixOrg.isChecked) { + // Consider this is a submit + submit() + } else { + viewModel.handle(LoginAction.UpdateServerType(ServerType.MatrixOrg)) + } } @OnClick(R.id.loginServerChoiceModular) fun selectModular() { - viewModel.handle(LoginAction.UpdateServerType(ServerType.Modular)) + if (loginServerChoiceModular.isChecked) { + // Consider this is a submit + submit() + } else { + viewModel.handle(LoginAction.UpdateServerType(ServerType.Modular)) + } } @OnClick(R.id.loginServerChoiceOther) fun selectOther() { - viewModel.handle(LoginAction.UpdateServerType(ServerType.Other)) + if (loginServerChoiceOther.isChecked) { + // Consider this is a submit + submit() + } else { + viewModel.handle(LoginAction.UpdateServerType(ServerType.Other)) + } } @OnClick(R.id.loginServerSubmit)