206 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
faa02acbc7 Fixing setting the value of userDraggingEnabled on the container view.
PiperOrigin-RevId: 560700809
2023-08-28 07:08:30 -07:00
Cody Weaver
f9eb3494e3 #NavigationDrawer Disable failing tests
PiperOrigin-RevId: 555627853
2023-08-10 13:26:58 -07:00
Wenyu Zhang
4f49af7c18 Internal change
PiperOrigin-RevId: 540666237
2023-06-15 13:07:13 -07:00
Nobody
c2cb0dfaf9 Internal change.
PiperOrigin-RevId: 509415755
2023-02-13 20:56:29 -08:00
Nobody
26322ea4c7 Internal change.
PiperOrigin-RevId: 501158621
2023-01-10 19:50:39 -08:00
Wenyu Zhang
260beed020 [NavigationDrawer] Fix a reverse ordered CGRectMake.
PiperOrigin-RevId: 501011247
2023-01-10 09:11:49 -08:00
Nobody
4f1010ffd1 Fixed up imports for NavigationDrawer
PiperOrigin-RevId: 478778261
2022-10-04 07:25:05 -07:00
Jeff Verkoeyen
72dcc44075 Internal change
PiperOrigin-RevId: 468184898
2022-08-17 06:51:30 -07:00
Nobody
2e87aca41b [NavigationDrawer] Allow clients to set the accessibility details of the scrimView.
PiperOrigin-RevId: 428843717
2022-02-15 12:15:00 -08:00
Wenyu Zhang
b457b13005 Internal change.
PiperOrigin-RevId: 417635153
2021-12-21 09:32:05 -08:00
Cody Weaver
c827288338 [NavigationDrawer] Allow clients to present an NavigationDrawer in non-fullscreen when VoiceOver is enabled.
PiperOrigin-RevId: 411878007
2021-11-23 13:10:02 -08:00
Cody Weaver
26c400a0a3 [NavigationDrawer] Update imports.
PiperOrigin-RevId: 411848444
2021-11-23 10:55:28 -08:00
Jeff Verkoeyen
86a8c97dc7 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 400788645
2021-10-04 12:41:07 -07:00
Jeff Verkoeyen
dc067749f1 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 400786978
2021-10-04 12:36:05 -07:00
Nobody
b498aa66b5 Adds a property (swipeToDismissEnabled) to MDCBottomDrawerViewController which allows to disable swiping to dismiss. This means that the user will still be able to drag the drawer up and down, but the drawer will bounce back up if it's dragged down past its bottom resistance point, instead of being dismissed like it usually would. If the user should not be able to drag the drawer at all, the userDraggingEnabled property should be used instead.
PiperOrigin-RevId: 399820541
2021-09-29 18:07:44 -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
Jeff Verkoeyen
9a49fd96f9 Internal change.
PiperOrigin-RevId: 366342462
2021-04-01 15:26:22 -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
Yarden Eitan
1e8dcc273e [NavDrawer] Increase code coverage by adding more tests.
PiperOrigin-RevId: 358039838
2021-02-17 15:00:27 -08:00
Jeff Verkoeyen
b3fa42005b Optimizing imports
PiperOrigin-RevId: 356966407
2021-02-11 07:12:37 -08:00
Nobody
6b4b0290a9 [Manage People/Links] Rotation UI Bug Fix
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
2021-01-12 14:58:26 -08:00
Nobody
e042db3104 Adds a property to MDCBottomDrawerViewController which allows to disable scrolling. It essentially exposes the 'scrollEnabled' property of the internal scroll view so that users may not drag the drawer manually. Programatic modifications of the content offset are still allowed.
PiperOrigin-RevId: 351146276
2021-01-11 07:12:28 -08:00
Nobody
8ce4ebebd6 [Manage People/Links] Added presentingViewYOffset to contentHeightSurplus in MDCBottomDrawerContainerViewController
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
2020-12-11 11:18:30 -08:00
Andrew Overton
fb4d874f62 [Multiple components] Change component README ToCs to bold paragraph style
PiperOrigin-RevId: 346365613
2020-12-08 11:09:33 -08:00
Nobody
1d2349b616 [Manage People/Links] Removed a condition for presentingViewYOffset in MDCBottomDrawerContainerViewController
BEGIN_PUBLIC
Updated the `presentingViewYOffset` conditional in `MDCBottomDrawerContainerViewController`. Checking the `verticalSizeClass` trait doesn't seem to provide value for the conditional seeing as regardless of screen size we would still need a y offset and would default to zero if the value wasn't large enough anyways. Taking off this conditional would also make it easier to create unit tests for a future related CL that will take the `presentingViewYOffset` into account. I tested this change by running the drive app and the material catalog app to search for an UX discrepancies. I also ran the unit and snapshot tests associated with this class and they passed fine with just a small change in the golden image needed
END_PUBLIC

PiperOrigin-RevId: 345987236
2020-12-06 15:39:28 -08:00
Andrew Overton
62ccb5c72f [Multiple components] Audit recent docs changes, part 2
Closes https://github.com/material-components/material-components-ios/pull/10135

PiperOrigin-RevId: 345473101
2020-12-03 09:54:14 -08:00
Nobody
6ad0683d1a [BottomDrawer] Fix the bug caused by regression in the PR "Optional dismiss on accessibilityPerformEscape", where the forwarded touch events are interfered by gesture recognizer introduced in the CL.
Cause:
The variable dismissOnBackgroundTap should be used to determine whether gesture recognizer is added to the presentation view controller. When the check was removed, gesture recognizer is interfering and touchesended is not propagated.
Fix:
Add back the check and add tap gesture recognizer only when dismissOnBackgroundTap is set to true.

PiperOrigin-RevId: 336292017
2020-10-09 07:51:04 -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
Nobody
e79fd9b191 [MDCBottomDrawerViewController] Optional dismiss on accessibilityPerformEscape.
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
2020-09-14 20:32:48 +00:00
Andrew Overton
a278ec6b07 [NavigationDrawer] Replace navigation drawer component README
This PR replaces the navigation drawer README.

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

PiperOrigin-RevId: 327849095
2020-08-21 12:01:40 -07:00
Nobody
4cba6bbf5c [MDCBottomDrawerViewController] Adds shouldDisplayMobileLandscapeFullscreen property to MDCBottomDrawerContainerViewController and MDCBottomDrawerPresentationController to share the property between MDCBottomDrawerContainerViewController and MDCBottomDrawerViewController.
This adds a new property to MDCBottomDrawerViewController and MDCBottomDrawerContainerViewController that allows for non-fullscreen mobile landscape bottom drawer view.

PiperOrigin-RevId: 327626953
2020-08-20 08:06:39 -07:00
Nobody
d63936f671 [MDCBottomDrawerViewController] Adds shouldDisplayMobileLandscapeFullscreen property to MDCBottomDrawerViewController.
This adds a new property to MDCBottomDrawerViewController that allows for non-fullscreen mobile landscape bottom drawer view.

PiperOrigin-RevId: 327070504
2020-08-17 12:14:11 -07:00
featherless
8cea56b405 Enable Catalyst support for the catalogs.
Turning this support on revealed a new class of error:

```
Implicit conversion from integral type 'int' to 'BOOL'
```

These errors have been fixed where applicable.

Note that due to https://stackoverflow.com/questions/58547010/ios-catalyst-cocoapod-framework-error-signing-requires-a-development-team, each of the icons pod targets needs to have its Signing Certificate value manually set to "Sign to Run Locally".

Separately, due to https://github.com/onmyway133/blog/issues/572 we also need to disable Library Validation on the projects.

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

COPYBARA_INTEGRATE_REVIEW=https://github.com/material-components/material-components-ios/pull/10059 from jverkoey:catalyst 66127447f2d9e26942f2543ccdb3d2963caa30fa
PiperOrigin-RevId: 326058707
2020-08-11 11:10:36 -07:00
Nobody
f3b77c466b [MDCBottomDrawerViewController] Add new delegate for when scrim is tapped.
This adds a new optional MDCBottomDrawerViewController delegate method for when the scrim is tapped.

PiperOrigin-RevId: 324593723
2020-08-03 06:43:52 -07:00
Andrew Overton
07c46757cc Replace material.io API doc links with links to the relevant header f…
This PR replaces API links containing "/api-docs/" with links to suitable header files in GitHub because the site previously linked to is being taken down and replaced with something that won't handle API docs.

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

COPYBARA_INTEGRATE_REVIEW=https://github.com/material-components/material-components-ios/pull/10045 from andrewoverton:replace-mio-api-docs-with-github-links 0d6e56cc11d0c147366a4f6cde829d8b51567ecc
PiperOrigin-RevId: 323424362
2020-07-27 13:09:23 -07:00
Yarden Eitan
45c4130d18 [NavDrawer] Make sure to update color of scrim view background when trait collection changes its user interface style.
PiperOrigin-RevId: 321385466
2020-07-15 10:20:45 -07:00
Jake Rockland
dde7180692 Update the MDCBottomDrawerViewController MDC themer to use dynamic colors.
PiperOrigin-RevId: 321004879
2020-07-13 12:07:23 -07:00
Nobody
54b62c91da Fix bug - New task options don’t have enough padding in iPad Slide Over.
(One of the previous MDCBottom* CLs was reverted b/c the layout changes caused a bug in OneGoogle's bottom drawer spec. This CL has a property described below that allows apps to adopt the change on their own schedule.)

BEGIN_PUBLIC
Fix bug where MDCBottomDrawerContainerViewController has the size of the screen instead of the window when in iPad Slide Over.

1) Update the MDCBottom* classes with properties and layout adjustments to have the container view controller use the window's size instead of the screen's size in iPad Slide Over.
2) Default this new property to NO to maintain old behavior for all other apps that use MDCBottom* to avoid forced adoption and potential bugs.
END_PUBLIC

MDCBottomDrawerContainerViewController has the wrong size in iPad Slide Over (when the window height is shorter than the screen height), causing GTETaskCreationViewController to have the wrong y origin b/c it thinks it's within a taller window.

Before and after screenshots in b/159595242.

PiperOrigin-RevId: 320475781
2020-07-09 14:38:08 -07:00
Nobody
b4ceacb4aa Automated g4 rollback of changelist 319253730.
BEGIN_PUBLIC
Revert MDC Bottom Drawer behavior change for iPad Slide Over.

The change introduced issues in downstream components.
END_PUBLIC

*** Reason for rollback ***

The original CL changes OneGoogle's bottom drawer behavior against the spec.

See b/160351551

*** Original change description ***

Fix bug where MDCBottomDrawerContainerViewController has the size of the screen instead of the window when in iPad Slide Over.

BEGIN_PUBLIC
Fix bug where MDCBottomDrawerContainerViewController has the size of the screen instead of the window when in iPad Slide Over.
END_PUBLIC

MDCBottomDrawerContainerViewController has the wrong size in iPad Slide Over (when the window height is shorter than the screen height), causing GTETaskCreationViewController to have the wrong y origin b/c it thinks it'...

***

PiperOrigin-RevId: 319809092
2020-07-06 10:42:49 -07:00
Nobody
29a39ea375 Fix bug where MDCBottomDrawerContainerViewController has the size of the screen instead of the window when in iPad Slide Over.
BEGIN_PUBLIC
Fix bug where MDCBottomDrawerContainerViewController has the size of the screen instead of the window when in iPad Slide Over.
END_PUBLIC

MDCBottomDrawerContainerViewController has the wrong size in iPad Slide Over (when the window height is shorter than the screen height), causing GTETaskCreationViewController to have the wrong y origin b/c it thinks it's within a taller window.

Note: this is 1 of 2 parts to the fix for b/only fixes. The after screenshots below are only partially correct and will be fixed in the next CL.

Before and after screenshots in b/159595242.

PiperOrigin-RevId: 319253730
2020-07-01 10:44:17 -07:00
Jake Rockland
ae438a451d Update the MDCBottomDrawerViewController MDC themer to use dynamic colors.
PiperOrigin-RevId: 319047848
2020-06-30 10:26:27 -07:00
Josue Lopes
b9e0382425 [Navigation Drawer] Updated documentation
The `</ul>` tag is not required to create the list.

When opening the [Navigation Drawer](https://material.io/develop/ios/components/navigation-drawer/) page, the tag was presented when reading the document.

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

COPYBARA_INTEGRATE_REVIEW=https://github.com/material-components/material-components-ios/pull/9986 from Josue10599:patch-1 a09708ee844937468d8302bb54cc63b7856729d1
PiperOrigin-RevId: 317834851
2020-06-23 03:36:50 -07:00
Nobody
a5c3b4938a [NavigationDrawer] Add method to theming extension to color tracking scrollview.
This change adds a new theming method, `-[MDCBottomDrawerViewController+MaterialTheming applyThemeWithScheme:applyToTrackingScrollView:]` to allow clients to opt-in to functionality which sets `-[MDCBottomDrawerViewController trackingScrollView].backgroundColor` to the theme's background color.

PiperOrigin-RevId: 317116346
2020-06-18 09:22:59 -07:00
Cody Weaver
11db172e79 [NavigationDrawer] Fix bug where maximumDrawerHeight wouldn't allow for the correct height.
In 33daf325e6 (diff-a3db687b7d16849448cb7f189976eb0f) we added this property to allow the drawer to support max height. In adding this property my assumption was that we needed to shift the scroll view down by the amount of the topSafeArea but this is an incorrect assumption, we should leave it to the client to determine the height of the drawer an not _magically_ shift it down by an amount. Also, we tied the drawer max height to the `shouldIncludeSafeAreaInContentHeight` to the height of the drawer this caused the drawer to be shifted down by the safeArea.bottom height. The property `shouldIncludeSafeAreaInContentHeight` is related to the `maximumInitialDrawerHeight` property but not the `maximumDrawerHeight` property. Both of these values should be on the client to pass in instead of us _magically_ shifting down potentially causing issues where a client expects the drawer to be "x" height but it shows as "x - (safeArea.top + safeArea.bottom)".

Tested via the catalog examples.

PiperOrigin-RevId: 314127239
2020-06-01 07:39:06 -07:00
Cody Weaver
57f25fd95a [NavigationDrawer] Clarify trackingScrollView API.
We recommend clients set the tracking scroll view of the navigation drawer so that they have a smooth scrolling experience but before this change it could be confusing if we intended clients to set this property to a scroll view from their content view controller or if it was an internal one.

PiperOrigin-RevId: 314124930
2020-06-01 07:18:25 -07:00
Cody Weaver
2d533759d1 [NavigationDrawer] Fix bug where setting maximumDrawerHeight and maximumInitialDrawerHeight would allow scrolling.
If a client sets the `maximumDrawerHeight` and the `maximumInitialDrawerHeight` to the same value then the drawer should be opened to its _max_ height. Currently if that happens the drawer allows for _safeArea.top_ pts of scrolling. This is due to us adjusting the `contentHeaderTopInset` which is then used to layout all the content. We typically adjust it because we assume that the header adds the _safeArea.top_ pts to it's height as it approaches the safe area. So really the `contentHeaderTopInset` typically _maxes out_ at that amount but if we never approach the safe area then we need to allow for this value to be 0.

Tested in the Catalog via Infinite Scrolling example.

PiperOrigin-RevId: 313814020
2020-05-29 11:11:06 -07:00