21 Commits

Author SHA1 Message Date
Jeff Verkoeyen
63988b35da Optimizing imports
PiperOrigin-RevId: 356966165
2021-02-11 07:09:58 -08: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
Andrew Overton
4c75e862d4
[TextFields] Don't use MDCTextFieldTypographyThemer (#9170)
Related to #9168
2019-12-09 10:13:34 -05:00
Robert Moore
62cca706ae
[TextFields] Fix Contained example error states. (#7252)
Fixing the error logic of the Contained Text Fields example. This makes it
easier to debug issues around the error state and UIAccessibility.  Specifically, this clears the error state for some of the text fields that would "hang around" in the following conditions:

1.  The user places the Text Field in an "error state" by entering invalid text.
2.  The user changes the focus from the error-state Text Field to another
3.  The user then either:
    1.  Returns focus to that error-state Text Field and corrects the error and uses the "Return" button to resign first responder on the text field
     2. Presses the Text Field's clear button to remove the offending content.

In both cases, the error state incorrectly "stuck around" even though the content did not warrant that state.

| |Precondition|Result|
|---|---|---|
|Before|![outlined-error-content-before](https://user-images.githubusercontent.com/1753199/56605451-31875100-65d2-11e9-87ef-f0d069fa8114.png)|![outlined-error-cleared-before](https://user-images.githubusercontent.com/1753199/56604064-20891080-65cf-11e9-9348-fbfc9201b765.png)
|After|![outlined-error-content-before](https://user-images.githubusercontent.com/1753199/56605451-31875100-65d2-11e9-87ef-f0d069fa8114.png)|![outlined-error-cleared-after](https://user-images.githubusercontent.com/1753199/56604071-241c9780-65cf-11e9-997e-24bcfa35b13e.png)|

Prework for #7157
2019-04-23 14:15:59 -04:00
Robert Moore
0c317f190d
[TextFields] Fix examples layout (#7250)
Fixing the examples layout so the content doesn't overlap the App Bar.

|Before|After|
|---|---|
|![legacy-multi-before](https://user-images.githubusercontent.com/1753199/56600236-3ba35280-65c6-11e9-9276-52acb5cde63b.png)|![legacy-multi-after](https://user-images.githubusercontent.com/1753199/56600242-3f36d980-65c6-11e9-8faf-bc5255bf3bdb.png)|
|![outlined-before](https://user-images.githubusercontent.com/1753199/56600248-42ca6080-65c6-11e9-911f-2cd9828dfb62.png)|![outlined-after](https://user-images.githubusercontent.com/1753199/56600262-49f16e80-65c6-11e9-9775-95d452fec723.png)|
|![controller-styles-before](https://user-images.githubusercontent.com/1753199/56600269-4e1d8c00-65c6-11e9-9359-8e98f0e1cbc1.png)|![controller-styles-after](https://user-images.githubusercontent.com/1753199/56600290-57a6f400-65c6-11e9-9d8f-8f9ac2c243be.png)|

Preparation for #7157
2019-04-23 14:05:34 -04: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
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
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
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
Robert Moore
8835a412a2
[TextFields] Support clear button tint color (#4449)
Adding support to change the clearButton's tintColor from the TextInputController. This allows more consistent theming across controllers.

Closes #4447 

## Filled

**Before**
![screen shot 2018-06-29 at 12 23 12 pm](https://user-images.githubusercontent.com/1753199/42103490-427a1e96-7b97-11e8-9410-9d20f5ff6d32.png)


**After**
![screen shot 2018-06-29 at 12 21 51 pm](https://user-images.githubusercontent.com/1753199/42103502-4b1d8c22-7b97-11e8-85be-3997d0e3dee4.png)


## Outlined

**Before**
![screen shot 2018-06-29 at 12 23 01 pm](https://user-images.githubusercontent.com/1753199/42103497-45b2fca4-7b97-11e8-82df-3a01bc3e8240.png)

**After**
![screen shot 2018-06-29 at 12 21 36 pm](https://user-images.githubusercontent.com/1753199/42103498-48b22010-7b97-11e8-8c8e-004cb35d3b6a.png)
2018-06-29 15:44:09 -04:00
Will Larche
1f10ae3e3e
[TextFields] Making leading and trailing view layout customizeable (#4434)
Closes the layout part of b/74174981

***Breaks screenshot tests.

Before:
![simulator screen shot - iphone x - 2018-06-24 at 17 39 27](https://user-images.githubusercontent.com/1271525/41823956-2742affe-77d6-11e8-9082-2ccb10071750.png)

After:
![simulator screen shot - iphone x - 2018-06-24 at 17 35 45](https://user-images.githubusercontent.com/1271525/41823875-13f44152-77d5-11e8-8ae8-f23840efe6e1.png)

Also corrects the x of the floating placeholder on a filled text field.
![simulator screen shot - iphone x - 2018-06-24 at 17 45 43](https://user-images.githubusercontent.com/1271525/41823974-7e8c5346-77d6-11e8-88ce-38f4adb32323.png)
2018-06-25 07:59:33 -07:00
Will Larche
bc119b3b73 [TextFields] Example cleanup. (#4392)
* [TextFields] Example cleanup.

* [TextFields] Copy correction

* [TextFields] Example file rename.
2018-06-12 17:41:02 -04:00
Will Larche
d13077450f
[TextFields] Correcting copy mistake. (#4281) 2018-05-25 16:41:24 -04:00
Will Larche
6f740c8c62
[TextFields] Fix text area placeholder (#4274)
* [TextFields] Correcting misaligned text area floating placeholder.

* [TextField] Adding text area set text examples.
2018-05-25 09:38:47 -04:00
featherless
e923d2d928
[Catalog] Make many examples be dragons. (#3642)
Pivotal story: https://www.pivotaltracker.com/story/show/156939988
Pivotal story: https://www.pivotaltracker.com/story/show/156804299
Pivotal story: https://www.pivotaltracker.com/story/show/156939962
Pivotal story: https://www.pivotaltracker.com/story/show/156982119
Closes: https://github.com/material-components/material-components-ios/issues/3183
2018-05-02 08:31:55 -04:00
featherless
23110ef116
[Catalog] Make all swift copycat demos be dragons. (#3443)
Also removed "(Swift)" from any examples that remained as non-dragons. The catalog does not need to advertise which language a given demo is in.

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

## Screenshots

Before:
![simulator screen shot - iphone se - 2018-04-23 at 14 04 14](https://user-images.githubusercontent.com/45670/39144588-36095450-46ff-11e8-868d-bdb7e8ee5438.png)

After:
![simulator screen shot - iphone se - 2018-04-23 at 13 53 39](https://user-images.githubusercontent.com/45670/39144567-2ad7bf9a-46ff-11e8-9fd5-ef0739d427b3.png)
2018-04-24 15:52:13 -04:00
Yarden Eitan
29d760c7d6
Added isPresentable to catalog files, ported over ZShadow to dragons. (#2726) 2017-12-15 12:20:35 -05:00
Will Larche
5dae93c6c4 [TextFields] Adding .placeholderText to controllers (#2149)
* [TextFields] Adding .placeholderText to fix bugs and continue moving API to controller.

* [TextFields] PR feedback.

* [TextFields] Removes ambiguous layout.

* [TextFields] Better code organization and comment.
2017-10-12 09:16:07 -04:00
Will Larche
90e79dd815 [TextFields] iOS 11 example bugs fixed (#2071)
* [TextFields] Example fix for iOS 11.

* [TextFields] iOS 11 bugs fixed.

* [TextFields] Formatting

* [TextFields] Xcode 8 support

* [TextFields] Example layout correction.

* [TextFields] Xcode and iOS safety code.

* [TextFields] typo corrections.

* [TextFields] Code for Xcode conditional.

* [TextFields] Xcode 8 support.

* [TextFields] Pleasing the static analyzer.

* [TextFields] Formatting improvement.

* [TextFields] Swift compiler conditional change and some formatting.

* [TextFields] Swift example notification changes.

* [TextFields] Safer notifcations code in Objc.

* [TextFields] Formatting
2017-10-02 20:30:17 -04:00
Will Larche
cde864f235 [TextFields] Renaming classes to match the MD spec (#2061)
* [TextFields] Renaming classes to match the spec.

* [TextFields] Renaming examples.
2017-09-27 22:10:47 -04:00