Follow-up to https://github.com/material-components/material-components-ios/pull/8808
Part of https://github.com/material-components/material-components-ios/issues/6913
From the docs:
tl;dr: If you are adding ripples to views with custom `layer.shadowPath` values, please disable
`usesSuperviewShadowLayerAsMask` and assign an explicit layer mask to the ripple view if needed
instead. usesSuperviewShadowLayerAsMask will eventually be disabled by default and then deleted.
MDCRippleView currently implements a convenience behavior that will inherit its parent view's
`layer.shadowPath` as the mask of the ripple view itself. This works for the general case where the
ripple view's frame equals the bounds of its super view, but behaves unexpectedly for any other
frame of the ripple view.
Due to the brittleness of this behavior, a new migration property, `usesSuperviewShadowLayerAsMask`,
has been added that will allow you to disable this behavior in favor of a more explicit
determination of the ripple's layer mask.
Example usage:
<!--<div class="material-code-render" markdown="1">-->
#### Swift
```swift
// During initialization:
rippleView.usesSuperviewShadowLayerAsMask = false
// Simple example of applying a mask to the ripple view using the ripple view's bounds:
let rippleViewMask = CAShapeLayer()
rippleViewMask.path = UIBezierPath(rect: rippleView.bounds).cgPath
rippleView.layer.mask = rippleViewMask
```
#### Objective-C
```objc
// During initialization:
rippleView.usesSuperviewShadowLayerAsMask = NO;
// Simple example of applying a mask to the ripple view using the ripple view's bounds:
CAShapeLayer *rippleViewMask = [[CAShapeLayer alloc] init];
rippleViewMask.path = [UIBezierPath bezierPathWithRect:rippleView.bounds].CGPath;
rippleView.layer.mask = rippleViewMask;
```
<!--</div>-->
Ink readme wasn't using the script generator and ready templates we already use in our other components. This fixes that and moves the migration guide from Ripple to Ink.
Following updating the docs in #6996 and adding additional tests #6992 for the Ripple:
In this PR I am officially graduating Ripple to ready.
These are the steps taken to do so:
1. Update docs to not show Beta anymore.
2. Move Ripple from the Beta podspec to the main podspec.
3. Removal of MDCCard+Private, MDCCard+Ripple, MDCCardCollectionCell+Private, MDCCardCollectionCell+Ripple, as they were used as connectors between Ripple being a beta component and Card being a ready component.
4. Moving the relevant code in the above files into the Card implementation.
5. Modifying the property `enableBetaBehavior` for Cards to `enableRippleBehavior` as it is no longer a beta behavior.
Tested to see all the examples work well for Cards and CardCollectionCells.
Closes#6941
This PR includes the ripple implementation that is up to date with Material design and motion guidelines.
A ripple by definition is a visual form of feedback for touch events providing users a clear signal that an element is being touched. The ripple effect is a core functionality for components such as buttons, cells, cards, etc.
This will eventually succeed the outdated Ink component, and is currently being added under MaterialComponentsBeta.
There are unit tests and an example included to this PR.
The full design doc can be found here: go/ripple-ios-revisited