473 Commits

Author SHA1 Message Date
Jeff Verkoeyen
09a07ca6d2 Internal change
PiperOrigin-RevId: 333130898
2020-09-22 12:11:00 -07:00
Andrew Overton
07c46757cc Replace material.io API doc links with links to the relevant header f…
This PR replaces API links containing "/api-docs/" with links to suitable header files in GitHub because the site previously linked to is being taken down and replaced with something that won't handle API docs.

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

COPYBARA_INTEGRATE_REVIEW=https://github.com/material-components/material-components-ios/pull/10045 from andrewoverton:replace-mio-api-docs-with-github-links 0d6e56cc11d0c147366a4f6cde829d8b51567ecc
PiperOrigin-RevId: 323424362
2020-07-27 13:09:23 -07:00
Nobody
b3a632da46 Updates MDCMultilineTextField to better support being embedded in self-sizing cells.
PiperOrigin-RevId: 318269826
2020-06-25 07:49:40 -07:00
Nobody
e214be3b2d Updates MDCMultilineTextField's bottom textfield constraint to use the textInsets as the constant.
This brings parallels the calculation done in sizeThatFits and will ensure the set textInsets are always adhered to.

PiperOrigin-RevId: 318268981
2020-06-25 07:42:40 -07:00
Bryan Oltman
d4880b4600 [TextFields] Return the empty string instead of nil in MDCTextField's accessibilityValue method to avoid VoiceOver defaulting to [super accessibilityValue].
PiperOrigin-RevId: 316103878
2020-06-12 07:55:20 -07:00
Nobody
fb10ae1b1f Add borderRadius property
PiperOrigin-RevId: 309425430
2020-05-01 10:04:46 -07:00
Wenyu Zhang
81bd1dd07f Internal change.
PiperOrigin-RevId: 309284703
2020-04-30 13:09:22 -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
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
512d6a0049 Replace TextControls documentation
This PR primarily replaces the TextControls README with a different README. It also makes the TextControls README the source of the default TextField docs on material.io.

Preview the changes at: https://github.com/andrewoverton/material-components-ios/tree/material-io-text-field/components/TextControls

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

PiperOrigin-RevId: 306473798
2020-04-14 11:05:09 -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
d26c963b75 [TextFields] Update TextFields docs
This PR removes docs for MDCTypographyThemer. I noticed this stuff was still here when I got automatically unassigned from [b/145205327](http://b/145205327).

Planning to copybara this in.

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

COPYBARA_INTEGRATE_REVIEW=https://github.com/material-components/material-components-ios/pull/9948 from andrewoverton:delete-typography-theming-docs 0c68b8db5ee7aff45792544e3adbce1c60b3c1bf
PiperOrigin-RevId: 302511391
2020-03-23 14:05:17 -07:00
Bryan Oltman
cc3fa165b8 [TextFields] Move protocol definitions into separate header files
PiperOrigin-RevId: 302059436
2020-03-20 11:00:42 -07:00
featherless
057bfd0b95
[TextFields] Lower the error VoiceOver announcement delay to near zero. (#9822)
Prior to this change, error VoiceOver announcements would be initiated half a second after the error state was set, potentially resulting in about half a second of other VoiceOver notifications being announced before being interrupted by the error announcement.

The error announcement is intended to take precedent over the other informative announcements (such as character counts). Unfortunately, the error state is often set before the internal textInputDidChange: event which means that if we fire the error announcement immediately, then the error announcement will be cut off by the textInputDidChange: announcement for character counts. To combat this, https://github.com/material-components/material-components-ios/pull/7256 had introduced a dispatch_after to kick off the error event half a second later.

To address the first problem without breaking the second, this change reduces the delay of the error announcement to 0.05 seconds, a window of time small enough to avoid hearing any of the character count announcement, but large enough to happen after the character count announcement is posted, resulting in the error announcement being the one that is read out.

Closes https://github.com/material-components/material-components-ios/issues/7625
2020-03-03 10:30:42 -05:00
Bryan Oltman
d83af534c3
[TextFields] implement resignFirstResponder in MDCMultilineTextField (#9793) 2020-02-25 16:17:19 -05:00
Bryan Oltman
86b4fbcb2c
[TextFields] Delete deprecated MDCTextFieldTypographyThemer (#9689)
MDCTextFieldTypographyThemer is deprecated and has no internal usage.

Fixes #9661
2020-02-11 18:22:22 -05:00
Cody Weaver
6c2b38e46f [TextFields] Use correct localization API.
We were using the `NSLocalizedStringWithDefaultValue` API which is supposed to be used with the `genstrings` tool. This updates us to use the correct API which is `localizedStringForKey:value:table:`.

For more context on the `genstrings` tool see: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html.

Closes #5616

PiperOrigin-RevId: 292469399
2020-01-30 19:09:59 -08:00
Cody Weaver
7dbd3e0ef5 [TextFields] Add localized clear text string for multiline text field.
PiperOrigin-RevId: 292146071
2020-01-29 08:25:20 -08:00
Andrew Overton
7a48d3997f
[TextFields] Add identity check in -setTextColor: in MDCTextField (#9480)
This PR adds an identity check in `-setTextColor:` in MDCTextField. This identity check short circuits an infinite loop triggered by `-setTextColor:` under certain mysterious circumstances involving the MDCTextField layout pass and MDCFlexibleHeaderView KVO stuff surrounding safeAreaInset changes. I don't fully understand what's going on tbh :)

The internal bug ([b/148159587](http://b/148159587)) has links to before and after gifs in the comments.

Closes #9470

### Update: The internal client who reported the bug was unable to reproduce it with these changes.
2020-01-24 12:58:43 -05:00
Andrew Overton
b28e09d345
[TextFields] MDCTextInputControllerOutlinedTextArea border width fix (#9454)
This PR includes the changes from @istvanp's https://github.com/material-components/material-components-ios/pull/7588 with updates to the screenshot goldens. Original PR description from https://github.com/material-components/material-components-ios/pull/7588:

Fixes border width not changing to 2 points wide when editing field (issue #7587)

## Screenshots
**Tested Device:** iPhone 6, iOS 12.3.1
### Before
[Editing](https://user-images.githubusercontent.com/179335/59697846-8f907900-91bc-11e9-9eb9-46601ecfbfe9.PNG)
[Not Editing](https://user-images.githubusercontent.com/179335/59697849-8f907900-91bc-11e9-9f94-18e84ea76d64.PNG)

### After
[Editing](https://user-images.githubusercontent.com/179335/59698057-e5fdb780-91bc-11e9-99bd-5a921c78a442.PNG)
2020-01-21 16:44:19 -05:00
Cody Weaver
3b3d288ea4
[TextFields] Add theming extension for underline controller (#9437)
In #9109  we removed the color themer for the underline controller. This change closes #9371  which will allow clients to theme their underline controller text fields via a theming extension. This change will theme both color and typography.

*Note* [Material](material.io) recommends using a [filled or outlined text field](https://material.io/components/text-fields/).

| Resting | Active |
| --- | --- |
|![Simulator Screen Shot - iPhone 8 Plus - 2020-01-16 at 13 13 28](https://user-images.githubusercontent.com/7131294/72563237-1811ed80-3862-11ea-8788-816c927f03e4.png)|![Simulator Screen Shot - iPhone 8 Plus - 2020-01-16 at 13 13 26](https://user-images.githubusercontent.com/7131294/72563252-1cd6a180-3862-11ea-97c9-6d7c82f6878d.png)|

Closes #9371 
Closes #9242
2020-01-16 14:20:09 -08:00
featherless
b7cf0de915
[bazel] Remove all unused swift_library load statements. (#9369)
Found by searching for all references to `\bswift_library` and removing load statements from files that only returned one result.

Clean up as part of https://github.com/material-components/material-components-ios/issues/5491
2020-01-02 11:01:31 -05:00
featherless
0a0bc4b47b
[automated] Ran buildifier on all BUILD files. (#9366)
```
find . -name BUILD | xargs buildifier
```

This is in preparation of https://github.com/material-components/material-components-ios/issues/9363
2020-01-02 10:05:07 -05:00
Andrew Overton
703589b3eb
[TextFields] Give MDCTextField clear button proper hit area insets (#8790)
This PR makes the MDCTextField clear button always meet the minimum touch target.

Closes #5373.
2020-01-02 08:31:46 -05:00
Andrew Overton
f8d9897aac
Removes requirement that the textView delegate be set when informing layout delegate of a size change (#9337)
This PR contains the changes from #9263. CI didn't seem to be working on the original PR so I just copied the changes here.
2019-12-23 16:32:40 -05:00
Andrew Overton
f4ec87ac39
Ensures that constraints used for the trailing view are properly removed when a new trailing view is set (#9336)
This PR contains the changes from #9258. CI didn't seem to be working on the original PR, and then it got messy as a result of bad merges, so I just copied the changes here.
2019-12-23 16:32:21 -05:00
Andrew Overton
8a510746f6
Delete MDCOutlinedTextFieldColorThemer (#9274)
BUILD and Podspec changes coming with the deletion of MDCFilledTextFieldColorThemer.

Closes #9080.
2019-12-16 09:51:34 -05:00
Andrew Overton
df1ac34ea1
Delete MDCTextFieldFontThemer (#9226)
Delete MDCTextFieldFontThemer. Closes #9086.
2019-12-10 12:32:48 -05:00
Andrew Overton
747844b4bb
deprecate-MDCOutlinedTextFieldColorThemer (#9215)
Related to #9080, should be merged after #9214.
2019-12-10 11:56:47 -05:00
Andrew Overton
cd7172a36a
[TextFields] Remove usage of MDCOutlinedTextFieldColorThemer (#9214)
This goal of this PR is to remove usage of MDCTextFieldColorThemer in preparation for its deprecation and deletion. The snapshot tests that were using this themer no longer have color theming. There is a TODO in each of these tests saying to use a theming extension if/when one that will work for them is written.

Related to #9080
2019-12-10 11:56:25 -05:00
Andrew Overton
63a7c6f3f6
[TextFields] Update MDCTextInputControllerOutlined theming extension to not use color themer (#9223)
Related to #9080
2019-12-10 11:04:47 -05:00
Andrew Overton
4b450aecc3
Deprecate MDCTypographyThemer (#9175)
Related to #9176
2019-12-10 10:51:09 -05:00
Andrew Overton
40afee6e0d
[TextFields] Remove MDCTextFieldTypographyThemer from snapshot tests (#9196)
This goal of this PR is to remove usage of MDCTextFieldTypographyThemer from MDCTextField snapshot tests in preparation for its deprecation and deletion. In cases where theming with a theming extension/container scheme is available I'm changing the snapshot test files to use those. In cases where there is no equivalent theming extension I am foregoing theming. The two things that have themers but lack theming extensions are MDCTextField itself (we only have theming extensions for the filled and outlined textfield controllers) and the MDCTextInputControllerOutlinedTextArea.

Related to #9168
2019-12-09 15:51:27 -05:00
Andrew Overton
4c75e862d4
[TextFields] Don't use MDCTextFieldTypographyThemer (#9170)
Related to #9168
2019-12-09 10:13:34 -05:00
Andrew Overton
6d2bfc4e3b
[TextFields] Deprecate MDCTextFieldFontThemer (#9169)
Related to #9168
2019-12-08 22:41:54 -05:00
Bryan Oltman
85f6dd9c09
[TextFields] Remove references to MDCTextFieldColorThemer from README (#9151)
`MDCTextFieldColorThemer` has been deleted, and should no longer be referenced in the README.

Addresses #9083
Addresses #9084
Addresses #9085
Addresses #9112
2019-12-06 12:58:27 -05:00
Bryan Oltman
87b9dd5a7d
[TextFields] Delete MDCTextFieldColorThemer (#9109)
Fixes #9083 
Fixes #9084
Fixes #9085
Fixes #9112
2019-12-05 16:38:39 -05:00
Bryan Oltman
9adc054ce0
[TextFields] Mark MDCTextFieldColorThemer as deprecated (#9076) 2019-12-04 20:35:45 -05:00
Wenyu Zhang
593cf1e621 Revert "[TextFields] Check if placeholder is hidden before verbalizing it in voice over. (#8804)"
This reverts commit f9c17caf1bffd8e4538ee2c587d780e55437243c.
2019-11-22 10:56:15 -05:00
Wenyu Zhang
d04f63a231 Revert "[TextFields] simplify test names since the name of the file already gives context. (#8952)"
This reverts commit d6ae7f6782bb554d043879b5965e9b2708145a60.
2019-11-22 10:55:27 -05:00
Wenyu Zhang
39fe0f89f1 Revert "[TextFields] Correction to the accessibility label (#8976)"
This reverts commit c498516b358998c9853e9934df9b643d4256b9da.
2019-11-22 10:51:57 -05:00
Randall Li
c498516b35
[TextFields] Correction to the accessibility label (#8976)
UITextField verbalizes the placeholder in a lower pitch when no text has been entered. This change incorporates this behavior into what values get added to the MDCTextField's accessibilityLabel.

Before after videos:
[singleFix.zip](https://github.com/material-components/material-components-ios/files/3853326/singleFix.zip)


QA=Notice that "state" is verbalized when it is not visible on screen in the after.
more info at #7513
2019-11-15 22:41:01 -05:00
Randall Li
d6ae7f6782 [TextFields] simplify test names since the name of the file already gives context. (#8952)
this was feed back in https://github.com/material-components/material-components-ios/pull/8902#discussion_r346874329

Applying change here.
2019-11-15 11:44:23 -08:00
Randall Li
1c17792b36
[MDCTextfields] Added accessibility label tests for MDCMultilineTextFields (#8902)
Copied the logic from the single line textfield. over to the multiline one.

part of https://github.com/material-components/material-components-ios/issues/7513
2019-11-15 13:24:54 -05:00
Randall Li
f9c17caf1b
[TextFields] Check if placeholder is hidden before verbalizing it in voice over. (#8804)
[TextFields] Add check for placeholder before adding to the accessibility strings spoken by voice over.

Also added changed example to remove the floating label so that we can check that voice over correctly verbalizes only the visible text.

Before and After zip:
[BeforeAfterVideos.zip](https://github.com/material-components/material-components-ios/files/3843558/BeforeAfterVideos.zip)

QA=Notice that "state" is verbalized when it is not visible on screen in the after.
more info at #7513
2019-11-15 12:21:40 -05:00
Randall Li
a4decc6c8e
Fix spelling mistake (#8910)
spelling mistake was made in https://github.com/material-components/material-components-ios/pull/8830

while working on #7513
2019-11-15 11:14:04 -05:00
Randall Li
3c0d7953ad [TextFields] Added header comment: placeholder APIs are for label text (#8803)
Added header comment clarifying that the placeholder APIs are really for label text and not placeholder.

more info at #7513
2019-11-15 07:32:17 -08:00
Randall Li
3d1b6f9acc
[TextFields] Added tests for accessibilityLabel (#8830)
Related to https://github.com/material-components/material-components-ios/pull/8804 which got feedback asking for tests. This puts in tests before that change.

more info at #7513
2019-11-15 10:06:40 -05:00
Bryan Oltman
42e220d9c1
[TextFields] Convert clear button to MDCButton (#8784)
* [TextFields] Convert clear button to MDCButton

* Add buttons to build file

* Build file update

* Update build file again

* [Dialogs] Set dialog message accessibilityFrame based on visible message text

* Revert "[Dialogs] Set dialog message accessibilityFrame based on visible message text"

This reverts commit ae6154ed8b2df5a3ad73ad2e7923ed404297f821.

* Add snapshot test for clear button ripple

* Add ripple snapshot goldens

* Remove unnecessary cornerRadius setting

* Cast clear button ink color alpha to CGFloat

* Add Button and Ripple dependencies to snapshot tests

* PR feedback

* clang

* Fix imports
2019-11-13 10:11:27 -05:00