11 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
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
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
29d760c7d6
Added isPresentable to catalog files, ported over ZShadow to dragons. (#2726) 2017-12-15 12:20:35 -05: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
Martin Petrov
f98a9d42ed @objc annoaing catalog by convention (#2305) 2017-10-30 10:24:17 -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
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