29 Commits

Author SHA1 Message Date
Cody Weaver
b99faa6c28
[Buttons] Update examples to use theming extensions (#6475)
## Related links
* Related bug: #6441 
* Theming extensions: [Buttons+Theming](https://github.com/material-components/material-components-ios/tree/develop/components/Buttons/src/Theming)
## Introduction
The team is pivoting to using theming extensions so our examples should reflect the current best practices when using our APIs. 
## The problem
We are using _Themers_ in some instances and some instances used a work around for the container scheme. In #6458 we added a Catalog wide container scheme.
## The fix
Remove _Themers_ for _Theming extensions_ and remove the workarounds for not having a catalog wide container scheme.
2019-01-28 09:09:46 -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
Randall Li
fe0099d65c Merge branch 'release-candidate' into develop 2018-12-06 16:36:03 -05:00
Wenyu Zhang
6267009748
[Buttons] Update secondary floating action button themer examples (#5922)
Update examples to use secondary floating button theming extension method instead of calling themer's class methods.

Related https://github.com/material-components/material-components-ios/issues/5844
2018-12-05 14:42:55 -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
Andrew Overton
748a9128e3
[Buttons] Add button theming category method for outlined theming (#5878)
This PR adds the MDCButton theming category method for outlined buttons.

Closes #5847.
2018-11-30 11:36:27 -05:00
Cody Weaver
4f0786a2bf
[Buttons] Add themer for contained buttons with container scheme (#5849)
### Context
As the team pivots to using theming within extensions we have started off with buttons as a test run. This will be part fo the work with buttons only addressing the contained button type. This adds a new method to MDCButton - `applyContainedThemeWithScheme:(id<MDCContainerScheming>)scheme`

### The problem
We currently do not theme buttons the way the team has decided to theme them

### The fix
This themes Contained buttons with the new style we have all agreed on.

### Remaining Work
Theming for Text and Outlined buttons in this new style.
2018-11-28 18:11:11 -05:00
Robert Moore
372d6b24f9
No longer using -init for Color Scheme. (#5734)
{MDC iOS} No longer using `-init` for Color Scheme.

Based on the discussions in go/mdc-ios-theming, we should not use the `-init` default initializer. Instead, we should use an explicit set of defaults.

Search regex: '\[\[MDCSemanticColorScheme alloc\] init\]'
2018-11-12 12:54:47 -05: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
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
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
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
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
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
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
featherless
200fc90621
[Buttons] Add a floating action button themer. (#3588)
Also updated the unit tests and typical use example.

I've also created https://www.pivotaltracker.com/epic/show/3956231 to track what we're going to do about MDCFloatinButton.
2018-04-30 13:48:56 -04:00
Randall Li
9201d9ec15 [Button] Removed example of stroked button (#3421)
* [Button] Removed example of stroked button

* removed unused variable
2018-04-26 11:27:06 -04:00
featherless
d4f727e16f
[Buttons] Add umbrella headers for all extension targets. (#3454)
Also updated all imports to make use of the umbrella headers.

Pivotal story: https://www.pivotaltracker.com/story/show/157045283
2018-04-24 11:36:56 -04:00
Yarden Eitan
27eac8c05c
[Catalog] Implement API for setting app-wide theming (#3461)
Pivotal Story: https://www.pivotaltracker.com/story/show/156616695

This includes an implementation example in the ButtonTypicalUse example. In a separate PR will this be added to the rest of our examples.
2018-04-24 11:08:54 -04:00
Mohammad Cazi
238b6d7b06
Added ImageTintColor for theming FAB Button. (#3442)
https://github.com/material-components/material-components-ios/pull/3442
2018-04-23 14:53:06 -04:00
Mohammad Cazi
ece3c1457b [MDCButton] Added new API for coloring image tint color for state. (#3423)
Examples updated.
Unit Test Written.
![screen shot 2018-04-20 at 1 14 17 pm](https://user-images.githubusercontent.com/36271115/39064922-27f71680-449e-11e8-99fb-9fcd0e69d870.png)
![screen shot 2018-04-20 at 1 14 21 pm](https://user-images.githubusercontent.com/36271115/39064929-2be07ffc-449e-11e8-820b-7812cbb8d382.png)
2018-04-20 17:10:41 -04:00
Mohammad Cazi
82d19ae5d0 [Buttons] Create a separate class for MDCFloatingButton color themer. (#3429)
Added MDCFloatingButtonColorThemer to color theme a floating button.
examples and tests are updated.

![screen shot 2018-04-20 at 1 14 17 pm](https://user-images.githubusercontent.com/36271115/39068266-baf19f22-44a9-11e8-9eaa-fe58d74dd804.png)
2018-04-20 16:43:27 -04:00
Randall Li
3d1a7c2791
[Button] Contained: Changed colors for ink and disabled (#3419)
https://www.pivotaltracker.com/story/show/156403056

Before:
![simulator screen shot - iphone 8 plus - 2018-04-20 at 10 43 46](https://user-images.githubusercontent.com/943565/39057651-c1bbcab6-4487-11e8-8d0d-86af1c1652cb.png)

After:
![simulator screen shot - iphone 8 plus - 2018-04-20 at 10 40 23](https://user-images.githubusercontent.com/943565/39057492-5784a550-4487-11e8-98f6-14faf9c1cf8d.png)

Before Ink:
![simulator screen shot - iphone 8 plus - 2018-04-20 at 10 43 49](https://user-images.githubusercontent.com/943565/39057657-c6153b60-4487-11e8-8058-377f053dd6a4.png)

After Ink:
![simulator screen shot - iphone 8 plus - 2018-04-20 at 10 40 26](https://user-images.githubusercontent.com/943565/39057513-60806f04-4487-11e8-871c-f838e989f1f0.png)
2018-04-20 13:45:35 -04:00
Randall Li
1fa5bdf0b3
[Button] Changed text button disabled to do 37% opacity, Ink to use onSurface 16% (#3406)
Changed typical use example to use MDCTextButtonThemer.

https://www.pivotaltracker.com/story/show/156402729

before:
![simulator screen shot - iphone 8 plus - 2018-04-19 at 12 12 57](https://user-images.githubusercontent.com/943565/39004311-096558cc-43cb-11e8-8338-5ab4deb7ed90.png)

after:
![simulator screen shot - iphone 8 plus - 2018-04-19 at 14 00 25](https://user-images.githubusercontent.com/943565/39009598-0fc7c3e4-43da-11e8-9215-1184781ca759.png)

Ink screenshots:
before:
![simulator screen shot - iphone 8 plus - 2018-04-19 at 12 13 58](https://user-images.githubusercontent.com/943565/39004389-334189ae-43cb-11e8-86d1-dd4b0e45e731.png)

after:
![simulator screen shot - iphone 8 plus - 2018-04-19 at 14 00 27](https://user-images.githubusercontent.com/943565/39009606-14209cb8-43da-11e8-9e0b-d1610d45fed2.png)
2018-04-19 14:35:22 -04:00
Mohammad Cazi
c818048a1c
[MDCFloatingButton] Color Themer added. (#3381)
* MDCFloatingButton Color Themer added.
No support for icon color change inside color themer, this is left for user to handle for now.
Example added.
Pivotal: https://www.pivotaltracker.com/story/show/156725760

* Remove redundancy in tests and FabButtonColorThemer.

* Adding another example for color theming of a button.

* Setting secondary color for the test instead of primary since that's the value that's being used.

PR: https://github.com/material-components/material-components-ios/pull/3381
2018-04-18 15:32:53 -04:00
Yarden Eitan
67a68d3d3c
[Buttons] Added Shapes Support (#3368)
Pivotal Story: https://www.pivotaltracker.com/story/show/156168281

* Implementation of Shapes support in Buttons.
* Added example of using shapes on different styles of buttons (see screenshot and gif below).
* Exposed an initializer for MDCCurvedCornerTreatment to be able to use in the example.
* Exposed the color sublayer in MDCShapedShadowLayer to allow hierarchal reordering of sublayers for a shaped button to work with ink and shadow correctly.
* Updated unit tests.
2018-04-17 19:42:12 +03:00