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

[AppBarLayout] Elevation disappears when AppBarLayout is half visible

Open
#2,156 0 comments 0 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 AppBarLayout has app:liftOnScroll="true" and its sibling has app:layout_scrollFlags="scroll|enterAlways|snap", the elevation disappears if you stop scrolling when the AppBarLayout is half-visible.

The issue is easy to see if after scrolling up and hiding the AppBarLayout you start scrolling down very slowly.

**Expected behavior:** Elevation should remain visible even if you stop scrolling when AppBarLayout is half-visible.

**Source code:**




**Android API version:** The problem is reproducible in APIs 16 through 30.

**Material Library version:** 1.3.0

**Device:** Android emulators (APIs 16 through 30) and Pixel 2 (API 30).

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 by reproducing the issue with the provided AppBarLayout, MaterialToolbar, scrolling flags, and appbar_scrolling_view_behavior configuration on an Android emulator. Verify the elevation while stopping with the AppBarLayout half-visible, and consider the issue done when the elevation remains visible in that state across the reported API versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
android
Domain
mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.