This change makes it so that the `masksToBounds` property on an MDCButton's MDCInkView's MDCLegacyInkLayer is set according to whether `inkStyle` is `.unbounded` or not, regardless of whether `usesLegacyInkRipple` is set on the MDCButton.
An MDCInkView's layer is always an MDCLegacyInkLayer, even when `usesLegacyInkRipple` is set to NO. In this scenario it acts as the MDCInkView's layer, even if it's not acting as the thing that triggers the ink/ripple animation.
There was a very similar bug to this recently that https://github.com/material-components/material-components-ios/pull/9254 was intended to address. That PR addressed it in the Catalog, as you can see in the before and after gifs in the PR description, but a different client was still experiencing the issue. I built the second client's app to test this PR and it seems to fix it for them.
I wonder if we should try to get rid of MDCLegacyInkLayer, or if we should bypass that and just get rid of MDCInkView entirely, now that we have MDCRippleView.
Closes#9762.
This allows the API to handle assigning inkColor to nil, which is common practice among properties on UI classes that expose color (see UIKit - i.e. UIView.tintColor, UILabel.textColor, etc)
b/144862050
Use more Starlark macros in the BUILD file. This makes it easier for releasing
each week. Also removed the `includes` requirement by making testing imports
relative.
Part of #8150
All components should have a top-level umbrella header for their includes.
This allows easier refactoring of classes and files within the component.
Creating an umbrella for Color and using it outside the component.
Part of #8086
Adding dynamic color support to the Ink component.
Ink comprises of multiple MDCInkLayer sublayer instances, and they all should update their colors when the style of the system turns to Dark.
Closes#7871
Add animation delegate callbacks for MDCLegacyInkLayer
We would like to observer the start and stop animations of an MDCInkTouchController by setting the animationDelegate of the MDCInkTouchController's MDCInkView. If [MDCInkView usesLegacyInkRipple] == YES the MDCLegacyInkLayer does not call any animation callbacks right now.
The scaled animation tests were very sensitive to test environment
delays. By reducing the speed of the layer, the tests can be less
sensitive to test-related delays but would still calculate the scaled
effect accurately.
Our components should not implement or support property coding unless explicitly required. We generally removed support for this type of behavior early in 2018.
Many components were still implementing coding support.
Property coding has been removed from every component.
This change also removes `NS_DESIGNATED_INITIALIZER` from all initWithCoder APIs.
Replacing all non-integral, single-precision floating point literals with double-precision values explicitly cast to CGFloat. For example, `0.1f` should become `(CGFloat)0.1`.
Regex used:
```
([0-9]*\.)([0-9]*?)([1-9]+)([0-9]*?)[fF]
```
PiperOrigin-RevId: 220683126
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.
```
* [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
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
Both MDCInkLayer (and MDCLegacyInkLayer) and MDCInkView should support
NSCoding methods since their superclasses conform to an NSCoding (or
NSSecureCoding) protocol.
Closes#2772
* 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
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
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
Summary:
Similar to Catalog by convention, Testing by convention allows us to generate a fully-working unit test suite using CocoaPods wildcards.
The testing convention is to place unit test source files in a `tests/unit` folder within each component.
A complete "component by convention" now looks like so:
component/
examples/
SomeExample.m
src/
...
tests/
unit/
SomeTest.m
This convention makes it trivially easy to run all tests in our project & generate coverage information. Here are our coverage results:
{F439}
Resolves https://github.com/google/material-components-ios/issues/106.
Reviewers: cjcox, ajsecord, #mdc_ios_owners
Reviewed By: ajsecord, #mdc_ios_owners
Projects: #material_components_ios
Differential Revision: http://codereview.cc/D158
Summary: Adds Ink component. Unit tests and user documentation still to come.
Test Plan: Unit tests, example code.
Reviewers: featherless, #material_components_ios_owners, randallli
Reviewed By: featherless, #material_components_ios_owners, randallli
Projects: #material_components_ios_owners
Differential Revision: http://codereview.cc/D11