20 Commits

Author SHA1 Message Date
Jeff Verkoeyen
c53f44398e Optimizing imports
PiperOrigin-RevId: 357185618
2021-02-12 07:29:28 -08:00
Robert Moore
8eb7296dab
[Catalog] Fix container scheme properties. (#9192)
Making remaining examples use protocol for container schemes to match the
project's expected convention.

Found while reviewing #9188
2019-12-09 10:48:25 -05:00
Yarden Eitan
f6855caa77
[Buttons] Fix a11y issues in Buttons (Content Edge Insets) exam… (#8900)
In this PR we are fixing the non-accessible colors that were caused due to the container scheme being nil, as init isn't being called with a Storyboard, but rather initWithCode.

Secondly, now the FAB has a good a11y label, so it can be presented correctly when focused.

Before:
![Simulator Screen Shot - iPhone 7 - 2019-11-15 at 09 53 25](https://user-images.githubusercontent.com/4066863/68952401-c8de0c80-078d-11ea-8816-d1e667fbef6b.png)

After:
![Simulator Screen Shot - iPhone 7 - 2019-11-15 at 09 52 50](https://user-images.githubusercontent.com/4066863/68952352-b4017900-078d-11ea-8cf9-08c081a779d9.png)

Closes #8831
2019-11-15 11:34:17 -05:00
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
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
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
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
featherless
2414525074
[Buttons] Replace MDCFlatButton with MDCButton + text themer in content edge insets example. (#3583)
Also fixes a bug where the button was being initialized as a system button instead of as a custom button. This was affecting the highlighted text state.

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

Before (normal / highlighted):
![simulator screen shot - iphone se - 2018-04-30 at 09 21 34](https://user-images.githubusercontent.com/45670/39429179-18130c08-4c58-11e8-972a-b96dd827ee26.png) ![simulator screen shot - iphone se - 2018-04-30 at 09 21 36](https://user-images.githubusercontent.com/45670/39429181-193b0ff4-4c58-11e8-8dab-dcdfcf86a7cf.png)

After (normal / highlighted):
![simulator screen shot - iphone se - 2018-04-30 at 09 21 03](https://user-images.githubusercontent.com/45670/39429211-2e171710-4c58-11e8-95e6-07eb614857c8.png) ![simulator screen shot - iphone se - 2018-04-30 at 09 21 04](https://user-images.githubusercontent.com/45670/39429215-30bde2c8-4c58-11e8-882a-e585da609684.png)
2018-04-30 12:48:38 -04:00
featherless
7c6248ccc0
[Buttons] Replace MDCRaisedButton with contained button APIs in content edge insets example. (#3453)
Pivotal story: https://www.pivotaltracker.com/story/show/157045336

Before:
![simulator screen shot - iphone se - 2018-04-24 at 07 30 07](https://user-images.githubusercontent.com/45670/39184503-995e4cda-4791-11e8-9ba7-6049c1a4d905.png)

After:
![simulator screen shot - iphone se - 2018-04-24 at 07 29 48](https://user-images.githubusercontent.com/45670/39184509-9bf4893c-4791-11e8-9fdf-a58c36fd90ce.png)
2018-04-24 08:53:01 -04:00
Randall Li
53dddde6cf [Button Examples] Moved most examples into dragons so that only beautiful demos are in the main catalog. (#3358)
[Button Examples] Moved most examples into dragons so that only beautiful demos are in the main catalog. (#3358)

https://www.pivotaltracker.com/n/projects/2150420/stories/156402729
2018-04-13 16:23:21 -04:00
Yarden Eitan
29d760c7d6
Added isPresentable to catalog files, ported over ZShadow to dragons. (#2726) 2017-12-15 12:20:35 -05:00
Randall Li
00611df7bd
[Buttons] Corrected imports in examples. (#2645)
* [Buttons] Corrected imports in examples.

PiperOrigin-RevId: 175377616

* added import UIKit
2017-12-08 11:40:03 -05:00
Randall Li
b1ec22207f
Fixed float conversion build errors (#2602)
* Fixed float conversion build errors
Implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float')

Found by turning on warnings via: https://github.com/material-components/material-components-ios/pull/2480

* More Fixed float conversion build errors
Implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float')

Found by turning on warnings via: https://github.com/material-components/material-components-ios/pull/2480
2017-12-06 15:57:04 -05:00
Robert Moore
2d8333d7d8 [Buttons] Extended FAB (#2563)
* [Buttons] Remove .largeIcon shape from FloatingButton (#2513)

The LargeIcon shape is not required, since the same behavior (support
for 36-point images) can be achieved by setting the contentEdgeInsets to
.zero.

Also updates one of the button examples to use a 36-point icon.

* [Buttons] Add extended FAB layout code (#2528)

Creating (internal for now) the required properties and layout code to support
the extended FAB. Unit tests to confirm the behavior and some minor
adjustments to existing values like default contentEdgeInsets values.

Implements #2495

* [Buttons] Expose Extended FAB properties (#2543)

Making the new properties public and also migrating away from simple
property setters to the new forShape:inMode: setters required for
UIAppearance support.

* minimumSize
* maximumSize
* contentEdgeInsets
* hitAreaInsets

Implements #2495

* [Buttons] Add basic Floating Button example (#2554)

Includes automatic adjustment of extended/normal layout depending on size
classes.

Demonstrates #2495

* [Buttons] Update README for Extended FAB (#2561)

The README includes usage examples for the FAB. Adding a section to
demonstrate how to configure the FAB in its different shapes and modes.

Documents #2495
2017-12-04 12:55:55 -05:00
Robert Moore
8940d77d6d [Catalog] Verify all examples provide CatalogByConvention methods (#1911)
All examples now have at least the required `+catalogBreadcrumbs` and `+catalogIsPrimaryDemo`.  All examples in the same breadcrumbs path have only one primary demo.  There should be only one `-catalogDescription` attached to the primary demo.

Closes #1897
2017-08-31 08:46:10 -04:00
Robert Moore
cafcbe3544 [Buttons] Unbounded ink aligns to content insets (#1670)
* [Buttons] Unbounded ink aligns to content insets

Unbounded ink should be centered on the content of buttons, but bounded
ink should remain aligned with the bounds of the button.

* Changing Ink behavior for unbounded ink
* Modified Content Rect Insets example in the Catalog

Closes #1669

* Making example buttons have same width
2017-07-21 13:54:27 -04:00
Robert Moore
cc57a07918 [Buttons] Ink should ignore content edge insets (#1593)
The `contentEdgeInsets` value of an MDCButton causes the `_inkView` to
realign to match the `contentRect`.  This results in a ripple/highlight
that does not match the position of the button on-screen (doesn't align
with the background).

This commit removes the re-alignment code, so `_inkView` will remain
aligned with the rest of the button's view.
2017-06-30 15:01:40 -04:00