material-components / material-components/material-components-android

[AppBarLayout] Does not expand when used with a nested CoordinatorLayout on version > 1.2.1

Open
#1,925 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Widget: TopAppBar
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

**Description:** When we use a CoordinatorLayout nested inside another CoordinatorLayout and we define different scroll flags for each AppBarLayout, it doesn't work properly in 1.2.1 version (and 1.3.0-rc01). Note that it works correctly on 1.0.0 version.
The goal is to have an AppBarLayout with a CollapsingToolbar (scrollFlags scroll|exitUntilCollapsed|snap) in the main CoordinatorLayout and an AppBarLayout with a Toolbar (scrollFlags scroll|enterAlways|snap) in the nested CoordinatorLayout.

| Version 1.0.0 (Works as expected) | Version 1.2.1 and above (Not working) |
|---|---|
| ![device-2020-12-14-113324](https://user-images.githubusercontent.com/26246782/102071140-5c09cb80-3e00-11eb-964b-e5bbe12bf102.gif) | ![device-2020-12-14-113931](https://user-images.githubusercontent.com/26246782/102071731-2dd8bb80-3e01-11eb-96bd-a2847c3161dc.gif) |

**Source code:**

Project:
https://github.com/serbelga/NestedCoordinatorLayout

Layout:
https://github.com/serbelga/NestedCoordinatorLayout/blob/24d3012553ab917df35360157c0654be4dfd638d/app/src/main/res/layout/activity_coordinator.xml#L32-L52

**Android API version:** Android API 30

**Material Library version:** 1.2.1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked NestedCoordinatorLayout reproduction and app/src/main/res/layout/activity_coordinator.xml lines 32-52, comparing behavior between Material Library 1.0.0 and 1.2.1 or later on Android API 30. Trace the nested CoordinatorLayout and AppBarLayout interaction; done means the outer CollapsingToolbar and inner Toolbar honor their distinct scroll flags and expand or collapse as shown in the working version.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.