116 Commits

Author SHA1 Message Date
Cody Weaver
7806ee3c3e
Corner radius (#5390) (#5398)
<h3>

```diff
- Warning - This has been attempted 3 times
```
</h3>

### Context
Clients may want to set the corner radius of a UIView that they have overridden the layerClass on to use MDCShadowLayer. Currently if the shadow layer's corner radius changes those changes are not rendered (see Shadow Corner Radius example in MDCDragons). This has been attempted in [this PR](https://github.com/material-components/material-components-ios/pull/4921) and [this PR](https://github.com/material-components/material-components-ios/pull/5224) both had to be rolled back. This is a similar change to #4921 except this change does NOT mark `shadowPathIsInvalid` or call `setNeedsLayout`. This differs from #5224  in that it doesn't set the `shadowPath`'s for the sublayers or set `shadowPathIsInvalid`.

### The problem
Corner radius changes aren't rendered when using MDCShadowLayer.

### The fix
Set the corner radius on the layer and sublayers and update the mask for the sublayers.

### Additional notes
A global presubmit has been run and succeeded.
Internal CL to test: cl/216562497

### Alternatives
@andrewoverton Suggest
```objectivec
-(void)setCornerRadius:(CGFloat)cornerRadius {
  [super setCornerRadius:cornerRadius];

  [self layoutSublayers];
}
```
### Videos
| Before | After |
| - | - |
|![shadowafter](https://user-images.githubusercontent.com/7131294/46754619-e38fa900-cc90-11e8-823b-6e02d1bf666e.gif)|![shadowcorner](https://user-images.githubusercontent.com/7131294/46754945-d7581b80-cc91-11e8-8fb5-06b50f36ad69.gif)|
2018-10-11 13:33:02 -04:00
Cody Weaver
3c636c1704
[ShadowLayer] Subclass UIView in corner radius example (#5388)
### Context
In working on #4848 I noticed that the example uses an UILabel which may have a different backing layer (possibly CATextLayer) than UIView. This change makes it easier for another team member to address this issue.
### The fix
Subclass UIView which I believe is the most common use case for using a custom shadow layer in this example.
### Related issue
#4848
### Videos
| Before | After |
| - | - |
|![develop](https://user-images.githubusercontent.com/7131294/46751924-efc43800-cc89-11e8-8327-b05f6bb5f3f3.gif)|![shadowafter](https://user-images.githubusercontent.com/7131294/46751933-f357bf00-cc89-11e8-9e17-eea6dd0dd7bd.gif)|
2018-10-10 13:33:15 -04:00
featherless
cee6ae6a0f
Revert "[ShadowLayer] Add support for responding to cornerRadius changes. (#5224)" (#5231)
This reverts commit b3e2a1e283febfd90b6f5d575c18b7bf7d51408e.
2018-09-25 21:48:22 +03:00
featherless
d706762315
[ShadowLayer] Fix layout of shadow layer example. (#5222)
It now respects the top layout guide of the app bar.

| Before | After |
|--------|-------|
| ![simulator screen shot - iphone 8 plus - 2018-09-24 at 23 19 06](https://user-images.githubusercontent.com/45670/45976735-40178500-c050-11e8-9128-e581436dbb50.png) | ![simulator screen shot - iphone 8 plus - 2018-09-24 at 23 18 17](https://user-images.githubusercontent.com/45670/45976719-368e1d00-c050-11e8-8885-212dd34d9dd1.png) |
2018-09-25 16:54:20 +03:00
featherless
b3e2a1e283
[ShadowLayer] Add support for responding to cornerRadius changes. (#5224)
Prior to this change, changing the cornerRadius of a shadow layer would not propagate to the shadow paths until the next time the shadow layer's layoutSubviews was invoked.

After this change, changing the cornerRadius will immediately update the shadow paths of the shadow layer.

Closes https://github.com/material-components/material-components-ios/issues/4848

Internal CL to test: [cl/214326774](http://cl/214326774).

| Before | After |
|--|--|
|![shadowradius-broken](https://user-images.githubusercontent.com/1121006/44730113-367d1a80-aaae-11e8-9b55-024f97b797e0.gif)|![shadowradius-fixed](https://user-images.githubusercontent.com/1121006/44730119-3d0b9200-aaae-11e8-8798-98ae8100f671.gif)|
2018-09-25 15:15:12 +03:00
Randall Li
d0536a4bf9 Revert "[MDCItemBar] Fix an issue where the protocol method itemBar:shouldSelectItem: does not behave correctly (#5071)"
This reverts commit 255541a4e5009daf57113fc7fcdac7d3aac4fe08 and f4b8ed3e20de0f543e5da0d7d51d3a23a3d7b775
2018-09-21 14:15:36 -04:00
Randall Li
f4b8ed3e20 [ShadowLayer] fixed import statement for release 2018-09-19 13:43:49 -04:00
ianegordon
255541a4e5
[ShadowLayer] Mark shadowPath invalid on cornerRadius change (#4921) 2018-09-17 16:28:53 -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
ianegordon
cc3c77866f
[ShadowLayer] Add dragon demonstrating cornerRadius changes aren't rendering (#4849)
* [ShadowLayer] Dragon demonstrating that corner radius isn't updated.
2018-08-22 17:43:19 -04:00
Ian Gordon
bd8a8153bc Revert "[ShadowLayer] Setting the corner radius should recalculate the shadowPath (#4804)"
This reverts commit 0bf8f0d346eb131aee5f83944dcb1a380edcf1d0.
2018-08-16 15:04:11 -04:00
ianegordon
0bf8f0d346
[ShadowLayer] Setting the corner radius should recalculate the shadowPath (#4804) 2018-08-16 11:53:03 -04:00
featherless
b84b2cc01b
[ShadowLayer]! Remove encoding/decoding behavior for custom properties (#4546)
Closes https://github.com/material-components/material-components-ios/issues/3949
2018-07-17 23:44:00 -04:00
Jeff Verkoeyen
651031dc56 [Shadow] Reorder screenshots. 2018-05-04 12:46:35 -04:00
Jeff Verkoeyen
8f8c0819d3 Tidy up links for shadows and progress indicators. 2018-05-04 12:20:58 -04:00
Jeff Verkoeyen
ee0eeb7f51 Fix more casings. 2018-05-03 15:55:31 -04:00
Adrian Secord
14b9c1503f
Global replace of "utilize" vs "use". (#3662) 2018-05-02 16:51:59 -04:00
Adrian Secord
7a7293883f
Remove space after triple-backtick Markdown syntax. (#3577) 2018-04-29 09:00:53 -04:00
Yarden Eitan
d1767c0086 [Shapes] [ShadowLayer] Example using Shapes and Shadows with animation (#3394)
* uiview with shadow and shape

* example using shape and shadow

* example using shape and shadow

* spacing
2018-04-18 22:08:32 -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
Robert Moore
c7a9b6966e [ShadowLayer] Document default elevation of 0 (#2960)
Closes #442
2018-02-19 08:58:56 -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
Sam Morrison
9b097023fb
[Shapes] Implicitly animate shape path on resizing (#2619)
* [Shapes] Implicitly animate shape path on resizing

* Remove MDCShapelayer
2017-12-07 19:25:09 -05:00
Robert Moore
7c86d12f5f
[Bazel] Fix BUILD files for bazel 0.8.0 and latest apple_rules (#2640)
Bazel and/or apple rules got stricter. Adding some missing SDK dependencies in
our components.
2017-12-07 12:33:40 -05:00
Sam Morrison
7e2d44522e [ShadowLayer] Animate shadow resizing (#2523)
* First pass animated shadows

* Make order of ZShadow demo views consistent

* Clean up MaterialShadowedView

* More cleanup

* Revert one example change

* Move everything in to MDCShadowLayer

* Revert MaterialShadowedView.m

* Only animate if the size change is animated

* Remove duplicate method

* Copy animation instance instead of copying each property

* Use CALayerDelegate instead of custom subclass

* animationSourceLayer
2017-11-30 14:18:51 -05:00
featherless
d24789f484
[Shadow*] Add BUILD files for shadow components. (#2510)
* [Shadow*] Add BUILD files for shadow components.

* Move test headers into src.
2017-11-22 16:37:44 -05:00
featherless
e38ac60ffd
[ShadowLayer] Add support for implicitly animating the shadow layer's elevation using MotionAnimator. (#2509) 2017-11-22 16:16:57 -05:00
Martin Petrov
f98a9d42ed @objc annoaing catalog by convention (#2305) 2017-10-30 10:24:17 -04:00
Martin Petrov
6639fb4f70 Update shadow examples (#2174) 2017-10-13 13:07:31 -04:00
Martin Petrov
49fd0a07ea [ShadowElevations] Update ShadowElevations to be extensible. (#2145)
* [Collections] Modernize Swift in styling readme.

* [ShadowElevations] Update ShadowElevations to be extensible.

This defines a custom macro to get the typed enum behavior rather than
defining a system macro to prevent it from adversily affecting clients.

Redundant NS_SWIFT_NAME macros are removed.

Usage is updated to omit the optional rawValue: argument. Docs are also
updated to reflect the change.

* minor fixes

* need an extra clause for xcode8

* updated for xcode8 backwards compat
2017-10-13 11:36:31 -04:00
Junius Gunaratne
a9b08ce452 [ShadowElevations] Improve Swift support for shadow elevations (#2116)
* Shadow elevation swift

* Improve shadow elevation swift support

* Add const. Update formatting.
2017-10-06 15:01:41 -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
2283e04f02 [ShadowLayer] Support layer copying (#1625)
* [ShadowLayer] Support layer copying

Implementing -initWithLayer: for Shadow layers

Closes #248

* Removing invalid TODO

* Reverting changes to -commonInit

Making sublayer initialization coniditional so that `-initWithLayer:`
doesn't end up calling `-addSublayer:`
2017-07-12 14:37:05 -04:00
Martin Petrov
1e14d41091 Explicitly annotating some known ObjC methods. (#1617)
This improves Swift4 compatibility, see:
https://help.apple.com/xcode/mac/current/#/deve838b19a1
2017-07-10 19:46:22 -04:00
Scott Hyndman
eed028eacb [Docs] Adds API documentation roots and tidies up here and there. (#1425)
* [Docs] Marks component files as API documentation roots.

Used by the site generator to determine where to build API docs. I
marked everything built by the previous version.

* [Docs] Adds a prefix to all Material guidelines links.

* [Docs] Adds API doc links to some components.
2017-05-12 16:03:56 -04:00
Scott Hyndman
1571a1b9ee [Docs] Nests components in the navigation as spec'd. (#1404)
Also took the opportunity to remove an unneeded liquid style
application.
2017-05-09 11:49:44 -04:00
Scott Hyndman
1bec0a903a [Docs] Misc. cleanup (#1403)
* [Docs] Changes an icon list class name.

* [Docs] Adds annotations to all installation code snippets.

* [Docs] Fixes screenshot sizes in PageControl README.

* [Docs] Fixes a broken link on the homepage.

* [Docs] Adds a stable repository branch field to the site metadata.

Used to link to the GitHub source tree.

* [Docs] Specify platform in docs root title.
2017-05-08 18:05:05 -04:00
ianegordon
fc4f2b763a [ShadowLayer] Screenshot (#1389)
* [ShadowLayer] Screenshot

* Remove label
2017-05-05 17:01:27 -04:00
Scott Hyndman
4a011e75a5 [Docs] Docstravaganza (#1330)
* [Docs] Adds platform configuration for the doc site.

* [Docs] Adds path metadata for documentation site.

This field is used to determine where the file will appear in the
doc site.

* [Docs] Updates Material guideline links to latest URL.

material.google.com -> material.io/guidelines

* [Docs] Introduces a separate component index for the docsite.

* [Docs] Changes the directory used for site generation.

* [Docs] Moves documentation-site-only Markdown into its own directory.

* [Docs] Changes material.io links to use https.

* [Docs] Renames the howto and contributing docsite sections to docs.

* [Docs] Adds a navTitle field to the collection editing/styling pages.

* [Docs] Changes the FAQ heading to be one size bigger.

* [Docs] Changes the tutorial title.

* [Docs] Adds icons to three more components.

* [Docs] Introduces a root component directory called /catalog/.

* [Docs] Adds an icon to the AnimationTiming component.

* [Docs] Adds an icon for the typography component.

* [Docs] Reformats the docsite index.
2017-05-01 17:27:38 -04:00
Will Larche
3f99ed2dd9 [All] replacing ~~~ with ```. (#1324) 2017-04-17 17:06:37 -04:00
Scott Hyndman
0913aa9aaf [Docs]: Updated link list classes. (#1320)
Link lists now use BEM notation across the board. It's more verbose, but is
aligned with the conventions of MDC-web and the docs site.
2017-04-13 17:25:23 -04:00
Scott Hyndman
69533578ca [docs] Associated icons with components (#1315)
* Adds icon IDs to most component READMEs.

The ones without icon IDs will default to a generic icon.

* Removes a space from front matter.
2017-04-12 18:22:08 -04:00
Scott Hyndman
9ed1d4349d Gigantic documentation update. (#1305)
There are more changes to come, but it's time we merged back.

Changes:
* Re-introduces the doc site scripts and files that had been deleted previously.
* Updates contributing docs to reflect doc structure changes.
* Applies common header structure across all component documentation.
* Fixes a bunch of liquid syntax bugs.
* Inlines Front Matter metadata in README.md files as HTML comments. Any file prefixed with

  <!--docs:
  ...yaml
  -->

  Will be converted into Front Matter when generating the site.
* .jekyll_prefix files, which previously stored the data, have been removed.
2017-04-05 10:53:34 -04:00
Adrian Secord
8bcb19781c More SwiftLint fixes for unit tests and example apps. (#1154)
* ClangFormat changes.

* Added swiftlint to scripts/format_all.`

* Fix scripts/lint_all to work from any directory.

* Fixed swiftlint invocation.

* Remove the checks for force casting (! operator).

* Some fixes.

* More Swift fixes.
2017-01-11 13:27:57 -05:00
Sam Symons
bb561ac257 [Scripts] SwiftLint integration (#1129)
* Integrate SwiftLint in the Catalog.

* Update the disabled SwiftLint rules.

* Reference a local swiftlint.yml symlink.

This prevents us from getting warnings about code style violations from the other demos.

* Fix SwiftLint violations in the Catalog and Components.

* Ignore the `third_party` directory when running the linter.

We should not have to deal with warnings in code we may not be able to fix easily.

* Integrate SwiftLint into Shrine.

Additionally, fix a number of warnings introduced.

* Run SwiftLint on Travis.

* Enable many of the previously disabled rules and correct them.

* Fix control statement violations from SwiftLint.
2017-01-06 16:37:23 -05:00
Adrian Secord
7ba66bf09c Formatted all Objective-C sources with clang-format. (#1133) 2017-01-05 10:17:24 -05:00