52 Commits

Author SHA1 Message Date
Nobody
ce2ef97f2c Internal change
PiperOrigin-RevId: 583160453
2023-11-16 14:12:48 -08:00
Nobody
481f11fd35 Internal change
PiperOrigin-RevId: 559840945
2023-08-24 12:53:08 -07:00
Wenyu Zhang
4f49af7c18 Internal change
PiperOrigin-RevId: 540666237
2023-06-15 13:07:13 -07:00
Randall Li
9b7c57c89c [MDCTextFields] Change deprecation warning to point at migration guide.
PiperOrigin-RevId: 490318418
2022-11-22 13:15:44 -08:00
Nobody
ff7d4d0192 Fixed up imports for private/TextControlsPrivate
PiperOrigin-RevId: 475303310
2022-09-19 09:04:47 -07:00
Nobody
9ed57c2f2d Remove unused variables labelMinX and floatingLabelMinX
PiperOrigin-RevId: 473842334
2022-09-12 14:21:34 -07:00
Jeff Verkoeyen
b2bbd50350 Mark all To Be Deprecated APIs as Deprecated.
PiperOrigin-RevId: 460478209
2022-07-12 09:13:52 -07:00
Cody Weaver
a169a26638 [TextControls] Annotate symbols as to be deprecated
PiperOrigin-RevId: 457764325
2022-06-28 10:27:57 -07:00
Yingwei Fan
90cd2149d5 [MDCTextControl] Fix the outline path animation for the MDC text view.
Previously, changing the size of the text view will not have animation on the border. This change will enable the animation if there is a size change.

PiperOrigin-RevId: 445022809
2022-04-27 18:34:22 -07:00
Nobody
6b4484343a [MDCTextControl] Rollback the fix for the outline path animation for the MDC text view.
PiperOrigin-RevId: 443660262
2022-04-22 07:29:12 -07:00
Yingwei Fan
25af60c2fd [MDCTextControl] Fix the outline path animation for the MDC text view.
Previously, changing the size of the text view will not have animation on the border. This change will enable the animation if there is a size change.

PiperOrigin-RevId: 443535273
2022-04-21 18:29:08 -07:00
Jeff Verkoeyen
c34de39e30 Internal change.
PiperOrigin-RevId: 397316843
2021-09-17 07:45:01 -07:00
Andrew Overton
df09e7b521 [TextControls] Fix bug where outline was misplaced when label text was empty string
PiperOrigin-RevId: 388706359
2021-08-04 08:51:41 -07:00
Andrew Overton
ab888ec4b5 [TextControls] Keep floating label within bounds of outlined text controls
PiperOrigin-RevId: 385013413
2021-07-15 14:47:18 -07:00
Andrew Overton
73c27ca0f0 [TextControls] Fix right edge padding in RTL
PiperOrigin-RevId: 375097172
2021-05-21 09:11:30 -07:00
Jeff Verkoeyen
a8e4831fd0 Flattening all unit tests into single directories as per convention.
PiperOrigin-RevId: 367426300
2021-04-08 07:33:29 -07:00
Andrew Overton
2a31a3162f [TextControls] Disable label animation when label is truncated
PiperOrigin-RevId: 367256976
2021-04-07 11:12:32 -07:00
Jeff Verkoeyen
c53f44398e Optimizing imports
PiperOrigin-RevId: 357185618
2021-02-12 07:29:28 -08:00
Andrew Overton
73e404888d [TextControls] Expose density on text fields and text areas
PiperOrigin-RevId: 355204832
2021-02-02 11:00:01 -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
52e9d15a2b [TextControls] Add placeholder to text area
PiperOrigin-RevId: 341453573
2020-11-09 11:53:48 -08:00
Andrew Overton
d729b5c464 [TextControls] Use custom leadingView/trailingView instead of UITextField's leftView/rightView
PiperOrigin-RevId: 341104274
2020-11-06 13:09:58 -08:00
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