31 Commits

Author SHA1 Message Date
rami-a
bff3fcf7f1
[Buttons] [MaskedTransition] Apply safe area to floating button example and masked transition example (#5389)
This change applies the safe area to the examples for Floating Button and Masked Transition so that they appear correct on notched displays in landscape.

Closes #3702 
Closes #3714 

Floating Buttons Before:
![simulator screen shot - iphone x - 2018-10-10 at 12 53 13](https://user-images.githubusercontent.com/2364772/46752602-a4128e00-cc8b-11e8-8d58-32255db304af.png)

Floating Buttons After:
![simulator screen shot - iphone x - 2018-10-10 at 12 52 33](https://user-images.githubusercontent.com/2364772/46752584-9a892600-cc8b-11e8-9f8f-fafbc67e2a8b.png)

Masked Transition Before:
![simulator screen shot - iphone x - 2018-10-10 at 12 53 23](https://user-images.githubusercontent.com/2364772/46752610-a8d74200-cc8b-11e8-8ed9-ba010d279d9a.png)


Masked Transition After:
![simulator screen shot - iphone x - 2018-10-10 at 12 52 28](https://user-images.githubusercontent.com/2364772/46752564-91985480-cc8b-11e8-82e6-1458de23c38a.png)

Additionally, I noticed in the Masked Transition example that the left/right fabs were swapped in their position so I fixed this. I also applied the safe area to the fullscreen transition example.
2018-10-10 16:48:34 -04:00
Cody Weaver
9684ff485b
[MaskedTransition] Update Swift example to use MDCFloatingButton (#5028)
Previously we didn't use MDCFloatingButton or any themers in our example, this adds that.

| Before | After |
| ------- | ------- |
|![simulator screen shot - iphone x - 2018-09-06 at 15 32 16](https://user-images.githubusercontent.com/7131294/45180672-10602480-b1ea-11e8-8299-a411eed29b03.png)|![simulator screen shot - iphone x - 2018-09-06 at 15 28 36](https://user-images.githubusercontent.com/7131294/45180679-13f3ab80-b1ea-11e8-8b9a-cfce78bc2588.png)|
2018-09-07 12:49:13 -04:00
featherless
2181084272
[automated] Standardize our open source license stanza to what Xcode generates. (#4985)
Removes the need to copy-paste stanzas from other files anymore as we'll rely on #4478 to generate the correct stanza for us instead.

This was an automated change generated by running a find-and-replace regular expression:

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at

 http://www\.apache\.org/licenses/LICENSE-2\.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
/\*
Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

Licensed under the Apache License, Version 2\.0 \(the "License"\);
you may not use this file except in compliance with the License\.
You may obtain a copy of the License at

http://www\.apache\.org/licenses/LICENSE-2\.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
See the License for the specific language governing permissions and
limitations under the License\.
\*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at
 http://www\.apache\.org/licenses/LICENSE-2\.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
// Copyright $1-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
```
2018-08-31 12:13:07 -04:00
Jeff Verkoeyen
9854044c96 Revert "[automated] Standardize our open source license stanza to what Xcode generates. (#4982)"
This reverts commit b45bc2fdd4dfe12fc76751a45c9cf7b0d6c1261f.
2018-08-31 12:01:24 -04:00
featherless
b45bc2fdd4
[automated] Standardize our open source license stanza to what Xcode generates. (#4982)
Removes the need to copy-paste stanzas from other files anymore as we'll rely on https://github.com/material-components/material-components-ios/pull/4478 to generate the correct stanza for us instead.

This was an automated change generated by running a find-and-replace regular expression:

### Find

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.

 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at

 http://www\.apache\.org/licenses/LICENSE-2\.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

```
/\*
 Copyright ([0-9]+)-present the Material Components for iOS authors\. All Rights Reserved\.
 Licensed under the Apache License, Version 2\.0 \(the "License"\);
 you may not use this file except in compliance with the License\.
 You may obtain a copy of the License at
 http://www\.apache\.org/licenses/LICENSE-2\.0
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied\.
 See the License for the specific language governing permissions and
 limitations under the License\.
 \*/
```

### Replace

```
// Copyright $1-present the Material Components for iOS authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
```
2018-08-31 11:49:00 -04:00
Yarden Eitan
3480c50c67
updated to newest CbC standard (#4956)
Move to the new CbC standard released in CatalogByConvention v2.5.0. See PR: material-foundation/cocoapods-catalog-by-convention#27 for more info on the change.
2018-08-29 20:45:13 -04:00
Robert Moore
b917bf24d6
[List] [MaskedTransition] Fix Swift imports (#4828)
So that the examples will compile
2018-08-17 16:13:06 -04:00
trungducc
2856ce9168 [MaskedTransition] Update README.md (#4758)
Closes #4751
2018-08-10 07:58:38 -04:00
featherless
a078a9722d
Standardize the casing for all components to match spec. (#3693) 2018-05-03 15:02:36 -04:00
Adrian Secord
7a7293883f
Remove space after triple-backtick Markdown syntax. (#3577) 2018-04-29 09:00:53 -04:00
featherless
44515ba81a
Convert MaskedTransition from a MotionTransitioning Transition type to a vanilla UIKit type (#3070)
This simplifies the layers between the app developer and the transition implementation while also allowing us to reduce the complexity of the MotionTransitioning APIs. In the near future we will remove nearly all of the MotionTransitioning abstractions in favor of providing a small set of tools and APIs for building plain UIKit transitions.

Notably:

- MaskedTransition is now a private API.
- There is a new MaskedTransitionController type that must be instantiated and stored for the lifetime of the presented view controller.
- MaskedTransition is no longer a Transition type.
- MaskedTransition now simply implements the animated view controller transitioning APIs.
- MaskedTransitionController vends MaskedTransition instances as required.

Example usage:

```swift
let transitionController = MDCMaskedTransitionController()
func didTapFab(fab: UIView) {
  let vc = SomeViewController()

  vc.view.autoresizingMask = [.flexibleLeftMargin, .flexibleTopMargin,
                              .flexibleRightMargin, .flexibleBottomMargin]

  // Customize the transition
  transitionController.sourceView = fab
  transitionController.calculateFrameOfPresentedView = { info in
    let size = CGSize(width: 200, height: 200)
    return CGRect(x: (info.containerView!.bounds.width - size.width) / 2,
                  y: (info.containerView!.bounds.height - size.height) / 2,
                  width: size.width,
                  height: size.height)
  }
  vc.modalPresentationStyle = .custom
  vc.transitioningDelegate = transitionController

  showDetailViewController(vc, sender: self)
}
```
2018-04-02 12:28:45 -04:00
Yarden Eitan
7b742b5745
[Kokoro / CI] Have Kokoro test multiple iOS versions and simulators on different Xcodes. (#3117)
* Remove dependency on Travis by having Kokoro test multiple iOS versions and simulators on different Xcodes.

* refactor

* refactor

* refactor
2018-03-21 09:40:30 -04:00
Mohammad Cazi
261828a056
[Warnings Fix] Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior. (#2933)
* Warning Fix: Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior.

* 100 char limit.
2018-02-14 15:47:07 -05:00
ianegordon
49de50edae Consolidate installation requirements in the main README (#2809) 2018-01-05 13:50:38 -05:00
Yarden Eitan
29d760c7d6
Added isPresentable to catalog files, ported over ZShadow to dragons. (#2726) 2017-12-15 12:20:35 -05:00
Robert Moore
5746134132 [MaskedTransition] Add BUILD file and no-op test (#2708) 2017-12-14 02:21:23 -05:00
featherless
b9404ded10
Revert "Add compile time flag for import style (#2562)" (#2612)
This reverts commit 6791dc4993d3a0ffa11735eeeef0583102621d52.
2017-12-06 11:22:17 -05:00
Louis Romero
6791dc4993
Add compile time flag for import style (#2562)
Closes #2550
2017-12-04 10:06:31 -08:00
featherless
3832377382 Bump the transitioning dependency to v5.0.0 (#2525)
* Bump the transitioning dependency to v5.0.0

* Bump Dialogs.

* Update example.
2017-11-29 11:35:56 -05:00
featherless
2ab8cf5c78
[MaskedTransition] Convert motion spec to an Objective-C static class. (#2460)
* [MaskedTransition] Convert motion spec to an Objective-C static class.

The interchange library will soon be dropping support for static spec initialization in favor of runtime APIs. This change moves the MaskedTransition off of all macro-based APIs.

* Fix API name.

* Fix type.

* Types.
2017-11-17 13:41:36 -05:00
featherless
655712a616
[MaskedTransition] Update the component with MotionAnimator v2 APIs. (#2386) 2017-11-09 22:23:59 -05:00
Robert Moore
4d49d02d13
[MaskedTransition] Fix imports of private headers (#2331)
Also added missing UIKit import.
2017-11-03 09:21:41 -04:00
Martin Petrov
f98a9d42ed @objc annoaing catalog by convention (#2305) 2017-10-30 10:24:17 -04:00
featherless
7d1f3aed00 [MaskedTransition] Fix bug where transitions wouldn't complete. (#2293)
This bug was introduced by the upgrade to MotionTransitioning 4.0. 4.0 requires that if a presentation controller implements MDMTransition, that its start method eventually invokes transitionDidEnd.
2017-10-27 11:32:44 -04:00
featherless
c4b7bce94e [MaskedTransition] Use the provided key path consts from MotionAnimator. (#2294) 2017-10-26 16:03:10 -04:00
featherless
b238e8bbf3 [MaskedTransition] Upgrade to MotionTransitioning v3.3.0. (#2077)
* Upgrade MaskedTransition to MotionTransitioning v3.3.0.

* Update demos/Bare/Podfile.lock.
2017-10-03 14:35:40 -04:00
Robert Moore
8940d77d6d [Catalog] Verify all examples provide CatalogByConvention methods (#1911)
All examples now have at least the required `+catalogBreadcrumbs` and `+catalogIsPrimaryDemo`.  All examples in the same breadcrumbs path have only one primary demo.  There should be only one `-catalogDescription` attached to the primary demo.

Closes #1897
2017-08-31 08:46:10 -04:00
Robert Moore
5498005f65 [Catalog] Enabling all "unused" warnings (#1875)
Re-enabling warnings for unused parameters. Turning on every other
unused warning I could find.

Closes #1874
2017-08-29 17:57:41 -04:00
Adrian Secord
b89b714964 [Jazzy] Ran scripts/generate_jazzy_yamls.sh for new components. (#1766) 2017-08-10 16:22:49 -04:00
Adrian Secord
9e885d9f75 [MDCMaskedTransition] Fixed Xcode 9 block declaration. 2017-08-09 18:25:54 -04:00
featherless
61acb1cbb0 Add Masked Transition component. (#1513)
* Add Masked Transition component.

This component makes it possible to present a view controller from a source view, such as a floating action button, using a masked reveal transition.

This component depends on Material Motion's Transitioning, MotionInterchange, and MotionAnimator libraries.

The component itself is a Transition instance and can be used like this:

    vc.transitionController.transition = MDCMaskedTransition(sourceView: fab)
    present(vc, animated: true)

The component's motion is defined in its motion spec and was extracted directly from the Material motion spec.

The transition supports the following contexts:

- Fullscreen
- Bottom sheet
- Floating card
- Bottom toolbar

* Code review feedback.

* Add README.md.

* Copy the frame calculation block.

* Reword the overview to reduce implementation details.

* Remove scrim sharing and document full screen behavior.

* Audit rect math and remove example debug logs.

* Update to use hypot.

* Remove presentation controller storage.

* Update podspec with new MotionTransitioning dependency.

* Fix autoresizing bugs and update header import names.

* Fix floating point conversion warning.

* Use bottomCard spec for all positions.
2017-07-20 16:38:17 -04:00