Developers may want to write UI tests that involve the flexible header. For example, they may want to write a test to verify that content does not overlap with the flexible header. To enable such tests, `MDCFlexibleHeaderView` needs an accessibility identifier.
PiperOrigin-RevId: 501357485
This warning became more strict after updates in the clang compiler.
The error message that this change fixes is:
```
error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
```
PiperOrigin-RevId: 472723024
This avoids propagation of warnings to non-Material compilation units which may have deprecation warnings enabled as errors.
PiperOrigin-RevId: 460832988
This logical unit will house all logic related to the shift behavior. It is being extracted as a distinct logical unit so that it can be better unit tested and validated in terms of behavior. This change introduces an initial test for the basic skeletal object accordingly.
In subsequent changes, we will move logic from MDCFlexibleHeaderView into this new object.
PiperOrigin-RevId: 311203197
## 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
This example demonstrates a bug where the safe area layout guide does not appear to be working as expected (i.e. the content does not pin to the bottom of the FlexibleHeader).
PiperOrigin-RevId: 310220555
An issue was found regarding UIKit re-setting the content offset when the value is a fractional number due to screen densities. By rounding the offset clamp to the nearest integer we are assuring the contentOffset value will be valid and UIKit would not try to alter it causing an infinite loop and thus a crash.
PiperOrigin-RevId: 307810013