6 Commits

Author SHA1 Message Date
Jeff Verkoeyen
72dcc44075 Internal change
PiperOrigin-RevId: 468184898
2022-08-17 06:51:30 -07:00
Jeff Verkoeyen
1437067081 Optimizing imports
PiperOrigin-RevId: 356851164
2021-02-10 16:18:20 -08:00
Galia Kaufman
09171d15c7 [AppBar] Fix a failing snapshot test
PiperOrigin-RevId: 312260009
2020-05-19 05:29:15 -07:00
Jeff Verkoeyen
a502ce66b9 [FlexibleHeader] Ensure that the FlexibleHeader's position reacts to safeAreaInsets changes when hidden.
## The bug

Repro steps:

1. Open MDCDragons on an iPhone with a notch.
2. Open App Bar -> Presented hidden.
3. Present the App Bar.
4. Observe.

Expected behavior:
- The AppBar is completely hidden.

Actual behavior:
- The AppBar is partially hidden.

## Root cause analysis

When the FlexibleHeader is hidden using shiftHeaderOffScreenAnimated:, the expectation is that the header will be shifted entirely off-screen. If this method is invoked before the FlexibleHeader is attached to a window hierarchy, then the offset applied to shift the header off-screen may not correctly include the necessary safe area insets to hide the header fully.

When flexibleHeaderSafeAreaTopSafeAreaInsetDidChange was being invoked after the safe area insets were made available to the FlexibleHeader, we were not taking into consideration whether the FlexibleHeader was supposed to be hidden which resulted in the FlexibleHeader getting stuck in a partially hidden state.

## The fix

In flexibleHeaderSafeAreaTopSafeAreaInsetDidChange, we now check whether the FlexibleHeader wants to be hidden and, if it does (and we're not already animating it), we immediately snap the FlexibleHeader to the new necessary offset.

PiperOrigin-RevId: 311104051
2020-05-13 14:40:20 +00:00
Jeff Verkoeyen
97702e8b0c [AppBar] Make the presented hidden example show a new view controller each time.
The example was reusing the same view controller instance after each presentation, which made it difficult to consistently test the same buggy behavior.

PiperOrigin-RevId: 310980123
2020-05-12 15:11:46 -04:00
Jeff Verkoeyen
3b99d09c69 [AppBar] Add a presented hidden example.
This example demonstrates a bug where the AppBar does not appear to respect shiftHeaderOffScreenAnimated: when the shiftBehavior is set to hideable.

PiperOrigin-RevId: 310898136
2020-05-11 06:18:08 -07:00