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

[sidesheet] bug: switching from coplanar to standard sidesheet- when expanded- leaves sibling view squashed

Open
#3,331 1 comment 0 reactions 1 assignee View on GitHub

@afohrman is already working on this.

Since Apr 4, 2023.

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

Description

Note: this bug was moved from #3322.

If you have a sidesheet with some view (R.id.myOtherView) as the coplanarSiblingViewID:

SideSheetBehavior.from(mysidesheet).setCoplanarSiblingViewId(R.id.myOtherView)

You open the sidesheet on a landscape orientation phone, or maybe a tablet or Chromebook or some other big screen:

SideSheetBehavior.from(mysidesheet).expand()

Great, it shoves myOtherView over (squashes it) for a side by side! But should you then switch to portrait, or resize the window/activity to be very narrow, you'd want want to go from a side-by-side to a regular "on top" sidesheet.

So you react to the change with either:

SideSheetBehavior.from(mysidesheet).setCoplanarSiblingViewId(View.NO_ID)

or alternately:

SideSheetBehavior.from(mysidesheet).setCoplanarSiblingView(null)

What should happen:

The sidesheet stays expanded, changes type to non-coplanar regular, and the formerly coplanar view (myOtherView) should expand "underneath it".

What does happen:

The sidesheet stays expanded, changes type to non-coplanar regular behavior, but leaves the other view (myOtherView) squashed. Hiding the stylesheet at this point makes it go away, but the coplanar (myOtherView) view doesn't expand and it doesn't appear behind it. It just sits there, squished, with a big grey rectangle sitting there where the sidesheet was.

What doesn't work to fix it:

Doing any combination of invalidate(), requestLayout() or forceLayout() on myOtherView to get it to expand back into the grey space.

tl;dr -- when changing from coplanar to standard sidesheet (by setting setCoplanarSiblingViewId()), if the sidesheet is already open, the squashed side view does not expand underneath it as expected, leaving a big gray rectangle under the regular sidesheet.

Thx!

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.