79 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
ianegordon
8c7f8faa51 Stop the text example from loading on startup (#3567)
https://github.com/material-components/material-components-ios/pull/3567#pullrequestreview-116078800
2018-04-27 16:48:13 -04:00
ianegordon
4a258d2a47
[TextFields] Themer Example (#3521)
* [TextFields] Themer Example

* FB
2018-04-27 16:19:07 -04:00
Mohammad Cazi
5ee14ab92e
[Catalog] Component descriptions update. (#3490)
* Button Description updated.

* Updating the description of Catalog Components.

* Missing space.

* fixing couple of small issues with catalog descriptions.

https://github.com/material-components/material-components-ios/pull/3490
2018-04-25 16:06:18 -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
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
8717640dbd [Textfields] Added Filled and Outlined themers (#3438)
[Textfields] Added Filled and Outlined themers (#3438)
2018-04-20 18:13:32 -04:00
Will Larche
b49156ad4d
[TextFields] Adding a floating placeholder active color override. (#3433) 2018-04-20 15:56:41 -04:00
Mohammad Cazi
0efdeb2a3f
[TextFields] Typography Themer implementation. (#3303)
* TextFields Typography Themer added.
Tests and example included.

* Removing extra checks, comment the reason behind checking pointsize

* fixing typo.
2018-04-10 15:41:32 -04:00
Mohammad Cazi
a15a0a7e3a
[TextFields] expose input text font property on controller. (#3272)
* adding the property to customize textInput Font.

* updating the example.

* Additional Documentation.
2018-04-09 16:11:31 -04:00
Mohammad Cazi
75c81a1659
[TextFields] Adding Color Themer. (#3255)
* Adding Color Themer for Textfields.

* We have to keep the old API around, and deprecated after releasing the new version.

* fixing indentions.

* Importing the needed headers instead of forward declaration, documenting the deprecation and suggested methods to use.

* Filled text field example is updated to style the textfield with the semantic color scheme.
TextFieldColorThemer should be able to theme any MDCTextInput.

* fixed couple of method name change updates.

* Adding Color Themer for Textfields.

* We have to keep the old API around, and deprecated after releasing the new version.

* fixing indentions.

* Importing the needed headers instead of forward declaration, documenting the deprecation and suggested methods to use.

* Filled text field example is updated to style the textfield with the semantic color scheme.
TextFieldColorThemer should be able to theme any MDCTextInput.

* fixed couple of method name change updates.

* Revert "fixed couple of method name change updates."

This reverts commit 9e0ef0f2eb08026e05b1f182aab6b4dc84fa766b.

* Revert "Revert "fixed couple of method name change updates.""

This reverts commit bda6b13ff979811bd1eccc6ef365dd273fed007b.

* fixing breaking tests.
2018-04-06 12:06:12 -04:00
Mohammad Cazi
8d4d5ea1fc [TextFields] Reverting textInputFont property on inputController. #3232
Adding textInputFont and TextInputFontDefault properties to inputController was breaking many client who used to set the font straight to textInput font property.

The reason behind adding this property was to fully support dynamic types.
Reverting this change will break dynamic types support for textfields.
Pivotal issue to address the work needed to add this property: #156518577
2018-04-04 15:52:14 -04:00
Mohammad Cazi
91a376ffe1 [TextFields] Adding font themer (#3096)
* Extracting Accessibility out of FeatureHighlightViewController to a mutator.
Tests added.
Example updated.

* Revert "Extracting Accessibility out of FeatureHighlightViewController to a mutator."

This reverts commit 0b5433ebf86366087b240c4dc4992a0603fa73e0.

* Adding Font themer to TextFields.

* extra lf.

* dealing with warnings.

* Fixing unit tests.

* commenting out low priority set up for bounds

* commenting out tests to see if tests would fail.

* tests are back, scale could have been zero.

* temp fix in case the fonts are zero.

* check for default inside setter.

* fix compliing mistakes.

* add documentation for the change.

* Example of dynamic size with different fonts.

* added support for dynamic type with custom fonts.

* fixed the top overlapping issue

* Replied to comment and fixed the issues.

* Adding Text Input property to InputController
Changing the value of mdc_adjustsFontForContentSizeCategory should not effect the actual controller fonts that are set by user but only the properties of the actual textfield. In order to do that I moved the resizing of fonts away from the properties of InputController and into update layout.

* Fixing the comment. Changing font scheme to not accept nullable controllers.

* change documentation.
2018-03-23 15:03:13 -04:00
Yarden Eitan
c88a059640
[Catalog] Remove unwanted warnings from build (#2794)
* fix warnings for .count in Swift strings and duplicate images in Asset folders, also give the Extension target all icons

* update project settings to recommended ones
2018-01-05 16:58:33 -05: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
09b3c9583d
[TextFields] Formatting. (#2725) 2017-12-14 11:25:09 -08:00
Will Larche
290f13f7be [TextFields] States example (#2718)
* [TextFields] Just needs layout code.

* [TextFields] Seems to be working good.
2017-12-14 08:48:15 -05:00
Will Larche
62d5a4fa85 [TextFields] Feature branch merge: Clarity, Safety, Docs, Comments, Formatting (#2634)
* [TextFields] Full width changes. (#2590)

* [TextFields] Propagating changes to themers. (#2585)

* [TextFields] Propagating changes to themers.

* [TextFields] Updates to themer examples.

* [TextFields] Base controller class files (#2582)

* [TextFields] New Base class files.

* [TextFields] Naming corrections.

* [TextFields] Formatting.

* [TextFields] Replacing -Default with -Underline (#2583)

* [TextFields] Adding underline controller.

* [TextFields] Changes to umbrella import file and removing default controllers.

* [TextFields] Renaming one file.

* [TextFields] Updated controller headers. (#2584)

* [TextFields] Updating examples. (#2586)

* [TextFields] Running clang-format on the elements. (#2587)

* [TextFields] Running format on the element itself.

* [TextFields] Minor formatting.

* [TextFields] Updating tests and formatting. (#2588)

* [TextFields] Filled controller changes. (#2589)

* [TextFields] Legacy controller comments, naming, and formatting. (#2591)

* [TextFields] Legacy controller comments, naming, and formatting.

* [TextFields] Adding safety to legacy default init.

* [TextFields] Adding safety to Legacy Default init.

* [TextFields] Formatting Legacy Default.

* [TextFields] Formatting Legacy Full Width.

* [TextFields] Text area comments, updated super, naming, formatting. (#2593)

* [TextFields] Text area updates.

* [TextFields] Clarifying comment.

* [TextFields] Outline changes and formatting. (#2592)

* [TextFields] Updates to styling doc. (#2594)

* [TextFields] Updates to styling doc.

* [TextFields] Updating doc.

* [TextFields] Full width comments, safety, formatting, and underline support. (#2633)

* [TextFields] Adding safety to full width.

* [TextFields] Formatting Full Width.

* [TextFields] PR feedback.

* [TextFields] Safety in init of Base (#2632)

* [TextFields] Adding safety to base init.

* [TextFields] Formatting Base.

* [TextFields] Updates to controller header. (#2636)

* [TextFields] Updates to controller header.

* [TextFields] Updating misleading comments.

* [TextFields] Supplemental file name changes. (#2635)
2017-12-12 11:07:48 -05:00
Randall Li
63abcadd7c
[TextFields] Corrected imports in examples. (#2655)
PiperOrigin-RevId: 178286593
2017-12-11 13:40:38 -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
Yarden Eitan
f9e187feb4 [Cleanup] remove checks for iOS8 and above as we now only support iOS8+ (#2555) 2017-12-02 22:08:00 -05:00
Will Larche
0496c22549
[TextFields] Correcting class of the textview to match the new class required for MDCMultilineTextField. (#2519) 2017-11-27 14:49:28 -05:00
Will Larche
35727c1249 [TextFields] Fixes bug: multiline having ambiguous height in the text view (#2489)
* [TextFields] Fixes bug in multiline having ambiguous height in the text view.

* [TextFields] Making the comments clearer.

* [TextFields] PR feedback.

* [TextFields] PR feedback.

* [TextField] Uhoh.

* [TextFields] Going back and making the new class mandatory.

* [TextFields] PR feedback.
2017-11-27 11:54:58 -05:00
Will Larche
47ed556783 [TextFields] Adding legacy storyboard. (#2517) 2017-11-27 09:22:18 -05:00
Yurii Samsoniuk
2a96682230 Replace unnecessary imports with forward declarations (#2429)
* [Themes] Remove unnecessary imports.

* [TextFields] Remove unnecessary imports.

* [Typography] Do not use an umbrella header inside of a component.

* [Snackbar] Do not use self umbrella header.

* [ActivityIndicator] Do not use self umbrella header.

* [AppBar] Use umbrella headers.

* [AppBar] Remove self import header.

* [ButtonBar] Removed self umbrella header imports.

* [Buttons] Removed self umbrella header imports.

* [Collections] Update imports.

* [Dialogs] Moved import into an m file.

* [Collections] Fixed imports.

* [FeatureHighlight] Removed self umbrealla imports.

* [HeaderStackView] Reordered imports.

* [Ink] Replaced imports with forward declarations.

* [Slider] Replaced self umbrella import use.

* [Snackbar] Removed self umbrella header import.

* [Tabs] Changed math import. Replaced self umbrella header import.

* [Icons] Removed unnecessary imports.

* [Overlay] Replaced umbrella header import.

* [ShapeLibrary] Replace Shapes imports with an umbrella header.

* [Shapes] Replaced imports with forward declarations.

* [AppBar] Replace import with a forward declaration.

* [Examples] Updated imports.

* Fixed conflicting imports

* Added space between different import categories
2017-11-16 18:25:06 -05:00
Will Larche
e13fa143a5
[TextFields] Fix multiline placeholder position and transform bug. PR #2 (#2360)
* [TextFields] Adding a multiline message to the example.

* [TextFields] Moving a method to a better place.

* [TextFields] Fixes multiline having set text.

* [TextFields] Adding new line to multi-line examples.

* [TextFields] Floating placeholder comments, organization and bug fix.

* [TextFields] Formatting.

* [TextFields] Adding back in the work I had lost.

* [TextFields] Adding some Xcode 8 support.
2017-11-07 11:52:58 -05:00
Will Larche
282754e7a9
[TextFields] Fixes bugs on multiline IB support (#2289)
* [TextFields] Improved interface builder support.

* [TextFields] Adding multiline to interface builder example.

* [TextFields] Adding comment.

* [TextFields] Updating IB example.

* [TextFields] Updating storyboard for example.

* [TextFields] Adding handling of expanding on overflow for IB cases.

* [TextFields] Adding better expanding support for IB.

* [TextFields] Fixing bugs related to loading a multiline text field from a storyboard.

* [TextFields] Reorganizing IB examples to add new one.

* [TextFields] Adding useful comment.
2017-11-01 09:53:21 -04:00
Martin Petrov
f98a9d42ed @objc annoaing catalog by convention (#2305) 2017-10-30 10:24:17 -04:00
Will Larche
463a2831a0 [TextFields] Adds cursor color as parameter (#2297)
* [TextFields] Adding cursorColor to example.

* [TextFields] Adding cursor color to tests.

* [TextFields] Completing implementation of cursor color.
2017-10-27 08:17:30 -04:00
Will Larche
035b9b4cae [TextFields] Updating kitchen sink example to use trailing and leading views. (#2266) 2017-10-24 22:59:55 -04:00
Will Larche
07eea020ca [TextFields] Implementing textFieldShouldClear: (#2169)
`MDCTextField` should invoke `textFieldShouldClear` on its delegate before clearing the text. A similar delegate, `MDCMultilineTextInputDelegate` is now also supported on `MDCMultilineTextField` objects to support similar functionality.

Closes #2062
2017-10-13 06:56:32 -04:00
Will Larche
75cf565fea [TextFields] Fix text fields overlapping labels (#2163)
* [TextFields] Removes ambiguous layout.

* [TextFields] Better code organization and comment.

* [TextFields] Adding a filled in field to the examples.

* [TextFields] Correcting placeholder not rising when text is set programatically. Also better naming.

* [TextFields] Giving examples of each floating style a set .text.

* [TextFields] Adding placeholder float test.
2017-10-12 23:25:50 -04: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
b438856be2 [TextFields] Examples bug and formatting (#2137)
* [TextFields] Formatting correction.

* [TextFields] Example bug.
2017-10-09 21:54:41 -04:00
Will Larche
96fb533554 [Catalog] Fixes improper use of Bundle and assets (#2118)
* [Catalog] Fixing bundle usage in some examples.

* [Examples] Correcting use of assets and bundles.

* [Examples] Formatting.
2017-10-08 15:04:48 -04:00