26 Commits

Author SHA1 Message Date
David Collazo
7fd4094424 Change MDCChipField to use UITextField instead of MDCTextField.
PiperOrigin-RevId: 591304366
2023-12-15 11:01:16 -08:00
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
Bryan Oltman
c3f17b143a Internal change
PiperOrigin-RevId: 309089945
2020-04-29 13:53:57 -07:00
Nobody
e035d70f50 Project import generated by Copybara.
PiperOrigin-RevId: 309039129
2020-04-29 17:00:59 +00:00
Bryan Oltman
6735eea13f [Chips] Add EarlGrey test to expose issue where MDCChipField hides placeholder text after input
and rotation.

PiperOrigin-RevId: 308255597
2020-04-24 08:09:16 -07:00
featherless
588024d04f [Chips] Fold supplemental code into the examples. (#8587)
Also aligned the examples to consistently make use of properties instead of ivars.

ivar -> property replacement done using the following regexp:

- Find: `_(\w+)`
- Replace: `self.$1`

Cleaned up the following examples:

- ChipsActionExampleViewController
- ChipsChoiceExampleViewController
- ChipsCustomizedExampleViewController
- ChipsInputExampleViewController
- ChipsSizingExampleViewController
- ChipsShapingExampleViewController

Polish as part of https://github.com/material-components/material-components-ios/issues/8459
2019-10-15 22:02:52 -04:00
featherless
eac0034d93
[Chips] Add Dynamic Type support to ChipsInputExampleViewController. (#8569)
Part of https://github.com/material-components/material-components-ios/issues/8459

Testing strategy:

1. Open the ChipsInputExampleViewController example in MDCCatalog.
2. Type some chips.
3. Change the system Dynamic Type size to a large and then small size and back again. After each change, verify that the chip field changed in reaction.

![Simulator Screen Shot - iPhone 11 Pro Max - 2019-10-11 at 08 55 22](https://user-images.githubusercontent.com/45670/66652939-df300000-ec04-11e9-9083-b97427b14bd5.png)
2019-10-11 09:27:43 -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
c604f9fd35
[Chips] Update chips examples to use theming extension (#6096)
### Context
As the team pivots to using theming within extensions we continue this work with Chips.

### The problem
We currently do not utilize the theming extension for chips examples

### The fix
* This change updates all the chips examples to use the new chips theming extension.
* Additionally, this updates the shape example to use the new chips theming extension.

### Bug
Closes #6083
2018-12-21 13:13:45 -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
Cody Weaver
d57e6b724f
[Chips] Update example (#5118)
Previously the example didn't respect the safe area or use a typography scheme. This addresses both issues and cleans up some code. You previously couldn't see the chip field because it was hidden behind the app bar.

Closes #3708 

| Before | After |
| ------ | ------ |
|![simulator screen shot - iphone x - 2018-09-13 at 16 28 51](https://user-images.githubusercontent.com/7131294/45513977-259cfc00-b772-11e8-89c7-bcfb65825723.png)|![simulator screen shot - iphone x - 2018-09-13 at 16 27 17](https://user-images.githubusercontent.com/7131294/45513995-30579100-b772-11e8-877d-80c191b781e9.png)|
|![simulator screen shot - iphone x - 2018-09-13 at 16 28 57](https://user-images.githubusercontent.com/7131294/45514052-53824080-b772-11e8-969a-be99d248651e.png)|![simulator screen shot - iphone x - 2018-09-13 at 16 27 48](https://user-images.githubusercontent.com/7131294/45514058-5a10b800-b772-11e8-80fc-5abc602190d5.png)|
2018-09-14 07:25:27 -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
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
Robert Moore
dfe1f8516a Revert "[Chips] Vertically center chips within available space (#3511)" (#3582)
This reverts commit f69d36d963b5a172df42dce62b2bb3f847c99f47.

Problems were found when testing in Hebrew for some clients. (cl/194579932)
2018-05-01 09:14:54 -04:00
John Detloff
c185bc956f
Create a ChipThemer for material and outlined schemes (#3563)
Before:
![simulator screen shot - iphone x - 2018-04-27 at 13 43 06](https://user-images.githubusercontent.com/1418389/39376826-0283c50a-4a21-11e8-921f-1d18ac2e8c38.png)

After:
![simulator screen shot - iphone x - 2018-04-27 at 13 42 03](https://user-images.githubusercontent.com/1418389/39376832-050ea088-4a21-11e8-8c93-29ba62114249.png)
2018-04-30 16:26:56 -04:00
Robert Moore
25984d9f4b
[Chips] Add support for custom touch target (#3517)
Chips are small and so need support for custom touch target sizes. Following
the lead of MDCButton, a new property, `-hitAreaInsets` is added that clients
can use to support larger touch targets.

Closes #3513
Internal issue b/77728916
2018-04-27 10:38:51 -04:00
Robert Moore
f69d36d963
[Chips] Vertically center chips within available space (#3511)
When a Chip Field's `chipHeight` value is greater than the actual height of a
chip, the chip is not aligned with the input text. Although baseline is ideal
(to ensure multiple fonts work, etc.), vertically centering works sufficiently
well when the text field and the chip have the same font.

Partially implements #3507

**Before**
![chipfield-size-before](https://user-images.githubusercontent.com/1753199/39321042-d532df64-4953-11e8-85a3-e7108a1106a6.png)

**After**
![chipfield-size-after](https://user-images.githubusercontent.com/1753199/39321048-d8e33e06-4953-11e8-9845-4fb38964886b.png)
2018-04-27 09:56:10 -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
8336003a11
[Chips] color themer implementation. (#3372)
* Chips: Color Themer is added. Podspec and Build file updated.
Proper Color Mapping, testing and example update is left to do.

* Adding a helper to merge two colors with different opacities.

* define nonnull for interface.

* [Chips] Color Themer Implementation.
Color themer fully implemented.
Tests are added.
Examples are added.

* tests for color merge functionality.

* Name change "merge" -> "blend"
full support for blending with any opacity.
More tests added.
Better Documentation.

* updating API name.

* ColorBlend:
Change the type to CGFloat from Double,
Updated Documentation and tests.

* All different type of chips have the same mapping for color themer. So the break down between different types is not needed. Just stroked and regular type.

* separate the method implementation out since now there are only two varients.
2018-04-17 09:57:51 -04:00
Sam Morrison
5384f00f9a
[Chips] Chip field (#2600)
* [Chips] Chip field

* Clean up example

* Nits

* [self invalidateIntrinsicContentSize];

* Reorder addChip behavior

* Use correct version check

* NSCoding

* Fix example

* 32dp

* Remove k prefix

* Constrain width of chips
2017-12-08 12:20:30 -05:00