material-components / material-components/material-components-android
[AppBarLayout] Accessibility: "No next container" when CollapsingToolbarLayout content is larger than Toolbar
@pekingme is already working on this.
Since Oct 24, 2023.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
**Description:**
I have a very simple layout consisting of a `CollapsingToolbarLayout` with some content, and a `ScrollView` below. Using TalkBack with [container navigation](https://support.google.com/accessibility/android/answer/13208602?hl=en#zippy=%2Ccontainer-navigation) (4-finger horizontal swipe), I can jump from the back button that is focused initially ("unlabelled button") to the content of the scroll view and back. This means that the content of the `CollapsingToolbarLayout` is detected as a container and the `ScrollView` is detected as another container.
Now change the height of the `ImageView` that is inside the `CollapsingToolbarLayout`. As soon as the `ImageView` is larger than the toolbar, container navigation stops working. Swiping horizontally with 4 fingers, TalkBack just announces "No next container" and "No previous container".
Note that the example given below is a heavily simplified layout to make it easier to reproduce the problem. Of course, the example layout is rather useless and not being able to jump to the `ScrollView` is no problem here. In our actual app, however, we have more content in the `CollapsingToolbarLayout` (toolbar buttons, etc) and `ScrollView`. There, TalkBack users should be able to skip directly to the main content in the `ScrollView`, or skip out of the `ScrollView` back to the toolbar using container navigation.
**Expected behavior:**
TalkBack [container navigation](https://support.google.com/accessibility/android/answer/13208602?hl=en#zippy=%2Ccontainer-navigation) (4-finger horizontal swipe) should work even if the content of the `CollapsingToolbarLayout` is larger than the toolbar. Note that this is a regression introduced in 72228f4f35b0c155c870f59bc7c807e05443bf95.
**Source code:**
```xml
```
**Minimal sample app repro:** https://github.com/ByteHamster/Test/tree/material-talkback
**Android API version:** Tested with API version 33 and 32
**Material Library version:** All, starting with 1.7.0. `git bisect` shows that 72228f4f35b0c155c870f59bc7c807e05443bf95 is the first bad commit. In the example app, I use 1.10.0.
**Device:** Nokia 5.3 (stock Android 12) and OnePlus 7t (Android 13, LineageOS)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.