20 Commits

Author SHA1 Message Date
Jeff Verkoeyen
39c20e15f8 Optimizing imports
PiperOrigin-RevId: 356967514
2021-02-11 07:17:45 -08:00
Bryan Oltman
180a5bf724 [FeatureHighlight] Delete deprecated FeatureHighlightAccessibilityMutator.
PiperOrigin-RevId: 322445386
2020-07-21 14:42:20 -07:00
Andrew Overton
0b2323ad42
Delete MDCFeatureHighlightTypographyThemer (#9273)
This PR deletes MDCFeatureHighlightTypographyThemer.

Closes #9208.
2019-12-16 09:52:51 -05:00
Robert Moore
36d950545f [FeatureHighlight] Fix accessibility tests. (#9018)
Pull request #8959 changed the accessibility behavior of Feature Highlight but
did not update the tests. Somehow the last commit in the PR failed CI tests,
but the PR itself was marked as passing.  This commit updates the unit tests
to reflect the latest behavioral expectations for accessibility.

Follow-up for #8961
2019-11-22 07:25:49 -05: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
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
Robert Moore
372d6b24f9
No longer using -init for Color Scheme. (#5734)
{MDC iOS} No longer using `-init` for Color Scheme.

Based on the discussions in go/mdc-ios-theming, we should not use the `-init` default initializer. Instead, we should use an explicit set of defaults.

Search regex: '\[\[MDCSemanticColorScheme alloc\] init\]'
2018-11-12 12:54:47 -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
675235ed05
{Tests} Deallocate test objects at the end of tests. (#5397)
Deallocating many of the properties created for each unit test. Since all
XCTestCase instances survive until the end of the test suite, any properties
created for a test will be preserved as well. This frees up around 3.7 MB
(~6%) of memory from the entire test suite, as measured on my desktop.

|Before|After|
|----|----|
|![test-objcs-before](https://user-images.githubusercontent.com/1753199/46813473-c3b9bd00-cd44-11e8-990c-28dff4ab5ad2.png)|![test-objcs-after](https://user-images.githubusercontent.com/1753199/46813481-c7e5da80-cd44-11e8-90e4-2e6d532ebbfb.png)|

See also: https://qualitycoding.org/xctestcase-teardown/

Closes #5395
2018-10-12 08:33:58 -04: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
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
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
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
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
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
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
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
ianegordon
fcf9712d32
[FeatureHighlight] Add custom font support (#2701)
* [FeatureHighlight] Add custom fonts

* Utilize MDCTypography if custom. Add sample.

* Remove extra method

* [FeatureHighlight] Add custom font tests

* Scale MDCTypography defaults if dynamic type is enabled

* Feedback
2017-12-14 08:46:56 -05:00
Robert Moore
89b098e308 [FeatureHighlight] Add BUILD file and no-op test (#2648)
* [FeatureHighlight] Add BUILD file and no-op test

A simple no-op test that just ensures that Bazel is building/running some of
the code in Feature Highlight.

* Fixing test name

* Removing unused package

* Fixing copyright
2017-12-08 18:13:32 -05:00