This function is invoked by MDCBottomSheetPresentationControllers when the bottom sheet dismissal animation has completed. This will be followed by a change to add a similar function to MDCActionSheetControllerDelegate, which will close the associated issue.
PiperOrigin-RevId: 314948223
In cases where there is a call and the status bar pushes the UITransitionView (container view) down by 20 points, we don't want the sheet view to take the Y offset of 20 points from the container view and add another 20 points to its Y origin as well.
PiperOrigin-RevId: 309715718
Currently setting the contentView's frame to its parent view is only done in viewDidLoad.
In that point in time, it is too early and the self.view.bounds height is still 0.
Due to that, in certain cases the view itself goes through a layout pass and updates itself to a frame height
that is larger than its parent view, causing problems like inability to scroll if it is a table view, as the content is already "fully displayed".
By setting the content view to the frame of the superview in viewWillAppear, we are assuring it stays the correct height.
PiperOrigin-RevId: 308593193
This CL makes it so that the bottom sheet presents in full screen when A) the bottom sheet presentation view controller's sheet container view's scroll view's content height is taller than the max height of the sheet, and B) the vertical size class is compact.
PiperOrigin-RevId: 307048307
We recommend using `initWithDefaults` and we should follow the recommendation. This change removes all usage of `init` within MDC components in order to let us remove that initializer from the public surface.
PiperOrigin-RevId: 302958447
This CL adds the presentingViewController's safeAreaInsets as additionalSafeAreaInsets on the presentedViewController in MDCBottomSheetPresentationViewController when the shouldPropagateSafeAreaInsetsToPresentedViewController is set to YES.
Originally I wasn't going to put this behavior behind a flag, but it was breaking some clients, so I added the flag.
PiperOrigin-RevId: 302683940
Prior to this change, it was possible to make the bottom sheet "wobble" on the x-axis if you threw it just right, or if you adjusted the width of the application in a split-screen environment.
This bug was due to the fact that bottom sheet is implemented with UIDynamics and it was using a stock UIAttachmentBehavior to animate the bottom sheet to its destination. UIAttachmentBehavior supports both x and y movement out of the box, but bottom sheet appears to have historically attempted to mitigate this fact by resetting the x velocity to 0 in several places. For example:
a42a84cca9/components/BottomSheet/src/private/MDCDraggableView.m (L63-L64)
and
a42a84cca9/components/BottomSheet/src/private/MDCDraggableView.m (L87-L88)
After this change, the bottom sheet's allowed range of movement will only be along the y axis. This is now enforced through a custom action block that explicitly resets the x position of the behavior's target to _targetPoint.x.
Closes https://github.com/material-components/material-components-ios/issues/9836
Closes https://github.com/material-components/material-components-ios/issues/5330
## Testing
Testing steps:
1. Open MDCDragons on an iPad.
2. Open the "Static content" Bottom Sheet example.
3. Present the bottom sheet.
4. Drag Safari from the dock to the side of the screen to enter split-screen mode.
4. Adjust the split screen divider to adjust the side of the MDCDragons app.
Verify that that bottom sheet is not wobbling on its x-axis.
Similarly, try tossing the bottom sheet up and to the left or up and to the right and verify that it does not wobble on its x-axis.
A reproduction of an issue found internally. To reproduce:
1. Navigate to this example
1. Turn VoiceOver on
1. Tap the button to display the bottom sheet
Expected behavior:
The bottom sheet becomes focused
Actual behavior:
The text field behind the bottom sheet reclaims focus after the bottom sheet finishes presenting
Reproduces #9773