Skip to content
Snippets Groups Projects
Commit 4a7f2b63 authored by Oliver Zimmerman's avatar Oliver Zimmerman
Browse files

Code style - onViewCreated now first function.

parent 55fa8ead
No related branches found
No related tags found
No related merge requests found
......@@ -29,38 +29,6 @@ class SubmissionTestResultConsentGivenFragment : Fragment(R.layout.fragment_subm
private val binding: FragmentSubmissionTestResultConsentGivenBinding by viewBindingLazy()
private fun navigateToMainScreen() =
doNavigate(
SubmissionTestResultConsentGivenFragmentDirections
.actionSubmissionTestResultConsentGivenFragmentToHomeFragment()
)
private fun buildErrorDialog(exception: CwaWebException): DialogHelper.DialogInstance {
return when (exception) {
is CwaClientError, is CwaServerError -> DialogHelper.DialogInstance(
requireActivity(),
R.string.submission_error_dialog_web_generic_error_title,
getString(
R.string.submission_error_dialog_web_generic_network_error_body,
exception.statusCode
),
R.string.submission_error_dialog_web_generic_error_button_positive,
null,
true,
::navigateToMainScreen
)
else -> DialogHelper.DialogInstance(
requireActivity(),
R.string.submission_error_dialog_web_generic_error_title,
R.string.submission_error_dialog_web_generic_error_body,
R.string.submission_error_dialog_web_generic_error_button_positive,
null,
true,
::navigateToMainScreen
)
}
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
......@@ -99,6 +67,38 @@ class SubmissionTestResultConsentGivenFragment : Fragment(R.layout.fragment_subm
}
}
private fun navigateToMainScreen() =
doNavigate(
SubmissionTestResultConsentGivenFragmentDirections
.actionSubmissionTestResultConsentGivenFragmentToHomeFragment()
)
private fun buildErrorDialog(exception: CwaWebException): DialogHelper.DialogInstance {
return when (exception) {
is CwaClientError, is CwaServerError -> DialogHelper.DialogInstance(
requireActivity(),
R.string.submission_error_dialog_web_generic_error_title,
getString(
R.string.submission_error_dialog_web_generic_network_error_body,
exception.statusCode
),
R.string.submission_error_dialog_web_generic_error_button_positive,
null,
true,
::navigateToMainScreen
)
else -> DialogHelper.DialogInstance(
requireActivity(),
R.string.submission_error_dialog_web_generic_error_title,
R.string.submission_error_dialog_web_generic_error_body,
R.string.submission_error_dialog_web_generic_error_button_positive,
null,
true,
::navigateToMainScreen
)
}
}
override fun onResume() {
super.onResume()
binding.submissionTestResultContainer.sendAccessibilityEvent(AccessibilityEvent.TYPE_ANNOUNCEMENT)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment