105 Commits

Author SHA1 Message Date
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
featherless
e14b90e829
[schemes/Color] Formally mark all to-be-deprecated APIs as "ToBeDeprecated". (#4738)
This change further formalizes our pattern of annotating APIs that will be or are deprecated using class categories. Moving an API into such a category has the benefit of being picked up by the API diff toolchain and elevated into our release notes as a result.
2018-08-09 16:39:56 -04:00
Andrew Overton
49a870fd94
add commonMDCInkViewInit call to -initWithCoder: (#4662) 2018-07-31 11:11:51 -04:00
featherless
fc1e82cd17
[Ink] Remove encoding/decoding behavior for custom properties (#4555)
Closes https://github.com/material-components/material-components-ios/issues/3940
2018-07-25 09:12:46 -04:00
featherless
0cc7e9860f
Standardizing API docs. (#3481)
This standardizes the themer API docs for every component.

Pivotal story: https://www.pivotaltracker.com/story/show/157066083
2018-04-26 22:25:57 -04:00
featherless
8395836c98
Remove all UIAppearance references from documentation. (#3480)
We do not intend to actively support UIAppearance any further. This change removes any references to supporting UIAppearance from our public documentation.

Pivotal story: https://www.pivotaltracker.com/story/show/157048342
2018-04-26 12:55:35 -04:00
featherless
962d9abcc0
[Ink] Add umbrella headers for all extension targets. (#3469)
Also updated all imports to make use of the umbrella headers.

Pivotal story: https://www.pivotaltracker.com/story/show/157045283
2018-04-24 15:57:41 -04:00
Yarden Eitan
af2a3c89d2
[Cards] Added Shapes support for MDCCard and MDCCardCollectionCell + 2 Examples (#3215) 2018-04-05 15:51:34 +03:00
Robert Moore
72283d6b4b
Fixing static analyzer warnings from Xcode 9.3 (#3196)
We had a few static analyzer warnings. Mostly about converting NSNumbers into
primitive BOOL values. A few others regarding nullability problems.
2018-03-30 14:31:22 -04:00
Robert Moore
61277455f1
Use safe selector access for color themers (#3126)
Many of our color themers are accessing optional properties without
first verifying that the color scheme responds to the selector.  This
can result in crashes. Instead, each optional property should be checked
for safety before being used.
2018-03-23 08:58:23 -04:00
randallli
fcc34a016b Revert "[Button|Ink|TextFields|Palettes] Fixed NSNumber conversion static analyzer errors (#2998)"
This reverts commit 62735c8baf1968e6b287ef30aaf6b17744c5c237.
2018-03-15 17:24:11 -04:00
randallli
50e3d2e7c4 Revert "added guard against nil that was present before"
This reverts commit 59fccc4aa2516c30284d95041d29ed5ac39a577d.
2018-03-15 17:23:55 -04:00
randallli
59fccc4aa2 added guard against nil that was present before 2018-03-15 16:11:04 -04:00
Yura Samsoniuk
62735c8baf [Button|Ink|TextFields|Palettes] Fixed NSNumber conversion static analyzer errors (#2998)
* Removed static analyzer errors

* Explicitly return 0 values

* [Ink] Explicitly specify default value

* Fixed Travis errors
2018-03-12 12:17:44 -04:00
Robert Moore
a25ee2d848
[Ink] New bounded ink should ignore maxRippleRadius property (#2956)
* [Ink] New bounded ink should ignore maxRippleRadius property

For the new Ink, when the view uses `.bounded` for `inkStyle`, it should
ignore the `maxRippleRadius` property. No changes should be made to legacy Ink
since we're migrating away from it and we don't want to make unnecessary
changes to existing clients.

Closes #329
2018-02-27 15:39:12 -05:00
Mohammad Cazi
705b76f8a4 [MDCBottomNavigationBar] NSSecureCoding. (#2973)
* NSSecureCoding for MDCBottomNavigationBar

* MDCInkView and MDCBottomNavigationItemBadge NSSecureCoding (subcomponents of MDCBottomNavigationBar)
2018-02-26 14:34:47 -05: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
Yarden Eitan
58f24b4f18 [Cards] Initial Implementation (#2894)
* [Cards] New API Header files (#2886)

* header files

* rename to MDCCardCollectionCell

* update for review

* update to review

* update to review

* [Cards] Full Implementation (#2892)

* cards core implementation

* updates to API and fixes from doc

* small fixes

* podspec, examples, and tests

* small fixes

* small fix

* small fix

* update inkView API and some small nits

* refactor API and code

* refactor API and code

* remove private header

* rename to MDCCardCollectionCell

* updates to api review

* update based on reviews

* fix tests

* [Cards] Initial Docs

* updates to encoding

* small fix

* pr update

* pr update

* pr update

* pr update

* pr update

* pr update

* pr update

* ink api update

* ink api update
2018-02-01 18:45:43 -05:00
Robert Moore
61445a677a [Ink] Fix ink animation timing in time-scaled layers (#2884)
When a CALayer has a speed other than 1.0 (or other manipulations to its local
time coordinate space), animations need to convert beginTime values into this
time space.  For a beginOffset of zero, the layer automatically sets the
beginTime to the current active time of the layer. For non-zero values
(delayed animations), the conversion has to be performed by the caller.

This article has a pretty good explanation:
https://coveller.com/2016/05/core_animation_timing/

Closes internal issue b/72403469
2018-01-31 16:11:45 -05:00
Robert Moore
85647affe8
[Ink] Add NSCoding support to MDCInkView/Layer (#2777)
Both MDCInkLayer (and MDCLegacyInkLayer) and MDCInkView should support
NSCoding methods since their superclasses conform to an NSCoding (or
NSSecureCoding) protocol.

Closes #2772
2018-01-02 20:25:46 -05:00
Junius Gunaratne
892f0c09d9 [Ink] Add updated ink to chips, update ink animation when bounds change (#2545)
* Enable updated ink on MDCButton, add support for shadowPaths

* Only change frame inset when legacy ink is used

* Update formatting

* Create mask layer once

* Update animation and opacity based on designer feedback

* Turn off legacy ripple

* Add delegates to respond to bounds change when animating

* Add mask layer delegate

* Remove commented animations

* Move constants

* Update animation delegate
2017-12-14 13:01:25 -05:00
Junius Gunaratne
1c99b810ec
[Ink] Prevent ink layers from collecting. Copy sublayers before calling removeFromSuperlayer (#2596)
* Copy sublayers before iterating

* Remove unnecessary sublayer copy
2017-12-06 09:48:49 -05:00
Junius Gunaratne
3078879b42
Change ink fade out timing (#2576) 2017-12-05 18:14:22 -05:00
Junius Gunaratne
17cea995c7
[Ink] Use updated ink for bottom navigation (#2567)
* Add ink ripple

* Change ink fade out timing, adjust ink nav item bounds

* Circle highlight

* Remove circle view

* Revert ink fade out timing change
2017-12-05 10:55:44 -05:00
Junius Gunaratne
c3695264cf
Add MDCInkViewDelegate (#2558) 2017-12-04 09:06:57 -05:00
Junius Gunaratne
c9d1b7163d [Ink] Enable updated ink on MDCButton, add support for shadowPaths (#2530)
* Enable updated ink on MDCButton, add support for shadowPaths

* Only change frame inset when legacy ink is used

* Update formatting

* Create mask layer once

* Update animation and opacity based on designer feedback

* Remove commented animations

* Move constants
2017-12-01 19:03:35 -05:00
Junius Gunaratne
7dc9470943 [Themers] Add nullability to themers (#2551)
* Add nullability to themers

* Wrap optional
2017-12-01 17:31:41 -05:00
Junius Gunaratne
a27d49408a
[Ink] Retrofit new ink layer with updated animation into existing ink API (#2488)
* Add updated ink flag

* Add completion block delegate methods

* Rename existing ink to legacy ink

* Update example with legacy ink as second ink view

* Update comment formatting

* Update formatting

* Update ink unit tests

* Update ink unit tests

* Import UIKit for UIColor support

* Add dependency to Material Math

* Add Material Math dependency

* Use CABasicAnimations where possible

* Add support for maxRippleRadius

* Minor refactoring for timing functions

* Remove unused mark

* Add ink description to comments

* Minor formatting fix

* Nullability updates and clarification comments

* Remove email in comments.

* Add nullability

* Add nullability

* Use year when file was created

* Add float

* Update constant names

* Update formatting

* Update year for legal reasons

* Clarify comment about use of usesCustomInkCenter

* Update cancelAllAnimationsAnimated to stop all active ink ripples

* Remove use of ink layers array and access sublayers directly

* Check layer class in cancelAllAnimationsAnimated

* Use bounds rather than frame in layoutSubviews

* Setting radii in setNeedsLayout
2017-11-28 09:59:25 -05:00
Yurii Samsoniuk
2a96682230 Replace unnecessary imports with forward declarations (#2429)
* [Themes] Remove unnecessary imports.

* [TextFields] Remove unnecessary imports.

* [Typography] Do not use an umbrella header inside of a component.

* [Snackbar] Do not use self umbrella header.

* [ActivityIndicator] Do not use self umbrella header.

* [AppBar] Use umbrella headers.

* [AppBar] Remove self import header.

* [ButtonBar] Removed self umbrella header imports.

* [Buttons] Removed self umbrella header imports.

* [Collections] Update imports.

* [Dialogs] Moved import into an m file.

* [Collections] Fixed imports.

* [FeatureHighlight] Removed self umbrealla imports.

* [HeaderStackView] Reordered imports.

* [Ink] Replaced imports with forward declarations.

* [Slider] Replaced self umbrella import use.

* [Snackbar] Removed self umbrella header import.

* [Tabs] Changed math import. Replaced self umbrella header import.

* [Icons] Removed unnecessary imports.

* [Overlay] Replaced umbrella header import.

* [ShapeLibrary] Replace Shapes imports with an umbrella header.

* [Shapes] Replaced imports with forward declarations.

* [AppBar] Replace import with a forward declaration.

* [Examples] Updated imports.

* Fixed conflicting imports

* Added space between different import categories
2017-11-16 18:25:06 -05:00
Will Larche
d9e0811a81 [Themer] Updating the protocol generic syntax. (#2440) 2017-11-16 07:59:18 -05:00
Randall Li
fa90fc3495
[Ink] Moved InkTouchController injectedInkViewForView: from catalog to Ink component (#2332)
* Moved InkTouchController injectedInkViewForView: from catalog into the Ink component

* moved api to MDCInkView
2017-11-07 10:32:54 -05:00
Adrian Secord
c7bb4319e1 [Ink] Call setNeedsLayout on max ripple radius change. (#2011)
Fix an ink view bug. When its maxRippleRadius is changed, it needs to call -setNeedsLayout so its ink layer could call -layoutSublayers that re-calculates the ripple frame.

From internal change 169289257
2017-09-20 20:49:02 +09: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
Robert Moore
756728d0b0 [Ink] Don't assign compositeRipple frame twice (#1687)
`_compositeRipple.frame` was being assigned InkLayer's frame before
being assigned a second rectangle based on InkLayer's bounds. This can
cause the InkLayer compute its frame within its parent layer/view and is
inefficient.

Closes #1685
2017-07-25 11:24:40 -04:00
Robert Moore
4110e30ef2 [Buttons] Reset Ink when moved to new superview (#1656)
* [Buttons] Reset Ink when moved to new superview

MDCButton will now reset all Ink effects after it is removed from its
superview. This prevents retaining Ripple objects indefinitely if the
button is moved between superviews while a touch is held down.

Closes #1655
2017-07-21 14:48:13 -04:00
Robert Moore
9e417817cb [Ink] Reset ink without animation calls delegate (#1654)
Resetting the ink without animation will now call the `animationDelegate`
property to ensure that MDCInkLayer can clean-up its internal state and
remove the ripple objects from its internal arrays.

Closes #1653
2017-07-18 09:53:12 -04:00
Robert Moore
72657d5f8d [Ink] Ink reset passes animation value to ripples (#1652)
When the MDCInkLayer resets ink, it will now pass the `animated` parameter to the ripple sublayers. This fixes a bug where resetting the ink without animation would cause animations to be executed.

Closes #1651
2017-07-17 22:10:14 -04:00
Adrian Secord
0abca36dbb [Docs] Replaced internal site references with public equivalents. (#1616)
* Replaced internal site references with public equivalents.

* Updated spec link to material.io.
2017-07-10 16:35:35 -04:00
Adrian Secord
4dba0dfff8 Add -Wstrict-prototypes and fix errors. (#1532) 2017-06-19 17:33:37 -04:00
Randall Li
266a716f60 Fix imports to use umbrella imports (#1529)
* [ColorThemes] Use umbrella header instead of MDCColorScheme

* [Application] Use umbrella header instead of class header

* [Button] use umbrella header in private header

* [Typography] use umbrella header in private header

* icons using umbrella header in individual icon class

* [Icons] added header to umbrella header

* [collection] umbrella header instead of class header in test

* [Collections] use umbrella header in private header

* [ActivityIndicator] use umbrella header in private header

* [ButtonBar] use umbrella header in private header

* [Dialog] use umbrella header in private header

* [featurehighlight] use umbrella header in private header

* [snackbar] use umbrella header in private header

* [textFields] use umbrella header in private header

* [thumbtrack] use umbrella header in private header

* [Overlay] use umbrella header in private header

also removed spurious ’s’ at end of MaterialOverlay.h file

* [slider] use umbrella header in private header

* [buttonBar] use umbrella header in private header

* [slider] use umbrella header in test

* [Overlay] fixed overlay reference to use umbrella header
2017-06-19 15:57:48 -04:00
Junius Gunaratne
71d441a065 Component themers and usage example for catalog (#1443)
Adding color scheme component themers.
2017-05-30 17:28:03 -04:00
Will Larche
8c5350de31 [All] Formatting. (#1269) 2017-03-22 12:18:15 -04:00
Justin Shephard
d640c1c3aa [Collections] - Fix static analyzer warnings (#1231)
* [Collections] - Fix static analyzer warnings

* [Collections] - Fix static analyzer warning and change nullability qualifier

* [Collections] - Updated nullability qualifier for inkTouchController:inkViewAtTouchLocation, changed how inkView is assigned
2017-03-14 19:08:50 -04:00
Justin Shephard
5db1b8add5 [Ink] - Fix memory leak in Ink and correct issues with ink when re-using cells (#1180)
* [Collections] - Initial changes

* [Ink] - Updated MDCInkLayer to allow for multiple foreground and background ripples that stay referenced as opposed to one and one.

* [Ink] - Code cleanup, indentions, removed unused properties

* [Ink] - Line character counts

* [Ink] - More code cleanup, renaming, line spacing

* [Ink] - Updated docs

* [Ink] - Renamed methods

* [Ink] - Added state of cancelled for ink to prevent completion block calling

* [Ink] - Moved some api to private, updated completion blocks to incorporate weakSelf/strongSelf

* [Ink] - Removed testing and example code

* [Ink] - Additional demo code removed

* [Ink] - Broke retain cycle in ink

* [Ink] - Prevent over removal of ink layers caused by animation delegate being called on animation end AND removal

* [Ink] - Pulled completion block setting out if not needed

* [Ink] - Updated naming convention

* [Ink] - Addressing comments (possible crash on setting inkView to nil on collection cell, naming)

* [Ink] - Added easy out on setInkView method, styling for property declarations

* [Ink] - Renamed clearAllAnimations method to get in tandem with removeAllAnimations method on super class of CALayer

* [Ink] - Removed dependence on indexing for unedited ripples and rather using array count property
2017-02-13 13:29:59 -05:00
Adrian Secord
7ba66bf09c Formatted all Objective-C sources with clang-format. (#1133) 2017-01-05 10:17:24 -05:00
Sam Symons
b62b9c0524 [Ink] Add nonnull to the MDCInkTouchController initializer (#1123)
* Specify `nonnull` on the MDCInkTouchController initializer.

This is a quick change since the initializer was never returning nil to begin with.

* Update Shrine to use the nonnull MDCInkTouchController initializer.
2017-01-04 11:54:31 -05:00
Adrian Secord
e93a16ca02 Capitalize "Material" in documentation (#1014)
* s/material design/Material Design/g

* s/material components/Material Components/g

* s/material\([ \t\n]\)/Material\1/g

* s/aterial design/aterial Design/g
2016-12-13 08:06:55 -05:00
Adrian Secord
d24532bc40 Added MDCInkGestureRecognizer.h to Ink's umbrella header. (#801) 2016-10-24 14:00:07 -04:00