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
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
{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\]'
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
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.
```
* 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
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
* 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
* 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
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
* 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.
* 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.
* [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