241 Commits

Author SHA1 Message Date
Robert Moore
675235ed05
{Tests} Deallocate test objects at the end of tests. (#5397)
Deallocating many of the properties created for each unit test. Since all
XCTestCase instances survive until the end of the test suite, any properties
created for a test will be preserved as well. This frees up around 3.7 MB
(~6%) of memory from the entire test suite, as measured on my desktop.

|Before|After|
|----|----|
|![test-objcs-before](https://user-images.githubusercontent.com/1753199/46813473-c3b9bd00-cd44-11e8-990c-28dff4ab5ad2.png)|![test-objcs-after](https://user-images.githubusercontent.com/1753199/46813481-c7e5da80-cd44-11e8-90e4-2e6d532ebbfb.png)|

See also: https://qualitycoding.org/xctestcase-teardown/

Closes #5395
2018-10-12 08:33:58 -04:00
Yilei (Dolee) Yang
cfaf6d7a2d TextFields: Fix the error accessibility label, the value was not respected previously. (#5300)
The value was not respected previously.
2018-10-03 12:32:27 -04:00
Andrew Overton
7672bcf7a6
[TextFields] Override System Initiated VoiceOver Message When Leaving Error State (#5251)
Closes #5250.

The crux of the bug is that when you pass nil to `-setErrorText:errorAccessibilityLabel:` the VoiceOver message that immediately follows (which is not triggered explicitly by us) still mentions the previous error state. By forcing an announcement in this situation we override the problematic system-initiated VoiceOver message. We basically do the same thing when _entering_ the error state on line 1583. This is the same idea.
2018-09-28 12:36:54 -04:00
Randall Li
038cd55178 Revert "[TextFields] Fix outline text field clear button layout in RTL (#5129)"
This reverts commit 1fb09d4899ae65c6a5a4724f870f8a77d1e2fea4.
2018-09-26 16:12:57 -04:00
Andrew Overton
1fb09d4899
[TextFields] Fix outline text field clear button layout in RTL (#5129)
* Fix outline text field clear button layout in RTL

* Clang format changes

* Fix interface layout direction checks that are failing in CI

* Address nit
2018-09-25 16:39:55 -04:00
Cody Weaver
ebd7921263
Remove extension check (#5182)
Previously we checked against `iOSApplicationExtension` and `iOS` but if the `iOS` version is 9.0 or above then the ApplicationExtension will be as well. This will remove a lot of warnings in our kokoro logs when trying to track down errors.

| Before | After |
| ------ | ------ |
|![simulator screen shot - iphone xs max - 2018-09-20 at 08 30 07](https://user-images.githubusercontent.com/7131294/45818633-4a342f00-bcb0-11e8-8e36-2c8079581c30.png)|![simulator screen shot - iphone xs max - 2018-09-20 at 08 29 32](https://user-images.githubusercontent.com/7131294/45818638-4e604c80-bcb0-11e8-91ea-664443d4be0a.png)|
|![simulator screen shot - iphone xs max - 2018-09-20 at 08 29 32](https://user-images.githubusercontent.com/7131294/45818703-81a2db80-bcb0-11e8-9e64-f67e6d72d063.png)|![simulator screen shot - iphone xs max - 2018-09-20 at 08 30 07](https://user-images.githubusercontent.com/7131294/45818712-8798bc80-bcb0-11e8-85ea-223859066421.png)|
2018-09-20 10:00:03 -04:00
Andrew Overton
fec74d5e0d
Send .editingChanged control event on clear button touch (#5144) 2018-09-18 16:34:36 -04:00
Andrew Overton
e2cad8f8dc Get rid of "," separator in MDCTextField accessibilityValue (#5098) 2018-09-11 14:22:05 -07:00
featherless
d5c064fdff
[automated] Fix more copyright stanzas. (#4990)
Our creativity knows no bounds.

### Find

```
/\*
 *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 ([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 ([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 ([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\.
 \*/
```

### Replace

```
// 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 16:09:12 -04:00
Andrew Overton
adc0a4c3c6
Specify textRect origin according to UIUserInterfaceLayoutDirection (#4974)
Closes #4959 

Before:
<img width="382" alt="screen shot 2018-08-30 at 4 45 34 pm" src="https://user-images.githubusercontent.com/8020010/44878173-2878f680-ac74-11e8-93cb-9f129c9b418f.png">

After:
<img width="378" alt="screen shot 2018-08-30 at 4 45 42 pm" src="https://user-images.githubusercontent.com/8020010/44878171-2878f680-ac74-11e8-93f3-5524d23dbe2d.png">
2018-08-31 15:36: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
Jeff Verkoeyen
9854044c96 Revert "[automated] Standardize our open source license stanza to what Xcode generates. (#4982)"
This reverts commit b45bc2fdd4dfe12fc76751a45c9cf7b0d6c1261f.
2018-08-31 12:01:24 -04:00
featherless
b45bc2fdd4
[automated] Standardize our open source license stanza to what Xcode generates. (#4982)
Removes the need to copy-paste stanzas from other files anymore as we'll rely on https://github.com/material-components/material-components-ios/pull/4478 to generate the correct stanza for us instead.

This was an automated change generated by running a find-and-replace regular expression:

### Find

```
/\*
 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\.
 \*/
```

### Replace

```
// 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 11:49:00 -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
Andrew Overton
281392db6b
Do not set placeholderLabel.textColor to active color while editing with non-floating placeholder (#4850)
Closes #4844.

Previously, non-floating placeholder text color changed to `activeColor` while editing. An internal client sensed something incorrect about this, and Phil confirmed that it should stay set the value of `inlinePlaceholderColor`.

Before:
![simulator screen shot - iphone x - 2018-08-20 at 15 56 25](https://user-images.githubusercontent.com/8020010/44364338-b2ff7000-a494-11e8-95ec-a638ae7e9669.png)

After:
![simulator screen shot - iphone x - 2018-08-20 at 15 56 00](https://user-images.githubusercontent.com/8020010/44364339-b2ff7000-a494-11e8-82cf-7f580ae972a8.png)
2018-08-22 15:41:17 -04:00
Andrew Overton
13bff72b26
Trigger layout pass to update borderView.borderLayer (#4815)
Closes #4522.

According to the Material spec, the outlines on outlined textfields should be a little thicker when the textfield is in an editing state. Somewhere down the line that behavior was broken. This change fixes it. 

Before:
![simulator screen shot - iphone x - 2018-08-16 at 14 36 23](https://user-images.githubusercontent.com/8020010/44227892-cabbb900-a161-11e8-9d11-ccc348fb23e4.png)
After:
![simulator screen shot - iphone x - 2018-08-16 at 14 34 58](https://user-images.githubusercontent.com/8020010/44227831-a2cc5580-a161-11e8-9815-350d395ca530.png)
2018-08-17 14:01:55 -04:00
Andrew Overton
efc3a86c5e
[TextFields] Update placeholder and outline border color when enabling/disabling text fields with outline controllers (#4779)
* Update placeholder and outline border color when setting enabled property on a TextField with an outline controller.

* Observe NSNotification instead of key-value pairs

* Fix typos

* Get rid of underline.color == controller.normalColor check in testThemerWithBaselineColorSchemeAppliesToSingleLineTextField because the underline should never be visible in outline controllers
2018-08-16 09:51:54 -04:00
Robert Moore
175942d9e0
[Catalog] Fix Swift example imports (#4780)
Many of our Swift examples are either missing imports or are importing all of
MaterialComponents. Both of these will cause failures during internal builds.
2018-08-14 13:26:37 -04:00
featherless
e14b90e829
[schemes/Color] Formally mark all to-be-deprecated APIs as "ToBeDeprecated". (#4738)
This change further formalizes our pattern of annotating APIs that will be or are deprecated using class categories. Moving an API into such a category has the benefit of being picked up by the API diff toolchain and elevated into our release notes as a result.
2018-08-09 16:39:56 -04:00
Andrew Overton
5f66ae9263
Consider UIUserInterfaceLayoutDirection when drawing outlined text controller outline path (#4719) 2018-08-07 10:22:55 -07:00
Andrew Overton
6acde0b275
[TextFields] Add setHelperText:helperAccessibilityLabel (#4661)
* Add setHelperText:helperAccessibilityLabel

* Add nullability annotations

* Do not copy helperText param in -setHelperText:

* Update filled text field example
2018-08-02 09:42:36 -04:00
featherless
c4935b333d
[TextFields]! Remove encoding/decoding behavior for custom properties (#4567)
Closes https://github.com/material-components/material-components-ios/issues/3948
2018-07-18 15:55:18 -04:00
Andrew Overton
4745d80b40
[TextFields] Add accessibility docs for MDCTextField (#4498)
* Add accessibility docs for MDCTextField

* Try to fix readme situation
2018-07-12 15:53:36 -04:00
Robert Moore
789f659f15
[TextFields] Fix clear button render scale (#4539)
The clear button rendering code accidentally used the screen scale when
calculating a graphics context size. Instead, it should simply set the scale
of the graphics context and request the size in points.

**Original (iPad Mini 4)**
![mdc-underline-original](https://user-images.githubusercontent.com/1753199/42652448-70c88960-85e0-11e8-8bb0-20dfc1503596.png)

**Fixed (iPad Mini 4)**
![mdc-underline-scalefix](https://user-images.githubusercontent.com/1753199/42652465-7f51e102-85e0-11e8-9017-35e7de9e4f1f.png)

Closes #4538
2018-07-12 15:29:55 -04:00
Michelle Dudley
528f46323f [TextFields] Migrate textInputClearButtonTintColor to MDCTextInputController, tests (#4465)
Adding support for theming the clear button tint color in MDCTextInputController. Allows for theming the clear button tint color in legacy, full-width, and underline text fields.

Closes #4453.
2018-07-06 12:09:49 -04:00
Andrew Overton
c0124aa9fe
Make MDCTextField accessibilityValue include only placeholder or [super accessibilityValue], not both (#4460) 2018-07-02 11:31:51 -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
Robert Moore
55eead6f16
[TextFields] {BreakingChange} Remove unused backgroundColor property (#4452)
Only MDCTextInputControllerFullWidth is using `backgroundColor` in any
meaningful way. For MDCTextInputControllerBase, the property wasn't used
anywhere in the input controller.

Reduces the scope of #3357
2018-06-29 14:56:45 -04:00
Robert Moore
2abcf53b9d
[TextFields] Fix clearIcon drawing (#4450)
The clear button's procedurally-drawn icon was using the button's `tintColor`,
which may be translucent. Instead, the icon should be drawn with an opaque
color so clients can assign any desired color from opaque to clear.

## Filled

**Before**
![filled-before](https://user-images.githubusercontent.com/1753199/42093536-b6cf4748-7b7a-11e8-9928-958db68a36ab.png)

**After**
![filled-after](https://user-images.githubusercontent.com/1753199/42093541-babb593c-7b7a-11e8-8bf8-621dcc1c03bd.png)


## Outlined

**Before**
![outlined-before](https://user-images.githubusercontent.com/1753199/42093551-c0ec129c-7b7a-11e8-8091-41f1559d4789.png)

**After**
![outlined-after](https://user-images.githubusercontent.com/1753199/42093555-c4c916b2-7b7a-11e8-80b3-019c217de182.png)
2018-06-29 12:19:19 -04:00
Will Larche
53876c3dca
[Typography] 3rd PR on font equality (#4435)
* [TextFields] Adding todos for #4331

* [TextFields] Creating simple equality files.

* [TextFields] Prevents fonts that are almost the same but not quite from messing up the rendering.

* [Typography] Adding tests for font equality.

* [TextFields] Formatting.

* [Typography] Adding Math to the bazel file.

* [Typography] PR feedback.

* [Typography] PR feedback.

* [Typography] Comment.

* [Typography] PR feedback.

* [Typography] PR feedback.

* [Typography] Updating podspec.

* [Typography] Asserts for bazel.

* [Typography] Logging for tests.

* [Typography] Loggin.g

* [Typography] Removing logging and the deeper check.

* [Typography] Making simple equality a category.

* [TextFields] Using new method.
2018-06-26 11:45:13 -07: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
Ian Gordon
6012227068 Linter requires a prefix 2018-06-18 12:21:14 -04: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
0516f703c8 [TextFields] TableView example. (#4391)
* [TextFields] TableView example.

* [TextFields] Testing feedback.

* [TextFields] Example correction.
2018-06-12 17:40:26 -04:00
Will Larche
89c2a40911
[TextFields] Add baseline constraint support (#4387)
Closes b/72401468
2018-06-11 15:18:37 -04:00
Will Larche
fc61f06451
[TextFields] Text Input adjustment. (#4389)
* [TextFields] Text Input adjustment.

* [TextFields] Turning a number into a const.
2018-06-10 20:31:57 -04:00
Yarden Eitan
45c6fba187 Revert "[TextFields] Prevents functionally equivalent fonts from causing rendering jumps (#4344)"
This reverts commit de44925eb609f1a06c6529fbd06ba7d5f80dcfa9.
2018-06-07 11:17:31 -04:00
Andrew Overton
0b5706dadd
Tweak accessibility notification to prevent VoiceOver from cutting off (#4364) 2018-06-05 17:37:29 -04:00
Will Larche
de44925eb6
[TextFields] Prevents functionally equivalent fonts from causing rendering jumps (#4344)
* [TextFields] Adding todos for #4331

* [TextFields] Creating simple equality files.

* [TextFields] Prevents fonts that are almost the same but not quite from messing up the rendering.

* [Typography] Adding tests for font equality.

* [TextFields] Formatting.

* [Typography] Adding Math to the bazel file.

* [Typography] PR feedback.

* [Typography] PR feedback.

* [Typography] Comment.

* [Typography] PR feedback.

* [Typography] PR feedback.

* [Typography] Updating podspec.

* [Typography] Asserts for bazel.

* [Typography] Logging for tests.

* [Typography] Loggin.g

* [Typography] Removing logging and the deeper check.
2018-06-05 15:32:58 -04:00
ianegordon
fec408500a
[Documentation] Update TextField README.md (#4352)
Closes #3334
2018-06-04 22:25:04 -04:00
Andrew Overton
9bbaaaad6e
[TextFields] Add placeholderLabel accessibilityLabel to textField accessibilityValue (#4319)
It's a `Chips` issue, but since `MDCChipField` uses an `MDCTextField` I think adding the functionality described in the issue to the textfield will address it.

Will resolve https://github.com/material-components/material-components-ios/issues/4315
2018-06-01 10:45:34 -04:00
Yarden Eitan
7af29ce778 Revert "[TextFields] Floating placeholder font changes after users starts typing. (#4213)"
This reverts commit 3ac33a79e2f6fb744248fee8454cd0379bb7c3b9.
2018-05-30 12:29:32 -04:00
Robert Moore
a37b289153 [TextFields] Post SetText notifications for attributed text (#4282)
TextFields were not always correctly posting notifications when attributed
text was set programmatically. This can cause the placeholder to remain in its
"empty" position and overlap the text.

Also added some examples to demonstrate the behavior and fixed a typo.
2018-05-29 18:25:02 -04:00
Mohammad Cazi
3ac33a79e2
[TextFields] Floating placeholder font changes after users starts typing. (#4213)
* Fixing the order of operations. Setting TextInput Font causes placeholder font to be updated so we update placeholderFont after to font we desire.

* added comment, explaining the code and added a unit test to verify the behavior.

* missing comment

https://github.com/material-components/material-components-ios/pull/4213
2018-05-29 14:01:08 -04:00
Will Larche
776a40e409
[TextFields] Corrects obscure bug of height. (#4297) 2018-05-29 10:34:09 -04:00
Will Larche
520ac156a3
[TextFields] Documentation update (#4295)
* [TextFields] Documentation update.

* [TextFields] Punctuation.
2018-05-29 10:29:56 -04:00
Will Larche
d13077450f
[TextFields] Correcting copy mistake. (#4281) 2018-05-25 16:41:24 -04:00
featherless
e1e6d249a4
[Docs] Add badges to all components. (#4278)
As part of our readme generator, components can now opt in to displaying badges in their readme.

The badges are generated from https://shields.io/ and are focused on an individual component. We're currently generating the following badges:

- Open bug count.
2018-05-25 11:12:48 -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