20 Commits

Author SHA1 Message Date
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
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
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
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
2962b79503
exposing title and body font for FeatureHighlightViewController. (#3274) 2018-04-09 14:22:09 -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
featherless
52f0c766b0 [FeatureHighlight] Minor fix of comment block notation. (#2503) 2017-11-22 10:30:44 -05:00
Sam Morrison
add558db3e [FeatureHighlight] Dynamic type support (#1884)
* Use material font styles instead of explicitly referencing fonts

* Observe UIContentSizeCategoryDidChangeNotification
2017-08-24 11:45:07 -04:00
Adrian Secord
0abca36dbb [Docs] Replaced internal site references with public equivalents. (#1616)
* Replaced internal site references with public equivalents.

* Updated spec link to material.io.
2017-07-10 16:35:35 -04:00
Sam Morrison
a43472d249 [Feature Highlight] Expose title and body color properties (#1496)
* [Feature Highlight] Expose title and body color properties

* Fix feature highlight warnings

* Feature Highlight public header nullability
2017-06-12 17:11:13 -04:00
Junius Gunaratne
127b60710e Revert "Make MDCFeatureHighlightView public and prepare color properties for UIAppearance (#1410)" (#1419)
This reverts commit 5fa6b89e612acc7c659aaba689445e63d641ca10.
2017-05-10 14:25:32 -04:00
Junius Gunaratne
5fa6b89e61 Make MDCFeatureHighlightView public and prepare color properties for UIAppearance (#1410)
* Make MDCFeatureHighlightView public and update color setters for use with UIAppearance

* Change featureHighlightView to nonnull, fix formatting

* Update comment
2017-05-09 16:30:30 -04:00
Adrian Secord
8bcb19781c More SwiftLint fixes for unit tests and example apps. (#1154)
* ClangFormat changes.

* Added swiftlint to scripts/format_all.`

* Fix scripts/lint_all to work from any directory.

* Fixed swiftlint invocation.

* Remove the checks for force casting (! operator).

* Some fixes.

* More Swift fixes.
2017-01-11 13:27:57 -05:00
Sam Morrison
771496f6c6 [Feature highlight] Dynamically size inner highlight (#1151)
* Use instance based inner radius

* Warning re ios sim

* Scale outer highlight to encircle inner highlight

* Dont scale innerhighlight pulsing with inner highlight size

* Reset highlight example supplemental:
2017-01-10 18:31:43 -05:00
Adrian Secord
7ba66bf09c Formatted all Objective-C sources with clang-format. (#1133) 2017-01-05 10:17:24 -05:00
Sam Morrison
d4806473e4 MDCFeatureHighlightViewController implementation (#765)
* API Review for Feature Highlight component

Summary:
This is the proposed API for the Feature Highlight component.

For more info see the following links:
Design spec: https://material.googleplex.com/growth-communications/feature-discovery.html#feature-discovery-design
Tracking bug: b/30695049

Example usage
```
MDCFeatureHighlightViewController *vc = [[MDCFeatureHighlightViewController alloc] init];
vc.delegate = self;
vc.hintTitleText = @"...";
vc.hintBodyText = @"...";
[vc highlightView:_button];
[self presentViewController:vc animated:animated completion:completion];
```
In the delegate:
```
- (void)featureHighlightWasAccepted:(MDCFeatureHighlightViewController *)highlight {
  // do accepted things here
  [self dismissViewControllerAnimated:YES completion:nil];
}
- (void)featureHighlightWasIgnored:(MDCFeatureHighlightViewController *)highlight {
  // do ignored things here
  [self dismissViewControllerAnimated:YES completion:nil];
}
```

Reviewers: ajsecord, featherless, iangordon, O1 Material components iOS, randallli

Reviewed By: ajsecord, featherless, iangordon

Subscribers: randallli, iangordon, featherless, ajsecord

Tags: #material_components_ios

Differential Revision: http://codereview.cc/D1465

* Add MDCFeatureHighlightViewController

* Add Feature Highlight typical use

* Get Feature Highlight buildable

* Copy functionality over from prototype

* Accept/Reject highlight with animation

* Rotation

* Tap anywhere in the feature highlight typical use case demo to move the button

* Align highlight center and highlight point

* Layout text correctly

* Use sample text

* Use animated transitioning delegate for presentation and dismissal animations

* Clean up presentation + dismissal animation code

* Move intructional text behind button

* Limit width of text in feature highlight

* Layout text relative to center when noncentered

* Fix rotation

* First pass at feature highlight color example

* Properly map the inner and outer colors to the view

* Use correct license header

* Automatically choose text color based on outer highlight color

* Clean up color usage

* wrap long lines

* Clean up title positioning

* Clean up radius calculation

* Constize values

* Add feature highlight nav bar example

* Move examples up a directory

* Remove nav bar example

* Improve outer highlight color docs and implementation

* Add TODO: Mask the labels during the presentation and dismissal animations.

* Clean up feature highlight view

* Clean up feature highlight examples

* Layout feature highlight labels with support for RTL

* Code review improvements

* Clean up feature highlight samples

* Feature Highlight readme

* Update Podfile.lock for Feature Highlight

* Feature highlight readme improvements
2016-10-28 10:44:31 -04:00