170 Commits

Author SHA1 Message Date
Nobody
24a0ffbd03 Annotate various Delegate protocols as NS_SWIFT_UI_ACTOR
PiperOrigin-RevId: 708413470
2024-12-20 13:33:55 -08:00
Nobody
142d22b4ad Internal change.
PiperOrigin-RevId: 662202896
2024-08-12 13:19:27 -07:00
Nobody
bf1c24477e Copy the corner radius from the content view.
PiperOrigin-RevId: 560847739
2023-08-28 16:19:08 -07:00
Nobody
b2d18db8c1 Update draggable view to handle when gesture gets cancelled.
PiperOrigin-RevId: 557799889
2023-08-17 06:09:06 -07:00
Nobody
da7fe5ca4b Added nullability checks
PiperOrigin-RevId: 499315565
2023-01-03 14:22:46 -08:00
Nobody
515ba2f70e Fixed up imports and nullability for BottomSheet
PiperOrigin-RevId: 490088242
2022-11-21 15:39:51 -08:00
Jeff Verkoeyen
fbf2f90376 [BottomSheet] Delete the ShapeThemer library.
Also removed examples that made use of the ShapeThemer and removed all of the ShapeScheme examples.

PiperOrigin-RevId: 404270856
2021-10-19 08:45:05 -07:00
Jeff Verkoeyen
c34de39e30 Internal change.
PiperOrigin-RevId: 397316843
2021-09-17 07:45:01 -07:00
Randall Li
502bc5d910 Ran a Swift formatter
PiperOrigin-RevId: 395947664
2021-09-10 09:48:14 -07:00
Jeff Verkoeyen
ec44b12ee9 Internal change
PiperOrigin-RevId: 394725753
2021-09-03 11:44:01 -07:00
Cody Weaver
afd83e4c90 [ActionSheet] Inform delegate when action sheet is dismissed via Z-Gesture when VoiceOver is enabled.
PiperOrigin-RevId: 383731163
2021-07-08 15:52:30 -07:00
Wenyu Zhang
dfe9dcb58e [BottomSheet] Add ignoreKeyboardHeight to allow configuring bottomSheet's behavior when keyboard is present.
PiperOrigin-RevId: 369988303
2021-04-22 17:54:22 -07:00
Alyssa Weiss
14a603f05a Fix Bottom sheet bug that was causing flickering.
PiperOrigin-RevId: 368045962
2021-04-12 11:29:07 -07:00
Alyssa Weiss
ac810a4f38 Adjust content view frame when safe area insets change.
PiperOrigin-RevId: 365882840
2021-03-30 13:23:05 -07:00
Andrew Overton
4e245ac6dc [Multiple components] Miscellaneous doc updates
This PR closes out all current doc change requests.

Closes https://github.com/material-components/material-components-ios/pull/10181

COPYBARA_INTEGRATE_REVIEW=https://github.com/material-components/material-components-ios/pull/10181 from andrewoverton:dev-docs-03-15-cherry-pick 00414a4f89e39dfc8d47623ee95e0311db1c7ae7
PiperOrigin-RevId: 363178361
2021-03-16 07:30:36 -07:00
Jeff Verkoeyen
29803522c6 Optimizing imports
PiperOrigin-RevId: 357185525
2021-02-12 07:27:05 -08:00
Jeff Verkoeyen
9f9b452b3a Optimizing imports
PiperOrigin-RevId: 356850973
2021-02-10 16:15:17 -08:00
Nobody
d0ac5f2c83 [Material-iOS/Chips, Material-iOS/BottomSheet] Clean up markdown formatting.
PiperOrigin-RevId: 355431936
2021-02-03 10:52:31 -08:00
Andrew Overton
1b985100ec [BottomSheet] Add flag that turns off simulated bouncing when there isn't a tracking scroll view
PiperOrigin-RevId: 353639927
2021-01-25 07:14:17 -08:00
Alyssa Weiss
1fefeaf032 Add BOOL property for whether or not the height of the bottom sheet should adjust for safe area insets.
PiperOrigin-RevId: 353309637
2021-01-22 13:40:12 -08:00
Alyssa Weiss
4deaee1321 Fix bug that was causing messy animation when a keyboard is going to appear after the bottom sheet dismisses.
PiperOrigin-RevId: 351804762
2021-01-14 08:27:56 -08:00
Andrew Overton
82c0365549 [BottomSheet] Replace bottom sheet docs
Closes https://github.com/material-components/material-components-ios/pull/10138

PiperOrigin-RevId: 346322450
2020-12-08 07:40:27 -08:00
Andrew Overton
588d9d2fe5 [BottomSheet] Mask elevation on bottom edge
PiperOrigin-RevId: 332461973
2020-09-18 09:08:35 -07:00
Jeff Verkoeyen
fbb1f20aa2 Internal change
PiperOrigin-RevId: 332151481
2020-09-16 21:01:21 -07:00
Bryan Oltman
da4b8f7c7f Fix mdc_elevationDidChangeBlock block parameter types for Xcode 12
PiperOrigin-RevId: 331843566
2020-09-15 13:39:15 -07:00
Andrew Overton
225cd3c0cb [BottomSheet] Ensure transition controller pass-through accessors work following presentation controller initialization
PiperOrigin-RevId: 326304121
2020-08-12 13:49:59 -07:00
Nobody
87c8968e66 Updating BottomSheet examples organization
PiperOrigin-RevId: 315266913
2020-06-08 07:03:09 -07:00
Bryan Oltman
464f202058 [BottomSheet] Add bottomSheetDismissalAnimationCompleted method to MDCBottomSheetPresentationController.
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
2020-06-05 10:10:26 -07:00
Bryan Oltman
b169119b9f Internal change
PiperOrigin-RevId: 314926035
2020-06-05 07:47:15 -07:00
Bryan Oltman
4e461e2c13 [Catalog] Add BottomSheetPresentationControllerDelegateExample to demonstrate usage of MDCBottomSheetPresentationControllerDelegate.
PiperOrigin-RevId: 314784259
2020-06-04 12:47:00 -07:00
Bryan Oltman
ee0b388c5c [Catalog] Rename BottomSheetPresentationExample to BottomSheetModalPresentationExample to better represent its purpose.
PiperOrigin-RevId: 314778352
2020-06-04 12:18:05 -07:00
Yarden Eitan
65b749fb56 [BottomSheet] Have the container sheet be laid out by the container view's bounds, not frame.
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
2020-05-04 04:08:30 -07:00
Wenyu Zhang
c8ba09ff95 [BottomSheet]Set MDCSheetStateExtended for MDCBottomSheetController in its initializer.
PiperOrigin-RevId: 309121727
2020-04-29 16:36:28 -07:00
Wenyu Zhang
a3381717f7
Fix the bazel BUILD files and snapshot that were restored unintentionally.(#9983) 2020-04-29 11:00:00 -04:00
Randall Li
da90ed6640 [MDCBottomSheet] Better logging output in example.
PiperOrigin-RevId: 308843160
2020-04-28 10:01:41 -07:00
Randall Li
fa0e96173d [MDCBottomSheet] TableViewExample: Fixed swift format and added class description to example.
PiperOrigin-RevId: 308734272
2020-04-27 17:47:58 -07:00
Randall Li
ceff0080c1 [MDCBottomSheet] recreate bug in catalog.
Landscape presented tableviews resist scrolling up with longer content.

PiperOrigin-RevId: 308726855
2020-04-27 16:58:20 -07:00
Yarden Eitan
59631d0077 [BottomSheet] Set the contentView's frame later in the lifecycle.
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
2020-04-27 04:02:48 -07:00
Randall Li
0100cfe414 [MDC-iOS/BottomSheet] Fix dismissOnDraggingDownSheet behavior
The bottom sheet incorrectly allowed the sheet to be drag dismissed when `dismissOnDraggingDownSheet` was set to NO.

This change permits the gesture to dismiss to begin but prevents it from actually closing the sheet.

https://github.com/material-components/material-components-ios/issues/9723

Closes https://github.com/material-components/material-components-ios/pull/9885

PiperOrigin-RevId: 307802500
2020-04-22 06:21:26 -07:00
Dave MacLachlan
ebac2a8eb7 As of iOS 9/macOS 10.11 (circa 2015) removing objective C objects from the NSNotificationCenter in - (void)dealloc. is no longer required (the classic example is: [[NSNotificationCenter defaultCenter] removeObserver:self] but there are several variations).
In many cases this is the only thing being done in - (void)dealloc, so we can remove the whole thing.

PiperOrigin-RevId: 307663440
2020-04-21 13:00:30 -07:00
Andrew Overton
b5c894e7e3 Present in full screen in vertical compact size classes when the content height is taller than the sheet view's bounds.
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
2020-04-17 08:33:02 -07:00
Jeff Verkoeyen
8abbb099a9 Delete all bazel support.
We no longer support bazel.

This PR deletes everything related to bazel support from our repo.

Closes https://github.com/material-components/material-components-ios/pull/9968

PiperOrigin-RevId: 306227127
2020-04-13 07:13:47 -07:00
Jeff Verkoeyen
1cf770cc40 [BottomSheet] Deprecate the ShapeThemer.
PiperOrigin-RevId: 305856422
2020-04-10 04:14:38 -07:00
Cody Weaver
fdf87c5995 [MDC/ColorScheme] Remove usage of init within MDC.
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
2020-03-25 13:36:51 -07:00
Andrew Overton
3b7dfcd48c Give MDCBottomSheetPresentationController an opt-in mechanism to propagate presentingViewController safeAreaInsets to the presentedViewController.
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
2020-03-24 09:42:50 -07:00
Bryan Oltman
c6a586b72e [BottomSheet] Remove private header imports from MaterialBottomSheet.h
PiperOrigin-RevId: 301909458
2020-03-19 15:41:07 -07:00
Bryan Oltman
7cd01d2fba [BottomSheet] Move protocol definitions into separate header files
PiperOrigin-RevId: 301859388
2020-03-19 11:39:10 -07:00
featherless
2ca4e3e229
[BottomSheet] Anchor movement of the bottom sheet along the y axis. (#9835)
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.
2020-03-05 10:58:09 -05:00
Bryan Oltman
d83af534c3
[TextFields] implement resignFirstResponder in MDCMultilineTextField (#9793) 2020-02-25 16:17:19 -05:00
Bryan Oltman
00a4f37a4a
[BottomSheet] Add example to reproduce issue 9773 (#9789)
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
2020-02-24 17:48:35 -05:00