29 Commits

Author SHA1 Message Date
Janette James
b5bbb66b58 Delete UnderlinedTextFieldsTheming
PiperOrigin-RevId: 715118099
2025-01-13 14:58:30 -08:00
Janette James
43f701bd61 Delete FilledTextAreasTheming
PiperOrigin-RevId: 715100357
2025-01-13 14:04:54 -08:00
Wenyu Zhang
b457b13005 Internal change.
PiperOrigin-RevId: 417635153
2021-12-21 09:32:05 -08:00
Jeff Verkoeyen
08051b7bda Remove all pre-iOS 12 logic.
PiperOrigin-RevId: 400798440
2021-10-04 13:20:55 -07:00
Randall Li
502bc5d910 Ran a Swift formatter
PiperOrigin-RevId: 395947664
2021-09-10 09:48:14 -07:00
Jeff Verkoeyen
b64b0ec231 Internal change
PiperOrigin-RevId: 360230236
2021-03-01 11:04:51 -08:00
Jeff Verkoeyen
25c9049d5a Optimizing imports
PiperOrigin-RevId: 356791916
2021-02-10 12:00:57 -08:00
Andrew Overton
a349540e26 [TextControls] Add text areas leading/trailing views
PiperOrigin-RevId: 344113091
2020-11-24 12:45:27 -08:00
Andrew Overton
b8d8690259 [TextControls] consider floating label min Y in - accessibilityPath
PiperOrigin-RevId: 337120665
2020-10-14 10:38:49 -07:00
Andrew Overton
9b6db6fb44 [TextControls] Add typical use example
PiperOrigin-RevId: 323996387
2020-07-30 07:17:01 -07:00
Andrew Overton
93fb883645 [TextControls] Add debug stuff to text controls examples
PiperOrigin-RevId: 322601224
2020-07-22 10:28:08 -07:00
Andrew Overton
9480bf4c88 [TextControls] Make text fields without floating labels shorter
PiperOrigin-RevId: 320432378
2020-07-09 11:06:27 -07:00
Andrew Overton
cfd9b3ff56 [TextControls] Make text areas shorter when there is no floating label
PiperOrigin-RevId: 319228270
2020-07-01 08:22:48 -07:00
Andrew Overton
55f0fead00 [TextControls] Add underlined text field
This CL adds an MDCUnderlinedTextField class and some snapshot tests. Upcoming CLs will make slight visual modifications that will be reflected in snapshot diffs.

PiperOrigin-RevId: 314993621
2020-06-05 14:12:50 -07:00
Nobody
e035d70f50 Project import generated by Copybara.
PiperOrigin-RevId: 309039129
2020-04-29 17:00:59 +00: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
965cde39c8 This change finishes adding TextControls examples to the internal Catalog.
PiperOrigin-RevId: 305470131
2020-04-08 07:11:50 -07:00
Cody Weaver
fdf87c5995 [MDC/ColorScheme] Remove usage of init within MDC.
We recommend using `initWithDefaults` and we should follow the recommendation. This change removes all usage of `init` within MDC components in order to let us remove that initializer from the public surface.

PiperOrigin-RevId: 302958447
2020-03-25 13:36:51 -07:00
Andrew Overton
3e5edeccec
[TextControls] Add text area example (#9772)
This PR adds a text area example. I may refine some layout stuff before I start migrating people to use it. Gradient/top and bottom padding specifically.

Here's a gif:
![text_area_example](https://user-images.githubusercontent.com/8020010/74979556-d7773800-53fc-11ea-8508-cf5458bfe3d9.gif)

Closes #9407.
2020-02-21 11:17:37 -05:00
Andrew Overton
083cf8c12f
[TextControls] Restructure Cocoapods and Blaze targets (#9430)
## UPDATED PR DESCRIPTION:

**NOTE: [cl/290296411](http://cl/290296411) must be patched into whatever release includes this PR.**

There were requests to break it up further. With the latest changes, it will look like this in the future:

//components/TextControls:Shared # shared public types
//components/TextControls:BaseTextFields
//components/TextControls:FilledTextFields
//components/TextControls:FilledTextFieldsTheming
//components/TextControls:OutlinedTextFields
//components/TextControls:OutlinedTextFieldsTheming
//components/TextControls:BaseTextAreas
//components/TextControls:FilledTextAreas
//components/TextControls:FilledTextAreasTheming
//components/TextControls:OutlinedTextAreas
//components/TextControls:OutlinedTextAreasTheming
//components/TextControls:FilledInputChipView
//components/TextControls:FilledInputChipViewTheming
//components/TextControls:OutlinedInputChipView
//components/TextControls:OutlinedInputChipViewTheming
//components/private/TextControlsPrivate: Shared # shared private types
//components/private/TextControlsPrivate:OutlinedStyle
//components/private/TextControlsPrivate:FilledStyle

This would make it easier to sunset/retire a specific style of a specific text control type, for example.

## ORIGINAL PR DESCRIPTION:

This PR is an attempt to satisfy the recent requests to break up the Cocoapods subspecs and Bazel targets for TextControls.

~**NOTE: [cl/289710430](http://cl/289710430) must be patched into whatever release includes this PR.**~

**ANOTHER NOTE: This PR will break any third party people who depend on TextControls via Cocoapods and have not pinned to a specific version of our library.**

This PR takes the following Cocoapods subspecs:
TextControls
TextControls+Theming

And breaks them up into these ones:
TextControls
TextControls+TextFields
TextControls+TextFieldsTheming
private/TextControlsPrivate

Similarly, it takes the following bazel targets:
//components/TextControls
//components/TextControls:Theming

And breaks them up into these ones:
//components/TextControls
//components/TextControls:TextFields
//components/TextControls:TextFieldsTheming
//components/private/TextControlsPrivate

Where before a third party client would have had the following in their Podfile:
`pod 'MaterialComponents/TextControls'`
They would now have:
`pod 'MaterialComponents/TextControls+TextFields'`

When I started this work I originally planned to have there be top level components for each of the TextControls that all depended on a shared private component. However, I quickly remembered that all the text controls shared some public types too. At some point I decided it make make sense to make use of extensions.

In order to satisfy pod lib lint I had to add some dummy source files and dummy test files. The dummy test files could potentially have some stuff in there if we want to validate the enums they refer to somehow...

Closes #9405.
2020-01-17 15:21:08 -05:00
Wenyu Zhang
ab901f7654
Revert "[ColorScheme] deprecate init method and update documentation to reflect its purpose. (#9391)" (#9396)
This reverts commit 5fc6ec2f96e69f1e4c579ca69344557ad83329f2.
2020-01-09 13:54:20 -05:00
Wenyu Zhang
5fc6ec2f96
[ColorScheme] deprecate init method and update documentation to reflect its purpose. (#9391)
closes https://github.com/material-components/material-components-ios/issues/9390
2020-01-08 18:07:01 -05:00
Andrew Overton
dc10fe2d0d
[TextControls] Refactor text control examples (#9358)
This is an attempt at taking the existing text controls example and making it A) abstract, so that similar example can be made for text areas and chip fields, and B) fit in a scrollview, so all of the example is accessible in large content size categories.

It's fully functional, but probably not done changing.

Closes #9359.

Here's a gif:

![example](https://user-images.githubusercontent.com/8020010/71596471-8ab66580-2b0d-11ea-81c5-e1a775d8db14.gif)
2020-01-02 09:58:42 -05:00
Andrew Overton
95889abf03
[TextControls] Add swift storyboard example (#9328)
This PR adds a Swift storyboard example for TextControls.

Here is a screenshot:

![Simulator Screen Shot - iPhone 7 - 2019-12-20 at 15 15 17](https://user-images.githubusercontent.com/8020010/71290693-7b316280-233e-11ea-9029-4097a4d12c46.png)

Closes #9328.
2019-12-27 12:48:00 -05:00
Andrew Overton
f3daf9b498
[TextControls] Add Outlined theming extension (#9002)
This PR adds the theming extension for MDCOutlinedTextField.

Here's a screenshot:

<img width="370" alt="Screen Shot 2019-11-20 at 12 09 06 PM" src="https://user-images.githubusercontent.com/8020010/69260871-91f16780-0b8e-11ea-8e65-b6b8a373cf89.png">

Closes #8682.
2019-11-20 16:16:21 -05:00
Andrew Overton
c806e4b9d0
[TextControls] Add MDCFilledTextField theming extension (#8993)
This PR adds the theming extension for MDCFilledTextField.

Here's a screenshot:

<img width="359" alt="Screen Shot 2019-11-19 at 9 54 59 AM" src="https://user-images.githubusercontent.com/8020010/69157248-b11ac700-0ab2-11ea-9acb-db06d96e94a3.png">


Related to #8682.
2019-11-20 11:32:58 -05:00
Andrew Overton
d93ddfbc1b
[TextControls] Add dynamic type functionality to text controls example (#8847)
This PR adds some dynamic type functionality to the text controls example.
Note that in the largest content sizes the content goes off the screen. This will be addressed in a follow up PR.
 
Here is a gif:

![DynamicType](https://user-images.githubusercontent.com/8020010/68900027-f92b9980-0700-11ea-958e-6965638bdbc5.gif)

Closes #8845.
2019-11-15 11:13:43 -05:00
Andrew Overton
9b9edf9f46
[TextControls] Use system dynamic colors for sensible defaults in iOS 13 (#8818)
MDCFilledTextField and MDCOutlinedTextField are completely unreadable (inaccessible) in iOS 13 dark mode when shown over the system background color. When using `borderStyle`, MDCBaseTextField is completely unreadable in iOS 13 dark mode when shown over _any_ color, because UITextField adds a system background color to the textfield's background. This PR addresses these issues. This PR doesn't affect pre-iOS 13 behavior.

Note that the system placeholder and clear button never pass contrast in dark mode. I know the system clear button doesn't even pass contrast in light mode.

Note that the below gifs are outdated. Here's what it looks like now in dark mode:

<img width="371" alt="Screen Shot 2019-11-14 at 11 40 07 AM" src="https://user-images.githubusercontent.com/8020010/68877158-9a036000-06d3-11ea-8cd2-902a1d2b0eb1.png">

Here's a before gif in iOS 13 dark mode:
![iOS13darkbefore](https://user-images.githubusercontent.com/8020010/68875587-15afdd80-06d1-11ea-8bee-b583a56e4537.gif)

Here's an after gif in iOS 13 light mode:
![iOS13light](https://user-images.githubusercontent.com/8020010/68875641-2c563480-06d1-11ea-8172-5743390bf839.gif)

Here's an after gif in iOS 13 dark mode:

![iOS13Dark](https://user-images.githubusercontent.com/8020010/68875625-282a1700-06d1-11ea-9f3d-2d56d068f3ed.gif)

Closes #8817.
2019-11-14 15:32:45 -05:00
Andrew Overton
02f9c9f01d
Move new TextFields into TextControls directory (#8726)
In this PR I extract the new TextFields from the old TextFields directory. In the future, if we bring over the input chip view and text area, they will go under this new TextControls directory as well.

Closes #8684.
2019-11-07 14:17:56 -05:00