25 Commits

Author SHA1 Message Date
Nobody
8bb590a78d Add explicit imports for CoreGraphics in files which use it.
PiperOrigin-RevId: 642400931
2024-06-11 14:52:59 -07:00
Jeff Verkoeyen
f6f19c41f8 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 401224908
2021-10-06 06:17:26 -07:00
Jeff Verkoeyen
21d89d88ec Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 401009899
2021-10-05 09:54:43 -07:00
Randall Li
502bc5d910 Ran a Swift formatter
PiperOrigin-RevId: 395947664
2021-09-10 09:48:14 -07:00
Jeff Verkoeyen
ec44b12ee9 Internal change
PiperOrigin-RevId: 394725753
2021-09-03 11:44:01 -07:00
Jeff Verkoeyen
d7ff705337 Drop support for iOS 9.
PiperOrigin-RevId: 326015653
2020-08-11 07:21:40 -07:00
Yarden Eitan
a68702e3a4 [Ripple] Add delegate method to RippleTouchController existing in InkTouchController.
This delegate method allows clients to have one ripple touch controller control multiple ripple views. Also gives them more flexibility on the creation and reusing of ripple views.

PiperOrigin-RevId: 317614179
2020-06-22 02:18:07 -07:00
Bryan Oltman
395ad9b395
[Catalog] Remove traitCollection overrides from examples. (#9851)
It's not clear to me why these existed – I can't see any visual difference before vs. after on an iPad in portrait orientation.

Fixes #7683
2020-03-05 17:16:59 -05:00
Yarden Eitan
b18c748123 make card with ripple example a5able (#8929)
Voice Over and Switch Control users can activate the Card to show Ripple.
The card has an accessibility label and an accessibility trait to indicate that it is interactive.

Closes #8914
2019-11-15 12:11:43 -05:00
Yarden Eitan
83d465eedc
[Ripple] Ripple typical example now can be used with Voice Over (#8924)
All views in example are accessible with Voice Over and can be activated.
All views have a relevant accessibility label and the appropriate traits.

Closes #8913
2019-11-15 11:45:44 -05:00
Robert Moore
ff2d8a4e7f
[*] Drop iOS 9 guards for Swift. (#8001)
Drops some iOS 9 checks in Swift code.

Part of #2651
2019-07-23 12:23:28 -04:00
Yarden Eitan
efe61588a6
update (#7246)
We need to add @objc annotations to colorScheme and typographyScheme instances in our Swift examples, because we moved to Swift 4.2, the respondsToSelector won't find `setColorScheme:` and `setTypographyScheme:` setters otherwise.
2019-04-23 10:21:14 -04:00
Yarden Eitan
52da482fd2 [Catalog] Add @objc annotations to our containerScheme instances in Swift (#7243)
We need to add @objc annotations to the containerScheme instances in our Swift examples, because we moved to Swift 4.2, the respondsToSelector won't find the setContainerScheme: setter otherwise.
2019-04-23 10:07:56 +03:00
Andrew Overton
94e5a978d7
[Buttons] Graduate Buttons+Theming to ready (#7187)
This PR graduates the buttons theming extension to ready.

Closes #7158.
2019-04-19 13:57:00 -04:00
Wenyu Zhang
9aa1d72bc7
[Cards] Move Cards theming extension to ready. (#7178)
closes https://github.com/material-components/material-components-ios/issues/7165
2019-04-19 11:36:20 -04:00
Yarden Eitan
5bed3961e6
[ContainerScheme] Graduate ContainerScheme to ready. (#7170)
This PR graduates ContainerScheme to ready.

This includes updating the podspecs, podfile, all the import statements related to ContainerScheme, updating .kokoro rewrite rules, and finally the readme to not have ContainerScheme regarded to as being in beta.

Ran locally kokoro with -b bazel successfully.

Resolves #6732
2019-04-18 09:25:02 -04:00
Andrew Overton
c56d5d76d3
Add @objc annotations to get examples to show up in Dragons (#7168)
This is a follow up PR for #7166 adds @objc annotations to Swift catalogMetadata() methods, because the Swift 4 compiler no longer attempts to infer what methods should be visible to Objective-C. As a result of this change in the compiler, no Swift examples were showing up in Dragons after #7166. See this article: https://useyourloaf.com/blog/objc-warnings-upgrading-to-swift-4/ for additional context.
2019-04-17 21:35:43 -04:00
Andrew Overton
b38372192f
Update to Swift 4.2 (#7166)
This PR updates the Swift version to 4.2.

Partially resolves #6874.
2019-04-17 16:59:02 -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
Joe Aguilar
1df9655085 Removing nil-coalescing operators per issue #6827 (#6859)
This PR closes issue #6827.
2019-03-13 08:15:51 -04:00
Yarden Eitan
136273636d
[Cards] [Ripple] Integrate the new ripple and states into the Cards component (#6621)
**Overview**
This PR integrates the new Ripple component and its state support into our existing Cards and CardCells components. It does so in an opt in form, where you must have MaterialComponentsBeta installed for one to have Cards use the new behavior. The PR also includes 2 examples showcasing the new behavior with MDCCard and MDCCardCollectionCell.

**Resolves**: #6463

**Acceptance Criteria:**
* The Cards have an opt in property (as ripple is in beta) to be able to activate the ripple and its states support in Cards. It will fallback to the existing (legacy) implementation by default.
* An MDC example that showcases the work for Cards.
* Interaction and animation with the card should follow the guidelines from the updated cards design doc.

**Implementation Explained**
This is a pioneer PR, trying to converge a beta component into a ready component. To do so we had to have our Card component not be aware of the existence of the beta component Ripple, but we needed the Ripple component to be able to plug in to the Card component.

To achieve this I created a few different things:
1. A ripple delegate that plugs into MDCCard and MDCCardCollectionCell that consists of methods that should be invoked in the component where the Ripple work needs to be inserted. A check for the existence of the delegate and the corresponding delegate method is checked in the Card component before invoked. This allows us to identify if Ripple should be used or not.

2. A MDCCard+Private and MDCCardCollectionCell+Private categories that expose the RippleView property in the implementation files of the Card component, and also exposing other methods that the Ripple integration needs to invoke but aren't exposed in the original Card header files.

3. An MDCCard+Ripple and MDCCardCollectionCell+Ripple categories under beta, that implement the delegate introduced in 1. and have knowledge and access to the beta component Ripple. This is where the actual implementation of the ripple integration sits.

4. Lastly, we need a way to set card.rippleDelegate = self for the +Ripple categories. However, there are a few issues in achieving this. If we create a BOOL property like `shouldIntegrateRipple`, we would need to be able to switch the state from `YES` to `NO` and back correctly. The state is very complicated when you have states, ripple vs ink, etc. Therefore the best way to do this is not to allow users to trigger a BOOL, but to have a separate initializer for `initWithRipple`. However, CardCollectionCells are reused and the dequeue method calls `initWithFrame` and we can't ask it to invoke `initWithRippleandFrame` instead. Therefore, I added performSelector logic in the init methods of the Card component that checks to see if the Cards+Ripple category is apparent (meaning Beta is integrated in the framework), and if so initializes the Ripple. Happy to find alternatives if better ones are offered.

**GIFs before and after**

Before:
![oldtop9card](https://user-images.githubusercontent.com/4066863/53095318-8501f380-34ea-11e9-8b79-328af61e0fc1.gif)

After:
![newtop9card](https://user-images.githubusercontent.com/4066863/53095334-8c290180-34ea-11e9-9767-73d74e8fefd8.gif)
2019-02-20 11:32:19 -05:00
Yarden Eitan
9bdc91dd89
[Ripple] [States] Moving touch handling ownership away from the ripple view (#6615)
In some cases because the Ripple handles touches to figure out when the touch is moved in and out of bounds, or if it is cancelled or ended, it will consume the touch and not allow the superview or other subviews receive the touch.

Therefore, I have moved away from the approach of having the stateful ripple view receive any ownership of the touch by setting pointInside for it to always be NO. However, to be able to have stateful ripple follow material guidelines, I have put new guidance to views adding the ripple view as a subview to pass on the standard touches to the ripple view to have it work as intended.

Documentation in our GitHub on how to integrate it correctly will be added as a follow up. Documentation in the header has been fully fleshed out and added in this PR.

The example for stateful ripple incorporates these updates and works as intended.
2019-02-14 16:35:56 -05:00
Yarden Eitan
8a960fc963
[States] [Ripple] Provides a Stateful Ripple implementation (#6591)
As per our discussion, design doc, and design review meeting, provided is the stateful ripple implementation to be reviewed and added to our Ripple beta component. 

Also included is an example showcasing the stateful ripple as part of the acceptance criteria.

Design doc: go/state-system-ios

Corresponding API PR that was approved: #6490 

Resolves #6562 

Please see below gif showcasing the example:

![statefulripple](https://user-images.githubusercontent.com/4066863/52536667-afee8980-2d2b-11e9-9c09-b3f00511243b.gif)
2019-02-12 13:12:43 -05:00
Yarden Eitan
4556a2a71a
[Ripple] Remove the notion of state and its implementation from the ripple touch controller (#6486)
For our Ink successor Ripple, which is currently a Beta component, we want to initially clean the implementation so it doesn't consist any notion of state and be equivalent to our Ink component in terms of API and feature set. Further additions will be reviewed and discussed as follow ups with the team.
2019-01-28 17:49:37 -05: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