This change is a slight alteration to the change introduced in cl/347036858 this moves the added code to the bottom of the method so as to not interfere with the recursive call.
BEGIN_PUBLIC
Made a slight change to move adding `presentingViewYOffset' to `_contentHeightSurplus` to the end of the method. This was added in a previous change but didn't take into account the possibility of an infinite recursive loop. This movement should prevent that while also updating `_contentHeightSurplus` to the proper value. This should also fix the bug brought up in b/176122058
END_PUBLIC
PiperOrigin-RevId: 351455638
BEGIN_PUBLIC
Updated the `contentHeightSurplus` method to add in an additional value of `presentingViewYOffset'. In the current iteration the `presentingViewYOffset' gets cancelled out by being included in both `scrollingDistance` and `containerHeight`. This change will take that offset back in to account and resolves a UX bug that we're currently seeing devices with smaller screen sizes using the PageSheet presentation style (b/173830907).
END_PUBLIC
PiperOrigin-RevId: 347036858
This adds a dismissOnAccessibilityPerformEscape bit that allows clients to control whether the bottom drawer should dismiss or not on Z swipe. This is useful for when clients have an extra step before dismissal (e.g. confirmation on dismiss).
PiperOrigin-RevId: 331594189
Currently the NavigationDrawer drawer expands to full screen as a user scrolls, this allows the client to set a maximum height that a navigation drawer can grow to. I tried doing multiple calculations to prevent the drawer from going passed a certain height but that made the component much more complex and still had some bugs. If a client chooses a `maximumDrawerHeight` that goes into the safe area the header will not grow, I am going to address that in a follow up.
PiperOrigin-RevId: 313214108
Added ability to account for bottom safe area in presentation of initial drawer height, parameterized by default-off flag.
Fixes#9322.
I tried adding unit tests on this, per our conversation @yarneo, but ran into some issues with writing tests around this as:
1) unit testing for this is difficult as one cannot manually set the `safeAreaInsets`
2) snapshot testing this requires that the test suite is done on an iPhone X or similar device with bottom insets, which is not the current test device for snapshots as far as I can tell
I'm happy to add tests but need a bit of guidance regarding how to best test this given the above constraints. I didn't see a test testing the related `shouldIncludeSafeAreaInContentHeight` behavior, which I was looking to use as a test reference, but perhaps could do something similar to: b8090cb638/components/FlexibleHeader/tests/unit/supplemental/FlexibleHeaderTopSafeAreaTestsFakeViewController.m (L90-L94).
Wanted to get your thoughts on this before diving further @yarneo.
### Context
In order to support a fully themable NavigationDrawer we need to be able to set the _scrimColor_ to a custom color. These changes add a property to be able to do so. If the _scrimColor_ isn't set the the `scrimView` in the `MDCBottomNavigationPresentationController` defaults to `[UIColor colorWithWhite:0 alpha:0.32];`.
### Related bug
b/117274465
### Screenshots
| Before | After |
| - | - |
|||
**_Code snippet for after screenshot_**
```swift
bottomDrawerViewController.scrimColor = UIColor.blue.withAlphaComponent(0.5)
```
### Context
In #5423 my thinking was that we would need to test MDCBottomDrawerViewController but majority of the test are going to be related to MDCBottomDrawerContainerViewController. We may still want to test MDCBottomDrawerViewController so that is why I haven't completely removed that file for tests. But, we need fakes in a couple places so this adds _Fakes_ files so that code can be shared.
### The problem
We need fakes for test in MaterialNavigationDrawer because we can't present and that code should be shared.
### The fix
Add a `MDCNavigationDrawerFakes` files so we can have fakes and they can be shared across test files.
### Related bugs
#4911
Context
Set up the everything to start work on unit test for Navigation Drawer. In order to make small changes that are easier to review this sets up the files to get ready for test. This will allow us to work in tandem on unit test for this component once the files are in place.
The problem
MDCNavigationDrawer doesn't have any unit test
The fix
This adds the files to the build file and basic setup to add tests
Related bug
b/117175875