64 Commits

Author SHA1 Message Date
Jeff Verkoeyen
08051b7bda Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 400798440
2021-10-04 13:20:55 -07:00
Jeff Verkoeyen
86a8c97dc7 Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 400788645
2021-10-04 12:41:07 -07:00
Randall Li
502bc5d910 Ran a Swift formatter
PiperOrigin-RevId: 395947664
2021-09-10 09:48:14 -07:00
Yarden Eitan
381db186fe [Cards] Fix broken examples
PiperOrigin-RevId: 367980757
2021-04-12 05:09:19 -07:00
Jeff Verkoeyen
1abdf16760 Optimizing imports
PiperOrigin-RevId: 357185990
2021-02-12 07:36:41 -08:00
Jeff Verkoeyen
29803522c6 Optimizing imports
PiperOrigin-RevId: 357185525
2021-02-12 07:27:05 -08:00
Jeff Verkoeyen
d7ff705337 Drop support for iOS 9.
PiperOrigin-RevId: 326015653
2020-08-11 07:21:40 -07:00
Jeff Verkoeyen
f4b7c8eb2c [Cards] Add example snapshot tests.
PiperOrigin-RevId: 309247001
2020-04-30 10:06:12 -07:00
Andrew Overton
54723a16a4 [Cards] Replace Cards documentation
This PR replaces the Cards documentation with different Cards documentation. To preview the docs, see [here](https://github.com/andrewoverton/material-components-ios/tree/cards-docs/components/Cards).

Closes https://github.com/material-components/material-components-ios/pull/9965

COPYBARA_INTEGRATE_REVIEW=https://github.com/material-components/material-components-ios/pull/9965 from andrewoverton:cards-docs 140637c2f4f7c24ba25099352c5f9c066d84035b
PiperOrigin-RevId: 306670257
2020-04-15 10:34:23 -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
featherless
be33d3196a
[Cards] Fix bug in the "Typical use" example where the image would not appear. (#8943)
The image was not appearing because the card using a custom image view that was trying to inherit the mask of the card's shape layer.

This change removes the custom image view and instead applies custom corner radii to the image view directly. This is not ideal, but is an improvement. Ideally, the card would provide a content view that is clipped to the card's shape. It's not possible to enable clipping on the card itself because this causes the shadow to go away.

| Before | After |
|:--|:--|
| ![Simulator Screen Shot - iPhone Xʀ - 2019-11-15 at 12 57 37](https://user-images.githubusercontent.com/45670/68964703-08b1ed80-07a8-11ea-978c-2c71145ca8c3.png) | ![Simulator Screen Shot - iPhone Xʀ - 2019-11-15 at 12 56 52](https://user-images.githubusercontent.com/45670/68964693-02bc0c80-07a8-11ea-9d3d-644b81aebee6.png) |

Part of https://github.com/material-components/material-components-ios/issues/8861
2019-11-15 16:44:28 -05:00
featherless
f6f2ff2821
[Cards] Make the "Typical use" example title label an a11y heading. (#8945)
Closes https://github.com/material-components/material-components-ios/issues/8861
2019-11-15 14:06:21 -05:00
featherless
28b838cc9d
[Cards] Make the shaped collection cell an accessibility button. (#8901)
Fixes https://github.com/material-components/material-components-ios/issues/8866
2019-11-15 11:54:13 -05:00
featherless
ae7db6f03d
[Cards] Make the Shaped Edit/Reorder example class/files match the name of the example. (#8899)
Cleanup as part of https://github.com/material-components/material-components-ios/issues/8866
2019-11-15 11:00:50 -05:00
Galia Kaufman
8c103b0fc9
[Cards] New toggle-button example (#8663)
Adding an exampled for a custom Toggle Button in Cards.
2019-10-28 12:47:22 -04:00
Andrew Overton
538a90cc4b Revert "[Cards] New toggle-button example (#8574)"
This reverts commit 89983ffbf4a9ed5852ab0d7f9b3548fa93a3bd1a.
2019-10-23 14:19:29 -04:00
Galia Kaufman
89983ffbf4
[Cards] New toggle-button example (#8574)
Adding a code sample for a white Toggle Button example in Cards.
2019-10-21 10:10:24 -04: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
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
Cody Weaver
50307bb330
[Container] Fix colorScheme and typographyScheme to be nonnull. (#6699)
## Introduction
Before we move container scheme to ready we need to have both the `colorScheme` and `typographyScheme` nonnull. By making colorScheme and typographyScheme of MDCContainerScheming nonnull, clients will reduce the amount of conditional checks required in their apps and reduce a category of potential errors (accidentally passing nil to a nonnull parameter).

## The problem
Both `colorScheme` and `typographyScheme` were nullable in the container scheme making it harder for clients to use the container scheme throughout their app on non Material UIElements, i.e. UIView.backgroundColor

## The fix
Make both of these properties nonnull.

## Additional work
- [x]  I had to update the swift examples to not be optional and I additionally removed the nil checks from the ObjC examples.
2019-02-27 15:47:26 -05:00
Joe Aguilar
fc7f30d012 [Catalog] Completed audit of swift forced unwrapping in catalog (#6186)
This work closes #3984.

This change audits the rest of the catalog swift examples force unwrapping. I had begun this process with PR #6117.
2019-02-06 11:01:48 -05:00
Robert Moore
514e93c886
{Beta} Fix theming imports (#6530)
Updating imports across components to use the correct umbrella
headers. Also using framework-style imports when crossing podspecs.
2019-01-31 09:06:18 -05:00
Andrew Overton
be0d177e10
[Cards] Use containerScheme in Cards examples (#6500)
This PR adds container scheme properties to the cards examples as well as calls to the theming extension method.

Closes #6440.
2019-01-30 14:16:40 -05:00
Robert Moore
800188a649
{clang-format} Format the components. (#6347)
This is a follow-up to https://github.com/material-components/material-components-ios/pull/6027

```
find components \( -name "*.h" -or -name "*.m" \) | xargs clang-format -i
```
2019-01-23 11:08:43 -05:00
rami-a
b380bca14e Fix for release-candidate merge issue with develop (#6068)
It appears when the release-candidate was merged back into develop, some code changes were lost/reverted unintentionally. 

See for the details here: 026a2005e7

This change brings all the necessary changes back into develop. Specifically around the cards theming extension and the updated Card theming examples.

This issue appears to stem from the fact that these 2 PRs landed in develop after the release-candidate was branched:
#6048
#6049
2018-12-19 23:14:29 -05:00
Rob Moore
026a2005e7 Merge branch 'release-candidate' into develop 2018-12-19 15:42:46 -05:00
Robert Moore
11a74d41ac Revert "[Cards] Add theming extension for Cards component (#6033)"
This reverts commit fdaf872c605cab44a4579cb8b7f0ea168c445318. The
container scheme import is missing in a Swift example.

```
material_components_ios/components/Cards/examples/EditReorderCollectionViewController.swift:38:24 use of undeclared type 'MDCContainerScheming'
  var containerScheme: MDCContainerScheming {
                       ^~~~~~~~~~~~~~~~~~~~
```
Reopens #6030
2018-12-19 14:59:14 -05:00
rami-a
58db37d09d
[Cards] Cards theming extension + snapshots: Re-revert with fix (#6049)
This is a re-revert of #6048 that includes a missing import statement that was causing bazel to fail.

This re-reverts #6033 and #6041 

Closes #6030 
Closes #5493 

The missing import is in `EditReorderCollectionViewController.swift` for `MaterialContainerScheme`
2018-12-18 16:24:54 -05:00
Robert Moore
63a0435070
[Cards] Revert cards theming exstension (#6048)
Cherry-picks the Theming extension revert from the `release-candidate` branch and reverts the Snapshot testing changes that used the Theming extensions.

Reopens #6030 
Reopens #5493
2018-12-18 15:25:01 -05:00
rami-a
fdaf872c60
[Cards] Add theming extension for Cards component (#6033)
### Context
As the team pivots to using theming within extensions we continue this work with Cards.

### The problem
We currently do not theme cards using a theming extension

### The fix
* Add theming extension for MDCCard and MDCCardCollectionCell
* Write unit tests for new extension
* Update existing examples to utilize the extension

### Bug
Closes #6030 

### Screenshots
Everything should be exactly the same visually.

| Before | After |
| - | - |
|![simulator screen shot - iphone 7 - 2018-12-17 at 13 59 52](https://user-images.githubusercontent.com/2364772/50110092-65f39680-0207-11e9-9a32-02161f7b2df4.png)|![simulator screen shot - iphone 7 - 2018-12-17 at 14 01 51](https://user-images.githubusercontent.com/2364772/50110130-7dcb1a80-0207-11e9-83d9-53bc98ad374b.png)|
2018-12-18 09:38:37 -05:00
featherless
73bdc03c2b
[automated] Rename MaterialComponentsAlpha to MaterialComponentsBeta. (#6018)
This is an automated change generated by replacing all instances of MaterialComponentsAlpha with MaterialComponentsBeta. This is not a breaking change because changes to Alpha/Beta components (including renaming them) are not considered breaking.

The MaterialComponentsAlpha podspec was mistakenly named Alpha, when what we meant was more close to Beta. The distinction is that Alpha components are not expected to be used by clients, while Beta components are.
2018-12-14 10:47:31 -05:00
Randall Li
a37f0d1bf7 added missing imports for Buttons_Theming 2018-12-05 15:45:40 -05:00
Randall Li
371f3ac9a7 Add imports for MaterialContainerScheme 2018-12-05 14:35:59 -05:00
Galia Kaufman
9e80ade173
[Buttons] Add text button themer (#5885)
Adding a text themer to material themer category for Buttons.  Issue: #5847
2018-12-04 10:19:01 -05:00
Robert Moore
74a27253e8
Global replace of integral single-precision literals with integer literals. (#5709)
Global replace of integral single-precision literals with integer literals.

Regular expression used:
```perl
/[^\w]([0-9]+)\.[0]*[fF]/$1/
```
2018-11-08 14:02:04 -05:00
Yarden Eitan
16c3841978
added shape theming to card examples (#5059)
Integrating the recently created Cards shape themer in the examples that have already integrated the CardThemer.

closes #5052
2018-09-07 15:25:35 -04:00
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
Yarden Eitan
3480c50c67
updated to newest CbC standard (#4956)
Move to the new CbC standard released in CatalogByConvention v2.5.0. See PR: material-foundation/cocoapods-catalog-by-convention#27 for more info on the change.
2018-08-29 20:45:13 -04:00
Robert Moore
bf099ab14f
[Cards] Fix example IBOutlet (#4827)
When running internally, the `view` property didn't have an IBOutlet binding.
This caused a crash.

|Before|After|
|--|--|
|![card-iboutlet-before](https://user-images.githubusercontent.com/1753199/44282685-dd012a00-a229-11e8-8163-c3bb7fe10a3e.png)|![card-iboutlet-after](https://user-images.githubusercontent.com/1753199/44282698-e38fa180-a229-11e8-9cdb-083fa5ce688f.png)|
2018-08-17 15:29:47 -04:00
Robert Moore
ae8fcb4e47
[Cards] Fix Swift imports (#4826)
So that it can compile internally.
2018-08-17 14:27:50 -04:00
Galia Kaufman
f040e95bff
[Cards] accessibility example for collection cards (#4488)
Updating the Cards "Edit/Recorder" example to demonstrate accessibility for tappable cards that are part of a collection.
2018-07-30 14:21:09 -04:00
Galia Kaufman
ae8231e49a
[Cards] Add accessibility documentation (#4454)
Adding accessibility documentation to Cards.
Closes issue: b/78768477.
2018-07-16 10:27:08 -04:00
Yarden Eitan
27a6c46fc3
[Cards] Added interactability toggle to Cards (#4404)
After a discussion with design we have concluded that a card as a whole doesn't need to be interactable as long as there are other interactable components in its content. As an example, a card that has a button can remove its interactability and allow the button to operate as the interactable entity.

This PR includes:

addition of the isInteractable boolean for MDCCard and MDCCardCollectionCell.
Update to our Card examples to show this change.
Update unit tests for Cards to test the new property.
Small fix to the card example.
This unblocks #4261
2018-06-26 16:39:40 -04:00
Robert Moore
9cef13c1a7
[Cards] 'Edit' button should show action, not state (#3733)
The Edit/Reorder example's appbar button for "Edit" or "Reorder" should show
the action that will take place, not the current state. The title should
reflect the current state.

Pivotal: https://www.pivotaltracker.com/story/show/157298528

**Before**
![simulator screen shot - iphone x - 2018-05-04 at 13 52 29](https://user-images.githubusercontent.com/1753199/39643331-706e01da-4fa2-11e8-9c35-9dbc93bf6038.png)

**After**
![simulator screen shot - iphone x - 2018-05-04 at 13 51 13](https://user-images.githubusercontent.com/1753199/39643274-40dc5caa-4fa2-11e8-9045-b075c348c1c1.png)


Known issue: 
#3731 - Button does not adjust size when the text changes
2018-05-04 14:10:32 -04:00
Yarden Eitan
96933c385f
[Cards] Fix examples and themer (#3700)
* fix themer and example

* update
2018-05-03 18:41:22 -04:00