Skip to content

Commit

Permalink
don't announce button when navigating to user's events while making s…
Browse files Browse the repository at this point in the history
…ure the button is accessible if we stay in pap or digid fragments
  • Loading branch information
ktiniatros committed Nov 2, 2022
1 parent 8502a70 commit 1f5d1fb
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ abstract class DigiDFragment(contentLayoutId: Int) : BaseFragment(contentLayoutI
)
}
)
dialogPresented()
} else {
onNavigateToYourEvents(
remoteProtocols = it.remoteEvents,
Expand Down Expand Up @@ -201,6 +202,7 @@ abstract class DigiDFragment(contentLayoutId: Int) : BaseFragment(contentLayoutI
positiveButtonText = R.string.dialog_close,
positiveButtonCallback = {}
)
dialogPresented()
}
LoginResult.NoBrowserFound -> {
dialogUtil.presentDialog(
Expand All @@ -213,6 +215,7 @@ abstract class DigiDFragment(contentLayoutId: Int) : BaseFragment(contentLayoutI
positiveButtonText = R.string.ok,
positiveButtonCallback = {}
)
dialogPresented()
}
}
})
Expand Down Expand Up @@ -300,4 +303,5 @@ abstract class DigiDFragment(contentLayoutId: Int) : BaseFragment(contentLayoutI
remoteProtocols: Map<RemoteProtocol, ByteArray>,
eventProviders: List<EventProvider> = emptyList()
)
abstract fun dialogPresented()
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@ class GetEventsFragment : DigiDFragment(R.layout.fragment_get_events) {
)
)
}

override fun dialogPresented() {
binding.loadingOverlay.progressBar.makeIndeterminateAccessible(
context = requireContext(),
isLoading = false,
message = R.string.holder_fetchevents_loading
)
binding.loadingOverlay.root.isVisible = false
}
}

data class GetEventsFragmentCopy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,10 @@ class PapFragment : DigiDFragment(R.layout.fragment_no_digid) {
toolbarTitle = getString(R.string.choose_provider_toolbar),
data = InfoFragmentData.TitleDescriptionWithButton(
title = getString(R.string.holder_contactCoronaCheckHelpdesk_title),
descriptionData = DescriptionData(R.string.holder_contactCoronaCheckHelpdesk_message, htmlLinksEnabled = true),
descriptionData = DescriptionData(
R.string.holder_contactCoronaCheckHelpdesk_message,
htmlLinksEnabled = true
),
primaryButtonData = ButtonData.NavigationButton(
text = getString(R.string.general_toMyOverview),
navigationActionId = R.id.action_my_overview
Expand All @@ -119,6 +122,11 @@ class PapFragment : DigiDFragment(R.layout.fragment_no_digid) {
subtitle = getString(R.string.holder_checkForBSN_buttonSubTitle_doesNotHaveBSN_testFlow)
) {
if (holderFeatureFlagUseCase.getPapEnabled()) {
/** disable accessibility, otherwise it is announced when loading is finished
* reenable with [dialogPresented] if a dialog is presented cause then the user will again interact with it
*/
binding.secondButton.root.importantForAccessibility =
View.IMPORTANT_FOR_ACCESSIBILITY_NO
loginWithDigiD()
} else {
infoFragmentUtil.presentFullScreen(
Expand Down Expand Up @@ -185,4 +193,8 @@ class PapFragment : DigiDFragment(R.layout.fragment_no_digid) {
)
)
}

override fun dialogPresented() {
binding.secondButton.root.importantForAccessibility = View.IMPORTANT_FOR_ACCESSIBILITY_YES
}
}

0 comments on commit 1f5d1fb

Please sign in to comment.