Skip to content

Commit

Permalink
extracting view setup to its own method -
Browse files Browse the repository at this point in the history
follows other ftue fragment conventions
  • Loading branch information
ouchadam committed Apr 8, 2022
1 parent 6304d5d commit 05a7d40
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 -> {
Expand All @@ -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() {
Expand Down

0 comments on commit 05a7d40

Please sign in to comment.