176 Commits

Author SHA1 Message Date
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
Cody Weaver
33daf325e6 [MDC/NavDrawer] Support a max height
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
2020-05-26 10:09:53 -07:00
Andrew Overton
755a10e3be [NavigationDrawer] Add NavigationDrawer theming target to podspec
When the source files for the NavigationDrawer theming extension were added the podspec wasn't updated. This change updates the podspec and renames an incorrectly-named file.

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

COPYBARA_INTEGRATE_REVIEW=https://github.com/material-components/material-components-ios/pull/9996 from andrewoverton:update-navigationdrawer-theming-target 44389e5dd73b5fdb4cfd5f9651ed36e9ad638570
PiperOrigin-RevId: 312270981
2020-05-19 06:56:59 -07:00
Nobody
70716800b8 Internal change
PiperOrigin-RevId: 312085611
2020-05-18 16:41:12 +00:00
Wenyu Zhang
a3381717f7
Fix the bazel BUILD files and snapshot that were restored unintentionally.(#9983) 2020-04-29 11:00:00 -04:00
Jeff Verkoeyen
25471afea0 Rename "flaky" to "skip_snapshots".
PiperOrigin-RevId: 308259307
2020-04-24 08:34:12 -07:00
Jeff Verkoeyen
92254ea119 Rename all icons to an ic_<#name#> convention.
PiperOrigin-RevId: 308232277
2020-04-24 04:33:51 -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
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
c2c1cc64b3 [Catalog] Expose the catalog by convention tree via the AppDelegate and walk the tree with the UI test runner.
This allows our UI test runner to fetch the catalog by convention tree at runtime in order to generate dynamic test runners that walk the entire catalog by convention tree without requiring maintenance of an explicit list of breadcrumbs.

In this change I have replaced the explicit list of components with such a dynamic walker. In a follow-up change we will be able to dynamically walk through every node of the three and take screenshots. In a subsequent change from there we may allow certain nodes to implement "testActionStart" and "testActionStop" methods that allow the test runner to invoke certain canonical actions automatically (e.g. present a dialog).

A couple examples are flaky, so a new convention has been added to those examples of providing a "flaky" tag on the example's metadata. If this flag is YES, then the example will not be snapshotted.

PiperOrigin-RevId: 306214455
2020-04-13 09:26:51 -04:00
Jake Rockland
c7ff69c0bd [NavigationDrawer][Xcode 11][iOS 13] Update MDCBottomDrawerContainerViewController to present fullscreen when Voice Over or Switch Control is running, even when the view controller presenting the bottom drawer is not presented fullscreen (ex. is presented with new iOS 13 pageSheet presentation style), by using presentingViewYOffset that is used to make adjustments for these non-fullscreen presentation styles when not forcing the drawer to present fullscreen.
NOTE: This will also fix a similar issue from occurring if a client explicitly specifies `shouldPresentAtFullscreen` for their drawer presentation.
PiperOrigin-RevId: 304639191
2020-04-03 10:09:21 -07:00
Jake Rockland
a7451b084c [NavigationDrawer][Xcode 11][iOS 13] Update MDCBottomDrawerContainerViewController to account for non-full screen presentation styles when the content is large enough to scroll to fullscreen, by adjusting the container and scroll view height rather than just adjusting the scroll view offset.
PiperOrigin-RevId: 303175728
2020-03-26 15:57:47 -04: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
Bryan Oltman
a5efd6c350 [NavigationDrawer] Move protocol definitions into separate header files
PiperOrigin-RevId: 302060577
2020-03-20 11:04:07 -07:00
Jake Rockland
5efa798ac3 [NavigationDrawer] This CL makes it such that when bottomSafeAreaInsetsToAdjustContainerHeight is set to YES, for performant scrolling the safe area is respected in calculating the max scroll origin, preventing a safe area presentation issue.
PiperOrigin-RevId: 301587954
2020-03-18 07:53:47 -07:00
Jake Rockland
800e5b64ec This closes b/151091406, which was being caused because the presenting view controller is used to determine the frame of the bottom drawer's scroll view, which caused issues for situations in which the bottom drawer was presented from a modal view controller in the page or form sheet style.
This resolves said issue by adding an adjustment for the difference if applicable.

This change is necessary to fully support changes in modal presentation style as of iOS 13 + Xcode 11, which is important for clients because building with SDK 13/Xcode 11 is required for app store submission starting April 2020.

I verified this by testing the solution as it applies to our internal related bug, b/151091406, as well as by verifying this solution in the example project attached to the original reporting of this bug, b/148977218, and have added screencasts of this below (also attached to original bug for easier viewing).

As a sanity check, I also applied these changes to the catalog application and verified that it does not break any of the examples for this component.

PiperOrigin-RevId: 301395392
2020-03-17 10:03:38 -07:00
Randall Li
43706fa2f9
Delete NavigationDrawer OWNERS file (#9696)
This file has the PII of Googlers.

https://github.com/material-components/material-components-ios/blob/stable/CODEOWNERS is github friendly version of the same information.
2020-02-13 13:21:04 -05:00
Nobody
b8ffaabc73 Internal Change
PiperOrigin-RevId: 293891746
2020-02-07 14:15:39 -08:00
Jake Rockland
8c2e4e2c40 [NavigationDrawer][A11y] Improve behavior when navigating the bottom drawer with Voice Over. This change makes it possible to navigate back and forth between the headerViewController and contentViewController, without VO getting stuck, by making the view hierarchy's accessibilityElements explicit.
PiperOrigin-RevId: 293533815
2020-02-06 00:10:20 -08:00
Jake Rockland
000f0d8ddd [NavigationDrawer] Improve swipe-down-to-dismiss behavior for drawers where drawer content is less than 160. This adjustment ensures that for drawer contents that are quite small (ex. 100pt) the drawer contents to not become undismissable. Without this adjustment it is nearly impossible to achieve a scroll offset of (40pt), the current kVerticalDistanceDismissalThreshold, making the drawer effectively undismissable.
PiperOrigin-RevId: 293446935
2020-02-05 14:08:57 -08:00
Yarden Eitan
19c171280b [NavigationDrawer] Add ability to change the maximumInitialDrawerHeight after drawer has been presented.
PiperOrigin-RevId: 292305019
2020-01-30 02:06:23 -08:00
Yarden Eitan
62fc063481 [NavigationDrawer] Adding a flag to allow clients to opt-in to when the preferredContentSize of the contentViewController changes, it visually updates the drawer height.
PiperOrigin-RevId: 292303752
2020-01-30 01:57:11 -08:00
Jake Rockland
a9789f280d [NavigationDrawer] Update documentation basic examples for MDCBottomDrawerViewController usage.
PiperOrigin-RevId: 292159096
2020-01-29 09:43:17 -08:00
Yarden Eitan
6ac24af12d Add contributor to OWNERS file
PiperOrigin-RevId: 292143787
2020-01-29 08:12:55 -08:00
Nobody
54fd1dac39 Refactor CGFloat topAreaInsetForHeader = (self.headerViewController ? self.topSafeAreaInset : 0); usage into its own private method.
PiperOrigin-RevId: 292048359
2020-01-28 23:05:16 -05:00
Nobody
16c1cf8932 Use positive booleans to improve readability of height layout calculations.
PiperOrigin-RevId: 292045083
2020-01-28 23:04:11 -05:00
Nobody
31c3cd7340 Use keyWindow top inset to maintain backwards consistency with behavior prior to moving off of MDCDeviceTopSafeAreaInset.
PiperOrigin-RevId: 292041789
2020-01-28 23:03:01 -05:00
Nobody
c9eba44c69 Implemented opt-in ability to have a "sticky" view, presented behind top safe area, when a headerViewController is not provided (continuation of #9464).
PiperOrigin-RevId: 292038584
2020-01-28 23:01:55 -05:00
Nobody
afe22513f7 Move off of MDCDeviceTopSafeAreaInset (continuation of #9476).
PiperOrigin-RevId: 291998789
2020-01-28 13:17:56 -08:00
Jeff Verkoeyen
e2197af115 Revert "[NavigationDrawer] Enable changing the preferred size and maximum height (#8224)"
This reverts commit 3112e8e228ea7914a111b0f3dbc4ed9919bf24b7.
2020-01-27 07:37:46 -05:00