Fixed
Status Update
Comments
an...@google.com <an...@google.com>
il...@google.com <il...@google.com> #2
This is similar to this bug report as well:
an...@google.com <an...@google.com> #3
Hi Yinglei, re-assigning back to you as you're currently working on exactly this for Snackbars.
ap...@google.com <ap...@google.com> #4
Project: platform/frameworks/support
Branch: androidx-main
commit 506fcdecc2dc257b58c574006d70ea9ce6f0bfda
Author: Yinglei Wang <yingleiw@google.com>
Date: Fri Feb 26 15:58:00 2021
add semantics liveRegion and apply it to snackbar
Snackbar should be marked as live region for accessibility. When talkback
is on, the snackbar is announced when it appears. Also added dismiss
action for the snackbar.
Note that since we are not merging up the tree for subtree change
events, we don't need to do extra work for live region. From android
documentation and discussion with Phil, the throttling delay is fine for
accessibility events from live region.
Relnote: "LiveRegion accessibility API is added.
If node is marked as a live region, the accessibility services
will automatically notify the user about its changes"
Fix: b/153644625 , b/172590946 , b/182834687
Test: tested manully with talkback on. Unit tests added.
Change-Id: Idcf6f425b12b005e59ad77fe7430e466132ea87c
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarHostTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/SnackbarHost.kt
M compose/ui/ui/api/1.0.0-beta04.txt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_1.0.0-beta04.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_1.0.0-beta04.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidComposeViewAccessibilityDelegateCompatTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt
https://android-review.googlesource.com/1580798
Branch: androidx-main
commit 506fcdecc2dc257b58c574006d70ea9ce6f0bfda
Author: Yinglei Wang <yingleiw@google.com>
Date: Fri Feb 26 15:58:00 2021
add semantics liveRegion and apply it to snackbar
Snackbar should be marked as live region for accessibility. When talkback
is on, the snackbar is announced when it appears. Also added dismiss
action for the snackbar.
Note that since we are not merging up the tree for subtree change
events, we don't need to do extra work for live region. From android
documentation and discussion with Phil, the throttling delay is fine for
accessibility events from live region.
Relnote: "LiveRegion accessibility API is added.
If node is marked as a live region, the accessibility services
will automatically notify the user about its changes"
Fix:
Test: tested manully with talkback on. Unit tests added.
Change-Id: Idcf6f425b12b005e59ad77fe7430e466132ea87c
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/SnackbarHostTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/SnackbarHost.kt
M compose/ui/ui/api/1.0.0-beta04.txt
M compose/ui/ui/api/current.txt
M compose/ui/ui/api/public_plus_experimental_1.0.0-beta04.txt
M compose/ui/ui/api/public_plus_experimental_current.txt
M compose/ui/ui/api/restricted_1.0.0-beta04.txt
M compose/ui/ui/api/restricted_current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidComposeViewAccessibilityDelegateCompatTest.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit 622947a991ba924d4896965f708be022bf1b35ba
Author: Ian Lake <ilake@google.com>
Date: Mon Jun 14 11:34:13 2021
Add a fake OnBackPressedDispatcher to Compose Previews
Rather than having APIs that depend on
LocalOnBackPressedDispatcher crash in @Preview,
provide a fake implementation by default to mirror
the capabilities that are available by default
in a ComponentActivity.
Relnote: "Compose `@Preview` now provides a
`LocalOnBackPressedDispatcherOwner` that allows you
to preview Composables that use APIs like `BackHandler`
that depend on that owner existing."
Test: new ComposeViewAdapterTest test passes
BUG: 185693006
Change-Id: Ia1c05ea3cadf2fb55cef9c4b8bae0898cfb35ba9
M compose/ui/ui-tooling/src/androidAndroidTest/kotlin/androidx/compose/ui/tooling/SimpleComposablePreview.kt
M compose/ui/ui-tooling/src/androidAndroidTest/kotlin/androidx/compose/ui/tooling/preview/ComposeViewAdapterTest.kt
M compose/ui/ui-tooling/src/androidMain/kotlin/androidx/compose/ui/tooling/preview/ComposeViewAdapter.kt
https://android-review.googlesource.com/1736795
Branch: androidx-main
commit 622947a991ba924d4896965f708be022bf1b35ba
Author: Ian Lake <ilake@google.com>
Date: Mon Jun 14 11:34:13 2021
Add a fake OnBackPressedDispatcher to Compose Previews
Rather than having APIs that depend on
LocalOnBackPressedDispatcher crash in @Preview,
provide a fake implementation by default to mirror
the capabilities that are available by default
in a ComponentActivity.
Relnote: "Compose `@Preview` now provides a
`LocalOnBackPressedDispatcherOwner` that allows you
to preview Composables that use APIs like `BackHandler`
that depend on that owner existing."
Test: new ComposeViewAdapterTest test passes
BUG: 185693006
Change-Id: Ia1c05ea3cadf2fb55cef9c4b8bae0898cfb35ba9
M compose/ui/ui-tooling/src/androidAndroidTest/kotlin/androidx/compose/ui/tooling/SimpleComposablePreview.kt
M compose/ui/ui-tooling/src/androidAndroidTest/kotlin/androidx/compose/ui/tooling/preview/ComposeViewAdapterTest.kt
M compose/ui/ui-tooling/src/androidMain/kotlin/androidx/compose/ui/tooling/preview/ComposeViewAdapter.kt
il...@google.com <il...@google.com> #6
We've added default a LocalOnBackPressedDispatcherOwner
and LocalActivityResultRegistryOwner
to @Preview
, so APIs that depend on these existing won't crash out of the box.
za...@gmail.com <za...@gmail.com> #7
Thanks!
Description
Steps to Reproduce:
BackHandler
composable.@Preview
composable.The preview will throw an exception about there not being any BackDispatcher available.
Because there isn't any back button in the IDE preview, and most previewed composables probably don't care about navigation anyway, I would expect
BackHandler
to just silently no-op in this case.