28 Commits

Author SHA1 Message Date
Jeff Verkoeyen
96cfc7e331 Internal change
PiperOrigin-RevId: 394241967
2021-09-01 08:56:53 -07:00
Alyssa Weiss
85cdcadbec Update MDC chip examples to no longer use mdc_adjsutFontForContentSizeCategory to support Dynamic Type.
PiperOrigin-RevId: 371925667
2021-05-04 09:04:07 -07:00
Jeff Verkoeyen
2a8a6ac1c9 Optimizing imports
PiperOrigin-RevId: 357185734
2021-02-12 07:31:35 -08:00
Wenyu Zhang
c7dfe42227 [Chips] Remove visibleAreaInsets usage in examples with their corresponding snapshot tests.
PiperOrigin-RevId: 320631647
2020-07-10 10:46:59 -07:00
Wenyu Zhang
87422cf14f [Chips] Add centerVisibleArea to MDCChipView and deprecate visibleAreaInsets.
PiperOrigin-RevId: 318399857
2020-06-25 20:08:22 -07:00
Wenyu Zhang
db48cefa9b [Chips] Add visibleAreaInsets API to MDCChipView.
PiperOrigin-RevId: 314146955
2020-06-01 09:51:19 -07:00
Wenyu Zhang
1992bbdd21 [Chips] Adjust hitAreaInsets in the typical example.
PiperOrigin-RevId: 312474752
2020-05-20 07:05:32 -07:00
Dave MacLachlan
ebac2a8eb7 As of iOS 9/macOS 10.11 (circa 2015) removing objective C objects from the NSNotificationCenter in - (void)dealloc. is no longer required (the classic example is: [[NSNotificationCenter defaultCenter] removeObserver:self] but there are several variations).
In many cases this is the only thing being done in - (void)dealloc, so we can remove the whole thing.

PiperOrigin-RevId: 307663440
2020-04-21 13:00:30 -07:00
featherless
d59cab0d9f
[Chips] Fold more supplemental code into the examples. (#8605)
This is further polish as part of https://github.com/material-components/material-components-ios/issues/8459
2019-10-17 16:52:18 -04:00
featherless
cf1a9010f1 [Chips] Move ChipModel into ChipsTypicalUseViewController. (#8579)
It is not reused by any other example. Folding it into the example removes one layer of file indirection required to understand this example.

Polish as part of https://github.com/material-components/material-components-ios/issues/8459
2019-10-14 11:30:55 -04:00
featherless
4f7e1e00c3
[Chips] Remove all lazy initialization of models from examples. (#8576)
The lazy initialization adds unnecessary complexity to the examples.

Polish for https://github.com/material-components/material-components-ios/issues/8459
2019-10-11 17:51:44 -04:00
featherless
dbfaa92f9b
[Chips] Add Dynamic Type support to the remaining chip collection examples. (#8567)
This is part of https://github.com/material-components/material-components-ios/issues/8459
2019-10-11 08:53:14 -04:00
Andrew Overton
0626ccff89
[Chips] Update chips examples to use container schemes (#6477)
This PR adds a container scheme property to the chips examples that didn't have them.
It also uses the theming extension to theme chips that weren't already being themed with it.

Closes #6439.
2019-01-30 11:36:45 -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
Cody Weaver
12b841aff6
[Chips] Add example to BUILD file (#6273)
Closes #6218
2019-01-11 15:03:14 -05:00
rami-a
ae6d459a34
[Chips] Respect safe area for Chips examples (#5377)
Several examples under Chips were not respecting the safe area and therefore obscruing content on iPhone X in landscape. This change fixes that for:
* ChipsActionExampleViewController
* ChipsChoiceExampleViewController
* ChipsFilterExampleViewController

Closes #3705 
Closes #3706 
Closes #3707 


Before:
![simulator screen shot - iphone x - 2018-10-09 at 15 52 46](https://user-images.githubusercontent.com/2364772/46696484-378e8500-cbe0-11e8-9eb0-fedb5f3a0da9.png)

After:
![simulator screen shot - iphone x - 2018-10-09 at 15 55 43](https://user-images.githubusercontent.com/2364772/46696489-3bbaa280-cbe0-11e8-8cfe-e79118205c67.png)
2018-10-10 10:02:17 -04:00
Yarden Eitan
31e4007ec0
[Chips] Integration of the chip themer into the examples (#5113)
This is a follow up PR for #5111  and #5112 and relies on both.

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

This closes #5048
2018-09-13 18:40:43 -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
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
1ccd86a256
[Chips] Make collectionView in Chip Demo respect safe area (#4896) 2018-08-27 16:51:01 -04:00
Joe Aguilar
6e6a6bf827 [Chips] Example respects safe area (#4856)
Update: ChipsTypicalUseViewController.m to respect safe area in landscape. Closes issue #3704.

iPhone X / iOS 11.4
2018-08-21 16:18:03 -04:00
Andrew Overton
7272f877a1
[Chips] Add accessibilityHint to clear button in chips example (#4504)
* Add accessibilityHint to clear button in chips example

* Explicitly set normal and disabled colors for right bar button item in chips typical use view controller
2018-07-11 17:35:34 -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
Yarden Eitan
7f7bc36202
[Catalog] Expose colorScheme + typographyScheme properties for all examples to use app wide theming (#3478)
Made colorScheme and typographyScheme properties in the class interfaces for all our examples.
Moved theming away from example inits and into viewDidLoad
Small update for slider example to allow it to grab the theming properly.
Related Pivotal: https://www.pivotaltracker.com/story/show/156616695
2018-04-25 15:15:17 -04:00
featherless
819d321eed
[Chips] Add umbrella headers for all extension targets. (#3464)
Also updated all imports to make use of the umbrella headers.

Pivotal story: https://www.pivotaltracker.com/story/show/157045283
2018-04-24 16:18:19 -04:00
Mohammad Cazi
81351551f6
Chips typography implementation. (#3312)
Tests and example added.
2018-04-10 15:41:44 -04:00
Robert Moore
92fecd4cde
[Chips] Support Dynamic Type and show it in example. (#3123) 2018-03-21 15:51:13 -04:00
Sam Morrison
7c8131b672 [Chips] Chip component (#2389)
* [Chips] Chip component

* Update description

* Readme fixes

* NSMutableArray -> NSArray

* Use MDCSlider

* Chips examples CBC

* MDCChipCollectionViewCell.m

* Sanitize example

* Left align single-item rows

* Copy

* Check mark

* Use static inline instead of #define

* initWithFrame:CGRectZero

* encoding decoding

* GGRectGetMinX

* If no title color has been set for a given state...

* Use new icons

* rm init override

* alwaysAnimateCellResize -> alwaysAnimateResize

* MDCChipCollectionViewCell initWithCoder

* Fix MDCChipView encoding

* Fix indent

* Fix sizing images

* Use UIEdgeInsetsInsetRect

* Layout around hidden accessory view

* TODO Pull background color from MDCPalette

* Add The chip uses this property to determine intrinsicContentSize and sizeThatFits.

* Use static functions instead of UIColor extension

* sizeToFit -> setNeedsLayout
2017-11-15 08:29:10 -05:00