101 Commits

Author SHA1 Message Date
Yarden Eitan
8960677221 [FeatureHighlight] Deprecate color themer APIs.
PiperOrigin-RevId: 333366448
2020-09-23 13:59:45 -07:00
Jeff Verkoeyen
eb82984224 Internal change
PiperOrigin-RevId: 331764642
2020-09-15 07:31:56 -07:00
Bryan Oltman
180a5bf724 [FeatureHighlight] Delete deprecated FeatureHighlightAccessibilityMutator.
PiperOrigin-RevId: 322445386
2020-07-21 14:42:20 -07:00
Bryan Oltman
b2ae9cdce1 [FeatureHighlight] Delete unused accessibility hint string and unused localization support.
PiperOrigin-RevId: 313776127
2020-05-29 07:23:53 -07:00
Jeff Verkoeyen
04c7a4b768 [FeatureHighlight] Minor docs fix.
PiperOrigin-RevId: 301373617
2020-03-17 08:01:18 -07:00
Randall Li
fa62718bc5
add deps on availability for a bunch of components (#9679)
* add Availability build file

* add Button deps on availability

* added elevation

* corrected include statements to use import of the umbrella files

* revert unwanted changes

* spaces

* clangformat

* add availability dep

* added buttom nav deps on availibility

* Add FeatureHighlight build dep for Availability

* Add Availability build dep to FeatureHighlight private

* Add missing =

* fixed tabs spacing

Co-authored-by: Bryan Oltman <bryanoltman@gmail.com>
2020-02-11 13:14:09 -05:00
Nobody
ef3c2bf8c9 [Material][Availability] Migrates Feature Hightlight to MDCAvailability.
PiperOrigin-RevId: 293794429
2020-02-07 05:30:24 -08:00
Robert Moore
076aaa29dc
[FeatureHighlight] Allow UIAccessibility to activate the "dismiss" affordance. (#9486)
This change connects the recently-added "dismiss" affordance to an action that
allows UIAccessibility to reject the Feature Highlight.  In #8959, a
discoverable affordance was added to Feature Highlight so UIAccessibility
would present dismiss options more easily to users. That change did not
include connecting the view to any action or gesture recognizer, so users
could discover a "dismiss" button but nothing happened when it was activated.

This change does the following:

*   Changes the dismiss view to a UIButton. There were complications when
    attempting to add another gesture recognizer to the view hierarchy and a
    UIButton was a simpler solution.
*   Sets the layout frame of the dismiss view to `{0, 0, 1, 1}`, creating a
    nearly-invisible clear view in the upper-left corner of the screen. The
    `accessibilityFrame` is set to match
    the Feature Highlight's bounds, which presents the affordance to
    UIAccessibility in a manner similar to a Scrim.  This is necessary to
    avoid introducing accidental "reject" taps if the user pressed on the
    Feature Highlight itself.

Closes #9450
2020-01-24 13:51:10 -05:00
Andrew Overton
0b2323ad42
Delete MDCFeatureHighlightTypographyThemer (#9273)
This PR deletes MDCFeatureHighlightTypographyThemer.

Closes #9208.
2019-12-16 09:52:51 -05:00
Andrew Overton
ad9631c0f7
Delete MDCFeatureHighlightFontThemer (#9230)
Closes #9104. Delete MDCFeatureHighlightFontThemer.
2019-12-10 13:41:31 -05:00
Andrew Overton
1920dd6878
Deprecate MDCFeatureHighlightTypographyThemer (#9225)
Deprecate MDCFeatureHighlightTypographyThemer. Related to #9208.
2019-12-10 11:21:02 -05:00
Andrew Overton
c8b904426e
deprecate MDCFeatureHighlightFontThemer (#9115)
Related to #9104.
2019-12-06 11:35:50 -05:00
Yarden Eitan
4c7402857c
[FeatureHighlight] Add a voiceover dismissal affordance for the feature highlight. (#8959)
Currently the feature highlight didn't have a proper dismiss affordance when voiceover is on.

It will instead speak a hint of "double tap to dismiss" on the title but without allowing the user to dismiss even when double tapped.

This adds a dismiss affordance and passes the accessibility hint to dismiss to that view.

Frame of dismissal button in VO:
![IMG_2140](https://user-images.githubusercontent.com/4066863/68971016-95fc3e80-07b6-11ea-846d-e4219429a4d7.PNG)


Closes #8961 #8888 #8884 #8886 #8885
2019-11-15 15:11:56 -05:00
Yarden Eitan
ee10e067aa
[FeatureHighlight] Add adjustsFontForContentSizeCategory suppor… (#8655)
This PR adds adjustsFontForContentSizeCategory property to MDCFeatureHighlightViewController, allowing clients to have their scalable fonts adjust based on content size category changes.

Due to FeatureHighlight using an attributedText to set up the text for its labels, for the scalable fonts to adjust properly, the attributedText needs to have the font as an attribute. This is an interesting gotcha that was found while working on this PR.

Closes #8634
2019-10-28 17:32:59 -04:00
Cody Weaver
a57245ed91
[FeatureHighlight] Add traitCollectionDidChange block (#8036)
Adds a traitCollectionDidChangeBlock to MDCFeatureHighlightViewController and MDCFeatureHighlightView, called when its trait collection changes.

Additionally this moves the FeatureHighlightView test to a more generic name, instead of FeatureHighlightNoopTests they were moved to FeatureHighlightViewTests.

Closes #8050
2019-07-24 07:36:14 -07:00
Bryan Oltman
086cdb43e5
[FeatureHighlight] Support dynamic color (#7936)
* initial support for dynamic color

* Use current trait collection to get pulse colors

* Remove test code

* Uncomment

* clang

* Fix iOS 13 check
2019-07-16 12:08:27 -04:00
featherless
7758aae05d
[FeatureHighlight] Annotate themer APIs with the recommended APIs. (#7222)
Part of https://github.com/material-components/material-components-ios/issues/7108
2019-04-22 19:58:16 +03:00
ianegordon
861ad202a3
[FeatureHighlight] New Dynamic Type curves (#6947)
Add support for the new dynamic type scaling curves to feature highlight.

The new curves are enabled by default, but a flag has been added allowing existing users to opt-in to the older behavior.
2019-03-27 13:07:18 -04:00
Robert Moore
800188a649
{clang-format} Format the components. (#6347)
This is a follow-up to https://github.com/material-components/material-components-ios/pull/6027

```
find components \( -name "*.h" -or -name "*.m" \) | xargs clang-format -i
```
2019-01-23 11:08:43 -05:00
Yarden Eitan
2803125b2c
ran clang-format (#6027) 2019-01-11 13:23:51 -05:00
Robert Moore
03f3351ad5
Global replace of single-precision floats with CGFloat casts. (#5718)
Replacing all non-integral, single-precision floating point literals with double-precision values explicitly cast to CGFloat.  For example, `0.1f` should become `(CGFloat)0.1`.

Regex used:
```
([0-9]*\.)([0-9]*?)([1-9]+)([0-9]*?)[fF]
```

PiperOrigin-RevId: 220683126
2018-11-12 10:50:01 -05:00
Robert Moore
74a27253e8
Global replace of integral single-precision literals with integer literals. (#5709)
Global replace of integral single-precision literals with integer literals.

Regular expression used:
```perl
/[^\w]([0-9]+)\.[0]*[fF]/$1/
```
2018-11-08 14:02:04 -05: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
Jeff Verkoeyen
9854044c96 Revert "[automated] Standardize our open source license stanza to what Xcode generates. (#4982)"
This reverts commit b45bc2fdd4dfe12fc76751a45c9cf7b0d6c1261f.
2018-08-31 12:01:24 -04:00
featherless
b45bc2fdd4
[automated] Standardize our open source license stanza to what Xcode generates. (#4982)
Removes the need to copy-paste stanzas from other files anymore as we'll rely on https://github.com/material-components/material-components-ios/pull/4478 to generate the correct stanza for us instead.

This was an automated change generated by running a find-and-replace regular expression:

### Find

```
/\*
 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\.
 \*/
```

### Replace

```
// 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 11:49:00 -04:00
Andrew Overton
44bed97140
[FeatureHighlight] Fix crash when backgrounding and re-opening app. (#4796)
This PR (#4796) closes issue #4791, which was related to a crash that resulted from a fix to an internal client bug where the layout of the feature highlight was incorrect after rotations.

The approach taken was to revert the change that resulted in the crash and add a safeguard against incorrect layout by applying the positioning code both in the animation block (which will be sufficient for most cases) as well as after (which will be sufficient for cases where the frames we rely on in the positioning code are incorrect during the animation.)
2018-08-17 13:24:01 -04:00
featherless
e14b90e829
[schemes/Color] Formally mark all to-be-deprecated APIs as "ToBeDeprecated". (#4738)
This change further formalizes our pattern of annotating APIs that will be or are deprecated using class categories. Moving an API into such a category has the benefit of being picked up by the API diff toolchain and elevated into our release notes as a result.
2018-08-09 16:39:56 -04:00
Mohammad Cazi
e91de06841
we dismiss and present feature highlight from the new spot. (#4300)
https://github.com/material-components/material-components-ios/pull/4300
2018-05-29 16:28:00 -04:00
Mohammad Cazi
99f2303135
[FeatureHighlight] View should not be loaded unless it's explicitly called or presented. (#4234)
* Feature Highlight must not load the view unless the view property is called or it's presented.

* fixed the tests,
added new tests for loading view,
Moved the logic for accessibility hint default to view controller,
Match the pattern of of MDCAlertController for not loading the view.

* moving the string files in to the right folder

* change the if logic to isViewLoaded for more clarity?

https://github.com/material-components/material-components-ios/pull/4234
2018-05-24 10:58:43 -04:00
Mohammad Cazi
5ed1f44fb1 [FeatureHighlight] title not attributed. (#4175)
* seems like we were not setting attributed text for title.

* We should set attributed text for title as well.
2018-05-17 17:49:21 -04:00
Robert Moore
47c1bcb5d3
[FeatureHighlight] Allow setting accessibilityHint (#3649)
Users should be able to override the default `accessibilityHint` on the
title text of the Feature Highlight view. The current hint is incorrect
instructions about dismissing the view.

Since we are not currently making breaking changes to components, this
change will permit teams to override the incorrect hint by assigning
either an empty string (to have no hint) or to set an appropriate hint.

Partially implements #3644
2018-05-02 14:48:23 -04:00
featherless
0cc7e9860f
Standardizing API docs. (#3481)
This standardizes the themer API docs for every component.

Pivotal story: https://www.pivotaltracker.com/story/show/157066083
2018-04-26 22:25:57 -04:00
featherless
8395836c98
Remove all UIAppearance references from documentation. (#3480)
We do not intend to actively support UIAppearance any further. This change removes any references to supporting UIAppearance from our public documentation.

Pivotal story: https://www.pivotaltracker.com/story/show/157048342
2018-04-26 12:55:35 -04:00
featherless
bb9324ecae
[FeatureHighlight] Add umbrella headers for all extension targets. (#3466)
Also updated all imports to make use of the umbrella headers.

Pivotal story: https://www.pivotaltracker.com/story/show/157045283
2018-04-24 16:23:18 -04:00
Mohammad Cazi
8563ec05c7
[FeatureHighlight] Implementation of Typography Themer. (#3268)
* Adding TypographyThemer for FeatureHighlight.

* finish the deprecation comment.

* fix blaze build

* Typography -> TypographyThemer

* Updated old tests.

* Cleaning up comments, and test.

* use an instead of a for MDC
2018-04-09 16:08:20 -04:00
Mohammad Cazi
2962b79503
exposing title and body font for FeatureHighlightViewController. (#3274) 2018-04-09 14:22:09 -04:00
Mohammad Cazi
98740fac54
cleaning up dynamic type support for feature highlight by defining the default. (#3269) 2018-04-06 14:31:02 -04:00
Mohammad Cazi
fa00c708b7
[FeatureHighlight] Adding Color Themer. (#3260)
* Added Semantic Color Scheme Method for FeatureHighlight.

* change the applied color for title and body.

* Added Color Scheme for Feature Highlight.

* [Color] Implement a swift-friendly API for color scheme defaults. (#3246)

The old API required swift code like so:

    MDCSemanticColorScheme(materialDefaults: ())

The new API allows swift code like so:

    MDCSemanticColorScheme(defaults: .material)

Pivotal story: https://www.pivotaltracker.com/story/show/156527002
2018-04-06 10:24:16 -04:00
featherless
83b9ea1735
Revert "[Typography] Migrate from FontScheme to TypographyScheming (#3219)" (#3256)
This reverts commit 2e48edf99f8c73c81ba4d782f51a55faf06d23a8.

This commit introduced a test-breaking change in TextFields that is blocking presubmits.

Closes https://github.com/material-components/material-components-ios/issues/3245
2018-04-05 14:04:44 -04:00
Robert Moore
25c2fc889e Merge branch 'release-candidate' into develop 2018-04-05 11:23:59 -04:00
ianegordon
2e48edf99f
[Typography] Migrate from FontScheme to TypographyScheming (#3219)
* Migrate to Font Scheme

* Add support for iOS 8.0-8.1

* Update Themers and Tests

* Font -> Typography

* Rebase

* Update BUILD

* Cleanup

* Update naming, add docs

* Fix BUILD target

* Add Typography Dependency

* BUILD updates

* BUILD fix

* Add tests

* Typography
2018-04-04 23:47:49 -04:00
Robert Moore
8e8d6f263b
Revert "[FeatureHighlight] FeatureHighlightViewController should expose FeatureHighlightView as a property. (#3145)" (#3231)
Many internal clients are breaking because of this API change. Instead, we
should follow the deprecation policy so clients can make a gradual migration
to the final API.

This reverts commit 24be789f57aedb732ceddecc36699f52875dc8d6.

Reopens #3144
2018-04-04 15:31:54 -04:00
Robert Moore
85ed8aed96 [FeatureHighlight] Copy block instead of assign (#3159)
Since blocks are allocated on the stack, they need to be copied before
being retained within properties to ensure they won't be overwritten.
2018-03-29 14:53:31 -04:00
Mohammad Cazi
24be789f57 [FeatureHighlight] FeatureHighlightViewController should expose FeatureHighlightView as a property. (#3145)
* 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.

* Feature Highlight Clean up.

* Update examples.

* make title and body font defaults a class property.
2018-03-27 13:26:51 -04:00
Robert Moore
61277455f1
Use safe selector access for color themers (#3126)
Many of our color themers are accessing optional properties without
first verifying that the color scheme responds to the selector.  This
can result in crashes. Instead, each optional property should be checked
for safety before being used.
2018-03-23 08:58:23 -04:00
Mohammad Cazi
fa6a2f67d6 [FeatureHighlight] Accessibility title and body mutator added to fix UIAppearance issue (#3043)
* Extracting Accessibility out of FeatureHighlightViewController to a mutator.
Tests added.
Example updated.

* Added the new folder to pod setting.

* Splitting Title and Body Mutators, added tests for case of nil color.

* extra lf.

* Options is now a variable that can be given to the mutator.

* Fixing unit test issues, Updating all examples.

* Fixing Build file.

* Fixing build file.

* build file fix

* extra pace in the build file

* Revert "extra pace in the build file"

This reverts commit 18195fc893da2bcef7f8ef21f20b9f016b6c6011.

* extra space.

* cleaning up based on PR feedback.

* call super on setup and teardown.

* has to include to folder.

* build file indentation and variable name fixes.

* added color test.

* Document the test

* Made single method for accessibility.

* removing option input from public API.

* improving tests and documentation.

* putting this change in a separate PR.
2018-03-13 12:14:43 -04:00
Robert Moore
0c97e585d5 [FeatureHighlight] Remove use of __typeof__ (#3018)
Instead of relying on the compiler to determine the pointer type,
explicit type references should be used.

Related to #3017
2018-02-28 14:13:55 -05:00
Mohammad Cazi
261828a056
[Warnings Fix] Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior. (#2933)
* Warning Fix: Block implicitly retains 'self'; explicitly mention 'self' to indicate this is intended behavior.

* 100 char limit.
2018-02-14 15:47:07 -05:00
ianegordon
5a05ff9f9b
[Typography] Add FontThemer & FontScheme to FeatureHighlight (#2760)
* [Typography] Add FontThemer & FontScheme to FeatureHighlight

* Add Themer Example

* Remove TODO

* Cleanup / Feedback

* Migrate to new type hierarchy
2018-01-10 23:35:36 -05:00
ianegordon
a903493eee
[FeatureHighlight] Fix crash in Dynamic Type handling (#2742) 2017-12-18 13:59:13 -05:00