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

[CoordinatorLayout] Keep the state of a view using HideViewOnScrollBehavior on configuration change.

Open
#4,624 1 comment 0 reactions 1 assignee View on GitHub

@imhappi is already working on this.

Since Feb 26, 2025.

feature request Issue: Other
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

Is your feature request related to a problem? Please describe.
When a view is hidden using HideViewOnScrollBehavior and there is a configuration change (e.g. screen rotation) the view is shown again, I'm not sure if this is intended behavior (this also happened with now deprecated HideBottomViewOnScrollBehavior).

Describe the solution you'd like
It would be better if the view kept its hidden state when a configuration change occurs.

Additional context
I attached a video where the navigation bar reappears when the screen is rotated.
Using Pixel 9 emulator API 35. Material version: 1.13.0-alpha10

Also, the action bar is misplaced when rotating the device, looks like it's still applying the display cutout insets even though the cutout is no longer above the bar. I attached a screenshot showing the problem

Sample repo: HideBottomViewSample.zip

https://github.com/user-attachments/assets/2f74298c-d077-4ae1-97c6-be29726b5b18

Image

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.