From 05a7d40950d15c701d22ae5685025f2a8993021a Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Fri, 8 Apr 2022 12:11:07 +0100 Subject: [PATCH] extracting view setup to its own method - follows other ftue fragment conventions --- .../FtueAuthCombinedServerSelectionFragment.kt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedServerSelectionFragment.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedServerSelectionFragment.kt index 3a717f0e518..d1560d7be0f 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedServerSelectionFragment.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/FtueAuthCombinedServerSelectionFragment.kt @@ -43,12 +43,14 @@ class FtueAuthCombinedServerSelectionFragment @Inject constructor() : AbstractFt override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) - views.chooseServerRoot.realignPercentagesToParent() + setupViews() + } + private fun setupViews() { + views.chooseServerRoot.realignPercentagesToParent() views.chooseServerToolbar.setNavigationOnClickListener { viewModel.handle(OnboardingAction.PostViewEvent(OnboardingViewEvents.OnBack)) } - views.chooseServerInput.editText?.setOnEditorActionListener { _, actionId, _ -> when (actionId) { EditorInfo.IME_ACTION_DONE -> { @@ -57,12 +59,8 @@ class FtueAuthCombinedServerSelectionFragment @Inject constructor() : AbstractFt } false } - views.chooseServerGetInTouch.debouncedClicks { openUrlInExternalBrowser(requireContext(), getString(R.string.ftue_ems_url)) } - - views.chooseServerSubmit.debouncedClicks { - updateServerUrl() - } + views.chooseServerSubmit.debouncedClicks { updateServerUrl() } } private fun updateServerUrl() {