Problem
When opening a BottomSheetDialogFragment
, with composable content, and TalkBack enabled, the app label is announced immediately. This is an unexpected and jarring experience for TalkBack users. Ideally announcement of the app label would not occur, which is what happens if the BottomSheetDialogFragment
contains XML views.
Reproduction
Setup is as simple as this:
class ComposeBottomSheet : BottomSheetDialogFragment() {
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View {
setStyle(DialogFragment.STYLE_NORMAL, R.style.Theme_KeyboardExperiments_BottomSheetDialog)
return ComposeView(requireContext()).apply {
setContent {
// Composables...
}
}
}
}
I have a sample project that can reproduce it here. This project was initially created to demonstrate a different bug... but it works here too. In this case the app label is KeyboardExperiments
.
Demo
Question
How can I skip the announcement of the app label upon opening a BottomSheetDialogFragment
with composable content?
Note: We cannot migrate to full Compose yet but that is the most obvious solution here.