8 Commits

Author SHA1 Message Date
featherless
9d60c22e29
[Ripple] Add usesSuperviewShadowLayerAsMask flag. (#8822)
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>-->
2019-11-27 16:07:09 -05:00
Yarden Eitan
89cd08dc88
[Ink] Update Readme to use the script generator and move migration guide. (#7370)
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.
2019-05-12 17:25:59 +03:00
Yarden Eitan
3c46c3e267
[Ripple] Add a migration guide for components (#7367)
Adding a migration guide section in our docs to help our team more easily migrate components that incorporate Ink, to use the new Ripple.
2019-05-12 14:52:06 +03:00
Cody Weaver
bd127b3ea9
[Ripple] Minor docs clean up (#7262)
In working on b/130633111 I noticed a few minor areas where we can clean up the documentation with MDCRipple.
2019-04-24 23:25:52 -04:00
Cody Weaver
048c259a85
[Docs] Minor docs polish (#7053)
While reviewing the release I noticed some extra white spaces within the docs and an extra character in documentation. This PR cleans that up.
2019-04-05 10:25:03 -04:00
Yarden Eitan
ba8269c13e
[Ripple] Graduate Ripple to Ready. (#7000)
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
2019-03-27 16:58:01 -04:00
Yarden Eitan
2f4a9b5a04
[Ripple] Additional documentation for Ripple and its classes (#6996)
As preparation for marking Ripple ready I made a pass and improved the documentation for Ripple and included missing documentation for its APIs.
2019-03-27 11:07:05 -04:00
Yarden Eitan
1753e12717
[Ripple] Ripple implementation + example + unit tests (#6174)
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
2019-01-02 19:31:03 -05:00