30 Commits

Author SHA1 Message Date
Jeff Verkoeyen
09a07ca6d2 Internal change
PiperOrigin-RevId: 333130898
2020-09-22 12:11:00 -07:00
Andrew Overton
3aace45a83 [TextControls] Add containerRadius to filled style object and base text area
PiperOrigin-RevId: 330771085
2020-09-09 12:12:44 -07:00
Andrew Overton
d303da4db4 [TextControls] Add containerRadius to MDCBaseTextField
PiperOrigin-RevId: 330576959
2020-09-08 13:41:24 -07:00
Andrew Overton
1f46b8b02d [Multiple components] Fix Cocoapods/compilation issues
PiperOrigin-RevId: 323829252
2020-07-29 11:28:05 -07:00
Andrew Overton
0950ece8f3 [TextControls] Allow setting underline thickness regardless of state
PiperOrigin-RevId: 323002391
2020-07-24 08:43:22 -07:00
Andrew Overton
49b441e849 [TextControls] Prepare to expose preferredContainerHeight on text controls
PiperOrigin-RevId: 322856550
2020-07-23 13:43:55 -07:00
Andrew Overton
ae6938670e [TextControls] Make filled positioning reference subclass NSObject
PiperOrigin-RevId: 322791755
2020-07-23 08:36:24 -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
b7f5b0dd2b [TextControls] Separate side padding into leading/trailing padding
This is pre-work for b/158109599.

PiperOrigin-RevId: 316874616
2020-06-17 06:20:05 -07:00
Andrew Overton
765676cca8 [TextControls] Rename + small refactor of horizontal positioning stuff
PiperOrigin-RevId: 316164753
2020-06-12 13:21:48 -07:00
Andrew Overton
c302339943 [TextControls] Change side view positioning for MDCUnderlinedTextField
This change introduces a new private protocol, MDCTextControlTextField, which inherits from MDCTextControl. This protocol adds one property, of a new enum, MDCTextControlTextFieldSideViewVerticalPosition. This type helps MDCBaseTextFieldLayout determine how to vertically position side views. The purpose is to allow MDCUnderlinedTextField to vertically align its side views with the text rect, as opposed to vertically centering them in the container, like the filled and outlined styles do. I'm not sure about the name `MDCTextControlTextFieldSideViewVerticalPosition`, but other ones I considered that were maybe more clear were too ridiculously long.

PiperOrigin-RevId: 316028095
2020-06-11 19:52:03 -07:00
Andrew Overton
6f169c9950 [TextControls] Update Podspec after TextControls changes
PiperOrigin-RevId: 315477850
2020-06-09 07:17:11 -07:00
Andrew Overton
617675f313 [TextControls] Add underlined style object
This CL breaks up the MDCTextControlStyleFilled into two separate classes, MDCTextControlStyleFilled and MDCTextControlStyleUnderlined. The filled style inherits from the underlined style. There's not really any "new" code here, just cut and pasted code.

cl/314528837 (which has this CL as a diffbase) adds the MDCUnderlinedTextField itself, along with with snapshot tests.

PiperOrigin-RevId: 314982942
2020-06-05 13:13:03 -07:00
Andrew Overton
9b2e7ecd7a [TextControls] Move private text fields files to TextControlsPrivate
The files moved in this CL were added before TextControlsPrivate existed. TextControlsPrivate is the best place for them.

PiperOrigin-RevId: 314922972
2020-06-05 07:16:26 -07:00
Andrew Overton
1d6faa1e6d [TextControls] Extract some duplicated methods to C functions
This CL extracts some duplicated methods to C functions

PiperOrigin-RevId: 314835047
2020-06-04 17:24:13 -07:00
Andrew Overton
1b63eabe19 [TextControls] Add notion of horizontal positioning reference
No visible or public API changes. Internal refactor.

This change adds the notion of a horizontal positioning reference. This will make it so that different styles can have different horizontal padding values.

Prior to this change, there was only one "horizontal padding" value. This change separates it into two values: one for the padding between leftmost and rightmost views and the left and right edges of the TextControl, and one for the padding between subviews of the TextControl. These two values live on a horizontal positioning reference object. Different styles will one day have different horizontal positioning reference objects.

For now only TextControl text fields will use this.
It's a lot of files but trivial changes in most, if not all, of them.

PiperOrigin-RevId: 314748534
2020-06-04 09:58:13 -07:00
Andrew Overton
80bbc9fc03 [TextControls] Extract duplicated methods to C function
This method takes three identical methods and extracts them to a shared C function.

PiperOrigin-RevId: 314573723
2020-06-03 11:51:02 -07:00
Wenyu Zhang
a3381717f7
Fix the bazel BUILD files and snapshot that were restored unintentionally.(#9983) 2020-04-29 11:00:00 -04:00
Randall Li
0100cfe414 [MDC-iOS/BottomSheet] Fix dismissOnDraggingDownSheet behavior
The bottom sheet incorrectly allowed the sheet to be drag dismissed when `dismissOnDraggingDownSheet` was set to NO.

This change permits the gesture to dismiss to begin but prevents it from actually closing the sheet.

https://github.com/material-components/material-components-ios/issues/9723

Closes https://github.com/material-components/material-components-ios/pull/9885

PiperOrigin-RevId: 307802500
2020-04-22 06:21:26 -07:00
Jeff Verkoeyen
8abbb099a9 Delete all bazel support.
We no longer support bazel.

This PR deletes everything related to bazel support from our repo.

Closes https://github.com/material-components/material-components-ios/pull/9968

PiperOrigin-RevId: 306227127
2020-04-13 07:13:47 -07:00
Andrew Overton
a37edbf81a
MDCTextControlLabelState renamed to MDCTextControlLabelPosition and other changes (#9753)
This follow up PR for #9731 includes the following:
* MDCTextControlLabelState has been renamed to MDCTextControlLabelPosition
* Identical methods in MDCTextField and MDCBaseArea have been consolidated as C functions in shared locations.
* A few methods have been renamed.
* A few pragma marks have been renamed.

Related to #9407.
2020-02-18 16:24:45 -05:00
Andrew Overton
2f6b40a588
[TextControls] Add the rest of MDCBaseTextArea (#9731)
This PR adds the bulk of MDCBaseTextArea. If you are familiar with MDCBaseTextField this will all look very familiar.

Here's a gif:
![base-text-area](https://user-images.githubusercontent.com/8020010/74545957-c8354d80-4f17-11ea-9a5b-9237934f6119.gif)
That black line is not part of the text area haha. 

The other styles (and tests) to follow.

Related to #9407.
2020-02-18 12:48:35 -05:00
Andrew Overton
2d8d6a082f
Move static const assignment to MDCTextControl.m (#9701)
This change makes the static const in MDCTextControl.h a FOUNDATION_EXTERN const. 

Related to [b/143312111](http://b/143312111).
2020-02-14 10:48:30 -05:00
Andrew Overton
d89fa3fb11
[Material][Availability] Migrates Text Controls to MDCAvailability (#9720)
This PR addresses the failures in https://github.com/material-components/material-components-ios/pull/9719, which was copybara'd from [cl/293702448](http://cl/293702448)
2020-02-13 16:41:10 -05:00
Andrew Overton
e6ef298bdf
[TextControls] Changes from text-area-feature-branch with additional podspec and BUILD file changes (#9711)
Because CI wasn't working earlier this week I merged the initial text area PRs (https://github.com/material-components/material-components-ios/pull/9682 and https://github.com/material-components/material-components-ios/pull/9684) into a [feature branch](https://github.com/material-components/material-components-ios/tree/text-area-feature-branch) in the main repo. This PR contains those changes, as well as a commit to update the BUILD file and podspec (3da2803), a commit that makes it compile (6a06594), and a commit to run clang (078cd70). The changes in these last three commits have not been reviewed, unlike the ones from the PRs into the feature branch.

Related to #9407.
2020-02-13 13:33:59 -05:00
Andrew Overton
1d7746f552 Reevaluate RTL logic because of internal snapshot testing infrastructure
Some internal snapshot tests force RTL by setting the semantic content attribute. The "is RTL" logic in MDCBaseTextFields up to this point only looked at effective layout direction. This change makes it so that it checks if either RTL or LTR semantic content attributes are being forced before consulting effective layout direction.

PiperOrigin-RevId: 293201200
2020-02-04 12:19:14 -08:00
Andrew Overton
5b1788424a Remove unwanted animations from filled style.
In certain circumstances when we update the paths of the filled style without animations we need to remove any prior animations.

PiperOrigin-RevId: 293141419
2020-02-04 07:30:03 -08:00
Andrew Overton
2103f285ee This change adds a new property to the private protocol MDCTextControl. This property, labelFrame, is used by the outlined style object during style application. The outlined style object needs to know the label frame because the outline breaks before it hits the label and resumes after it. Accessing label.frame has proven unreliable during this scenario because of animations in progress.
PiperOrigin-RevId: 292384279
2020-01-30 11:11:01 -08: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