360 Commits

Author SHA1 Message Date
Yarden Eitan
d7f566994a
[Docs] Adds the shape themer API to the supporting components using the doc generation (#5464)
This PR adds the shape theming API documentation using the doc generation script improvements that were added in PR #5463 .

To achieve this, I added into the .vars files of the supported components the missing variables, and ran the script `scripts/apply_all_templates`. Then I ran `scripts/generate_readme component` for the components that have been added the `shape-theming.md` file, so it is seen in the actual README.md of the component.

Specifically, Bottom Sheet was using the old method of documentation, and wasn't using the right generation method, so it's doc content was just copied to the right location to allow its generation to work well as well.

Closes #5319
2018-10-19 17:05:50 -04:00
rami-a
bff3fcf7f1
[Buttons] [MaskedTransition] Apply safe area to floating button example and masked transition example (#5389)
This change applies the safe area to the examples for Floating Button and Masked Transition so that they appear correct on notched displays in landscape.

Closes #3702 
Closes #3714 

Floating Buttons Before:
![simulator screen shot - iphone x - 2018-10-10 at 12 53 13](https://user-images.githubusercontent.com/2364772/46752602-a4128e00-cc8b-11e8-8d58-32255db304af.png)

Floating Buttons After:
![simulator screen shot - iphone x - 2018-10-10 at 12 52 33](https://user-images.githubusercontent.com/2364772/46752584-9a892600-cc8b-11e8-9f8f-fafbc67e2a8b.png)

Masked Transition Before:
![simulator screen shot - iphone x - 2018-10-10 at 12 53 23](https://user-images.githubusercontent.com/2364772/46752610-a8d74200-cc8b-11e8-8ed9-ba010d279d9a.png)


Masked Transition After:
![simulator screen shot - iphone x - 2018-10-10 at 12 52 28](https://user-images.githubusercontent.com/2364772/46752564-91985480-cc8b-11e8-82e6-1458de23c38a.png)

Additionally, I noticed in the Masked Transition example that the left/right fabs were swapped in their position so I fixed this. I also applied the safe area to the fullscreen transition example.
2018-10-10 16:48:34 -04:00
Louis Romero
30138a9082 Fix a typo around text vs contained button (#5367) 2018-10-10 18:13:14 +03:00
Yarden Eitan
bfc674a631
[Shape]! Terminology updates to the Shape Scheme (#5247)
**<><>This is a breaking change<><>**

There are slight terminology updates to the current Shape Scheme. 

First, we are staying with the Cut notion for cut corners rather than Angled. This is on par with our current naming of the CutCornerTreatment.

Secondly, we are moving from the term S/M/L Surface to S/M/L Component for the scheme categories.
2018-09-26 13:01:08 -04:00
Yarden Eitan
4e456f88ce
[Buttons] Integrate the FAB shape themer into our examples (#5133)
This resolve issue #5049 and is a follow up to PRs #5131 and #5132 and relies on their code.
2018-09-17 11:54:07 -04:00
Yarden Eitan
a7810bbc5e
[Buttons] Add the Floating Button Shape themer to the Floating Button themer (#5132)
This is a follow up for #5131 and relies on it.

This essentially integrates the FAB shape themer into the main FAB themer.
2018-09-17 11:05:39 -04:00
Yarden Eitan
a87ad9a121
[Buttons] Addition of a FAB shape themer (#5131)
This is an addition of a FAB shape themer.

This resolves issue #5055
2018-09-17 10:38:29 -04:00
Yarden Eitan
08bb1d707a
[Buttons] Integration of the button shape themer into the examples (#5121)
This is a follow up PR for #5119  and #5120 and relies on both.

This integrates the created shape themer for buttons into the examples that currently use color/typography themers.

This closes #5050
2018-09-14 13:49:27 -04:00
Yarden Eitan
b27c6f5654
[Buttons]! Integrate the shape themer into the MDCButton themer (#5120)
This PR is a follow up and has the code of #5119 

Here we are adding the shape themer into the MDCButton themer.
2018-09-14 13:20:34 -04:00
Yarden Eitan
e785745070
[Shapes] Bug fix for getting the wrong backgroundColor when shapeGenerator is set. (#5127)
This bug fix resolves issue #5126 

Quoting issue:
"Shape-able components such as Buttons and Chips rely on an `MDCShapedShadowLayer` as their main layer class underlying the view. Due to that, there is new logic for setting and getting the `backgroundColor` and is done through `self.layer.shapedBackgroundColor`. There exists logic in these components for setting the `shapedBackgroundColor` when calling the `backgroundColor` setter. However, when fetching `backgroundColor`, then Button and Chips don't have a getter to fetch `shapedBackgroundColor`. This means that when those components do have a custom shape active, then when fetching the background color, it will not return the correct one."
2018-09-14 12:57:44 -04:00
Yarden Eitan
d884aeccf1
[Buttons] Addition of a Shape Themer for MDCButton (#5119)
This resolves #5056   .

In this PR I am adding an MDCButton shape themer along with unit tests.
2018-09-13 18:02:47 -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
Jeff Verkoeyen
9854044c96 Revert "[automated] Standardize our open source license stanza to what Xcode generates. (#4982)"
This reverts commit b45bc2fdd4dfe12fc76751a45c9cf7b0d6c1261f.
2018-08-31 12:01:24 -04:00
featherless
b45bc2fdd4
[automated] Standardize our open source license stanza to what Xcode generates. (#4982)
Removes the need to copy-paste stanzas from other files anymore as we'll rely on https://github.com/material-components/material-components-ios/pull/4478 to generate the correct stanza for us instead.

This was an automated change generated by running a find-and-replace regular expression:

### Find

```
/\*
 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\.
 \*/
```

### Replace

```
// 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 11:49:00 -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
featherless
bbe4a23fe0
Remove all __IPHONE_11_0 checks now that we no longer support Xcode 8. (#4915)
We can now make use of @available throughout our codebase.

We support Xcode 9 and up, which includes the iOS 11 SDK. This means we can remove any guards for SDKs prior to iOS 11.

This was cleaned up by running a global find-and-replace with the following regular expression:

```
Find:#if defined\(__IPHONE_11_0\) && \(__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0\)\n(.+if \(@available\(iOS 11.0, \*\)\) \{(?:.|\n)*?)(?:#else(?:.|\n)*?)?\n#endif
Replace:$1
```

With some additional cleanup for stragglers that didn't match this pattern. Note that else clauses were intentionally dropped.

Closes https://github.com/material-components/material-components-ios/issues/4909
2018-08-28 09:57:30 -04:00
Wenyu Zhang
2444107e30
[Buttons] fix the text overlapping safeArea issue on
ButtonsShapesExampleViewController (#3703)

closes #3703 

#####Screenshots before the change:    
![before1](https://user-images.githubusercontent.com/8836258/44283102-4a618a80-a22b-11e8-955e-bfcc55f387ca.png)

![before2](https://user-images.githubusercontent.com/8836258/44283032-fc4c8700-a22a-11e8-9c9a-93626bc4a063.png)

####Screenshots after the change:
![after1](https://user-images.githubusercontent.com/8836258/44283041-040c2b80-a22b-11e8-94a4-1c5365474e8a.png)
![after2](https://user-images.githubusercontent.com/8836258/44283042-040c2b80-a22b-11e8-82d7-5bbdba149a8a.png)
2018-08-20 12:36:49 -04:00
Robert Moore
175942d9e0
[Catalog] Fix Swift example imports (#4780)
Many of our Swift examples are either missing imports or are importing all of
MaterialComponents. Both of these will cause failures during internal builds.
2018-08-14 13:26:37 -04:00
Robert Moore
c43677ace0
[Buttons] Fix safeAreaInsets availability check (#4775)
Only iOS 11+ has `safeAreaInsets` defined, so the compiler may complain when
we try to include without runtime guards available.
2018-08-14 12:37:43 -04:00
featherless
e14b90e829
[schemes/Color] Formally mark all to-be-deprecated APIs as "ToBeDeprecated". (#4738)
This change further formalizes our pattern of annotating APIs that will be or are deprecated using class categories. Moving an API into such a category has the benefit of being picked up by the API diff toolchain and elevated into our release notes as a result.
2018-08-09 16:39:56 -04:00
featherless
48890aa9bf
[Buttons] Remove NSCoding support. (#4565)
Closes https://github.com/material-components/material-components-ios/issues/3936
2018-07-17 13:14:11 -04:00
Randall Li
3d665a45b8
Removed internal links from docs. (#4559) 2018-07-17 10:35:56 -04:00
Cody Weaver
4e7db26ccb Fix button README (#4547)
Remove the duplicate heading for the accessibility section of the README and remove the {a11y} tag.
Closes #4545
2018-07-13 13:55:18 -04:00
featherless
abae199d71
[Catalog] Enable AppBar's isTopLayoutGuideAdjustmentEnabled in all examples. (#4537)
This enables the new FlexibleHeader/AppBar behavior that correctly updates the content view controller's safe area insets/top layout guide to match the flexible header's height and sets the frame of the content view controller to match the bounds of the container view controller.

As part of this change, we were able to remove the Catalog logic that would manually adjust the frame of examples that did not have a scroll view. Examples are now expected to adjust their content according to the top layout guide / safe area insets, as can be seen in the ButtonsTypicalUse example.

Examples that *do* have a scroll view will also now make use of the correct top layout guide / safe area insets behavior. This behavioral change can most notably be seen in the ActivityIndicator example, which no longer has a 20 point "dead zone" above the table view.
2018-07-12 15:43:53 -04:00
Robert Moore
3244f5491d
[Buttons] Disable FAB animation for VoiceOver (#4535)
When VoiceOver is running and the FAB animations for expanding/collapsing are
triggered, sometimes VoiceOver won't detect the FAB. It can still detect the
FAB if the user "scrubs" their finger to discover it, but it's a big problem
if they don't know they're missing a button.  The effect seems intermittent
and this is the best work-around.
2018-07-12 13:15:19 -04:00
Cody Weaver
88dabcfac9 [Buttons] Make accessibility docs match other components (#4501)
[Buttons] Make accessibility docs match other components
2018-07-11 16:45:16 -04:00
Robert Moore
7a1c3ced31 [Catalog] Fix VoiceOver ordering in Buttons demo (#4482)
The Buttons main demo had its views "out of order" when using VoiceOver
because the buttons' frames were closer to the top of the screen
relative to their labels. Instead of relying on the view hierarchy to
find all of the elements, they can be manually returned in-order.

Closes #3654
2018-07-10 15:53:25 -04:00
Randall Li
25b0ed9ea2
[Buttons] Updated accessibility documentation and examples (#4418)
Made copyedit improvements to the accessibility documentation.
Applied those instructions to the button examples.

Fixes: https://github.com/material-components/material-components-ios/issues/3874 and https://github.com/material-components/material-components-ios/issues/3873
2018-06-21 11:13:00 -04:00
Randall Li
1d692a8ab2 [Buttons] Added a11y minimum touch target size to Accessibility section in readme. (#4386)
* Added a11y minimum touch target size to Accessibility section in readme.
Catalog: added minimum size a11y to button example.

* Update README.md

* nit changes
2018-06-15 10:58:28 -04:00
Randall Li
5ec8aa0980
[Buttons] Adding Accessibility labels to README and fab example. (#4330)
https://github.com/material-components/material-components-ios/issues/3874
2018-06-01 10:08:58 -04:00
featherless
e1e6d249a4
[Docs] Add badges to all components. (#4278)
As part of our readme generator, components can now opt in to displaying badges in their readme.

The badges are generated from https://shields.io/ and are focused on an individual component. We're currently generating the following badges:

- Open bug count.
2018-05-25 11:12:48 -04:00
John Detloff
0c0ce4248e
Initialize default color and typography schemes in examples (#4200)
Ensure a default colorScheme and typographyScheme is initialized for examples.
2018-05-21 12:44:43 -04:00
featherless
480ceda722
[Buttons] Disable flaky test. (#4157)
Flaking with the following error:

```
<unknown>:0: error: -[FloatingButtonsTests testCollapseExpandAnimatedRestoresTransform] : Asynchronous wait failed: Exceeded timeout of 1 seconds, with unfulfilled expectations: "Expand animation complete".
```
2018-05-18 15:39:05 -04:00
Robert Moore
f8e2d2872a
[Buttons] Fix updateTitles to prevent crash (#4153)
When a button had more than one title-for-state value, changing the property
`-uppercaseTitle` would cause a crash on iOS 10 and below. This was because
the code was both enumerating and mutating the same `_nontransformedTitles`
dictionary.

Closes #4152
2018-05-10 14:46:52 -04:00
Mohammad Cazi
988a577902
FAB button in shapes example should be themed. (#3737)
https://github.com/material-components/material-components-ios/pull/3737
2018-05-04 15:49:41 -04:00
Jeff Verkoeyen
f059a37d50 Avoid picking up class properties in the API table for READMEs. 2018-05-04 09:16:24 -04:00
Adrian Secord
8cf0cb3e14 Update material.io/go/design-theming shortlink to material.io/go/design-color-theming. 2018-05-03 18:25:37 -04:00
featherless
da21941afa
Regenerate component docs with automatic API links. (#3673)
Example output:

<img width="468" alt="screen shot 2018-05-02 at 10 33 23 pm" src="https://user-images.githubusercontent.com/45670/39557914-d9512f38-4e58-11e8-824d-60f03bcd1b76.png">
2018-05-02 22:33:55 -04:00
featherless
037bf7d0f0
Flatten all +Extensions CocoaPods targets into standalone targets. (#3572)
This discourages depending on all of a component's extensions and aligns our targets more closely with how we expect them to be imported and depended upon.

This is a breaking change.

Pivotal story: https://www.pivotaltracker.com/story/show/157118721
2018-05-02 10:20:01 -04:00
featherless
0666763935
[Buttons] Add outlined button gif. (#3639) 2018-05-01 23:41:37 -04:00
featherless
91eca05769
[scripts] Ensure that asset urls are remapped when generating readmes. (#3640) 2018-05-01 23:39:10 -04:00
featherless
5ec3e78a50
[Buttons] Break the docs into separate articles and run the readme generator. (#3605) 2018-05-01 16:21:45 -04:00
John Detloff
d471d4324c
Ensure buttons and cards reset their states correctly (#3599)
Dont reset other states to 0 within MDCOutlinedButtonThemer, because since its an int thats not resetting, its overriding the behavior of defaulting to UIControlStateNormal

Within MDCCardThemer reset elevation and border to 0 in the non outlined variant.
2018-05-01 16:16:13 -04:00
John Detloff
045e93e669
Add documentation describing variants to buttons, chips and cards (#3600)
https://www.pivotaltracker.com/story/show/157164168
2018-05-01 16:15:12 -04:00
featherless
966a70e86d [Buttons] Theme the typical use example with the injected schemes. (#3603)
Before/after:

![simulator screen shot - iphone se - 2018-05-01 at 10 08 08](https://user-images.githubusercontent.com/45670/39475789-b171694c-4d27-11e8-92f2-7ff639586561.png) ![simulator screen shot - iphone se - 2018-05-01 at 10 07 20](https://user-images.githubusercontent.com/45670/39475791-b3995ac2-4d27-11e8-9c63-38ce55eec148.png)
2018-05-01 13:58:27 -04:00
John Detloff
fc39022a08
Fix outlined button themer tests (#3598)
Build fix
2018-04-30 17:34:15 -04:00
featherless
a66e99c310
[Buttons] Fix build regression. (#3595) 2018-04-30 16:41:54 -04:00
featherless
cb8571ab91
[Buttons] Fix build breakage. (#3593) 2018-04-30 16:25:26 -04:00
featherless
c061444df2
[Buttons] Add floating action button documentation. (#3592)
This change also updates the button gifs to match the catalog style.

Pivotal story: https://www.pivotaltracker.com/story/show/157199233
2018-04-30 16:02:12 -04:00
John Detloff
55b9952332
[Buttons] Add outlined button themer (#3566)
https://www.pivotaltracker.com/story/show/157003868

Updated version of: https://github.com/material-components/material-components-ios/pull/3483

Minor cleanup, changes squashed and rebased on develop, reverted changed to TextButtonThemer

Before:
![simulator screen shot - iphone x - 2018-04-27 at 16 29 50](https://user-images.githubusercontent.com/1418389/39383693-387b33f2-4a38-11e8-8691-8312b5c4001d.png)


After:
![simulator screen shot - iphone x - 2018-04-27 at 16 28 33](https://user-images.githubusercontent.com/1418389/39383669-19fb8a4e-4a38-11e8-8a99-539430bbb9a6.png)
2018-04-30 14:55:33 -04:00