65 Commits

Author SHA1 Message Date
Wenyu Zhang
b457b13005 Internal change.
PiperOrigin-RevId: 417635153
2021-12-21 09:32:05 -08:00
Alyssa Weiss
1b69273926 Delete MDCTypography font opacities.
PiperOrigin-RevId: 394494448
2021-09-02 10:44:20 -07:00
Alyssa Weiss
38740c1a6c Remove mdc_adjustsFontForContentSizeCategory and mdc_UseLegacyFontScaling from FeatureHighlight
PiperOrigin-RevId: 373787626
2021-05-14 07:57:18 -07:00
Jeff Verkoeyen
4c86b139e4 Optimizing imports
PiperOrigin-RevId: 357185900
2021-02-12 07:35:17 -08:00
Jeff Verkoeyen
29803522c6 Optimizing imports
PiperOrigin-RevId: 357185525
2021-02-12 07:27:05 -08:00
Jeff Verkoeyen
fbb1f20aa2 Internal change
PiperOrigin-RevId: 332151481
2020-09-16 21:01:21 -07:00
Bryan Oltman
180a5bf724 [FeatureHighlight] Delete deprecated FeatureHighlightAccessibilityMutator.
PiperOrigin-RevId: 322445386
2020-07-21 14:42:20 -07:00
Jeff Verkoeyen
92254ea119 Rename all icons to an ic_<#name#> convention.
PiperOrigin-RevId: 308232277
2020-04-24 04:33:51 -07:00
Cody Weaver
fdf87c5995 [MDC/ColorScheme] Remove usage of init within MDC.
We recommend using `initWithDefaults` and we should follow the recommendation. This change removes all usage of `init` within MDC components in order to let us remove that initializer from the public surface.

PiperOrigin-RevId: 302958447
2020-03-25 13:36:51 -07:00
Andrew Overton
0f9e889b7d
[FeatureHighlight] Don't use MDCFeatureHighlightTypographyThemer in examples (#9224)
Related to #9208
2019-12-10 11:19:45 -05:00
Robert Moore
8eb7296dab
[Catalog] Fix container scheme properties. (#9192)
Making remaining examples use protocol for container schemes to match the
project's expected convention.

Found while reviewing #9188
2019-12-09 10:48:25 -05:00
Yarden Eitan
db709613cc
[FeatureHighlight] Positions label not hidden behind nav bar. (#8969)
Now label can be seen and voiceover will focus on it in the right order.

Closes #8888 

Before:

![Simulator Screen Shot - iPhone 7 - 2019-11-15 at 14 53 43](https://user-images.githubusercontent.com/4066863/68971687-18393280-07b8-11ea-9b1c-b8139f2946b2.png)


After:

![Simulator Screen Shot - iPhone 7 - 2019-11-15 at 14 53 34](https://user-images.githubusercontent.com/4066863/68971698-1b342300-07b8-11ea-8bca-962f50a31e6d.png)
2019-11-15 15:35:15 -05:00
Robert Moore
8e9eff85f8
[FeatureHighlight] Make "Color" example accessible. (#8957)
Includes the following changes:
1.  Each cell is an accessibility element with the color name as the label.
2.  Shown Feature Highlights no longer include the "double-tap to dismiss"
    hint.

|Before|After|
|---|---|
|![IMG_0099](https://user-images.githubusercontent.com/1753199/68967680-c344ee80-07ae-11ea-8b97-43a0045ffc53.PNG)|![IMG_0098](https://user-images.githubusercontent.com/1753199/68967657-b4f6d280-07ae-11ea-828f-4976f05ce862.PNG)|


Closes #8889
2019-11-15 15:23:08 -05:00
Yarden Eitan
efe61588a6
update (#7246)
We need to add @objc annotations to colorScheme and typographyScheme instances in our Swift examples, because we moved to Swift 4.2, the respondsToSelector won't find `setColorScheme:` and `setTypographyScheme:` setters otherwise.
2019-04-23 10:21:14 -04:00
Andrew Overton
c56d5d76d3
Add @objc annotations to get examples to show up in Dragons (#7168)
This is a follow up PR for #7166 adds @objc annotations to Swift catalogMetadata() methods, because the Swift 4 compiler no longer attempts to infer what methods should be visible to Objective-C. As a result of this change in the compiler, no Swift examples were showing up in Dragons after #7166. See this article: https://useyourloaf.com/blog/objc-warnings-upgrading-to-swift-4/ for additional context.
2019-04-17 21:35:43 -04:00
Andrew Overton
b38372192f
Update to Swift 4.2 (#7166)
This PR updates the Swift version to 4.2.

Partially resolves #6874.
2019-04-17 16:59:02 -04: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
Cody Weaver
05807cfe1f
[FeatureHighlight] Add examples to BUILD file (#6340)
This change is the part of the move to add all examples to `BUILD` files, this additionally adds the missing imports in the `.swift` example.
Closes #6213
2019-01-16 09:43:10 -05:00
Wenyu Zhang
6267009748
[Buttons] Update secondary floating action button themer examples (#5922)
Update examples to use secondary floating button theming extension method instead of calling themer's class methods.

Related https://github.com/material-components/material-components-ios/issues/5844
2018-12-05 14:42:55 -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
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
Yarden Eitan
3480c50c67
updated to newest CbC standard (#4956)
Move to the new CbC standard released in CatalogByConvention v2.5.0. See PR: material-foundation/cocoapods-catalog-by-convention#27 for more info on the change.
2018-08-29 20:45:13 -04:00
Robert Moore
175942d9e0
[Catalog] Fix Swift example imports (#4780)
Many of our Swift examples are either missing imports or are importing all of
MaterialComponents. Both of these will cause failures during internal builds.
2018-08-14 13:26:37 -04:00
Cody Weaver
7e71bb0079
[FeatureHighlight] Add swift example (#4439)
Added a feature highlight swift example. Also, attempted to reproduce #3644 but found that the bug had already been resolved.
2018-06-26 14:52:08 -04:00
John Detloff
0c0ce4248e
Initialize default color and typography schemes in examples (#4200)
Ensure a default colorScheme and typographyScheme is initialized for examples.
2018-05-21 12:44:43 -04:00
Mohammad Cazi
f1b919ed5b [Catalog] Feature highlight should be triggered from a separate Button. (#3742)
* separating action and feature button.

* separate button to show the feature highlight.

* colors should not be catalog presentable.

* revert.

* removing redundant theming.

* custom view with no morphing.
2018-05-16 09:15:29 -07:00
Mohammad Cazi
8b4c293287
Color Should be a dragon example. (#3743)
https://github.com/material-components/material-components-ios/pull/3743
2018-05-07 14:46:17 -04:00
Mohammad Cazi
6e7ed439ce
[Catalog] FeatureHighlight should be themed according to global theming. (#3738)
* FeatureHighlight should be themed according to global theming.

* lf

https://github.com/material-components/material-components-ios/pull/3738
2018-05-04 15:49:33 -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
Mohammad Cazi
a291896f07
[Typography][Color] Make sure our examples only use the new Color/Typography APIs (#3489)
* Replacing ColorThemer and FontThemer with SemanticColorThemer and TypographyThemer.

* Headline 6 is being used for FeatureHighlights not Headline2  (example update).

* Removed Feature Highlight Themer example since it's redundant, no scheme color changes in Feature Highlight Examples.

https://github.com/material-components/material-components-ios/pull/3489
2018-04-26 12:54:57 -04:00
Yarden Eitan
7f7bc36202
[Catalog] Expose colorScheme + typographyScheme properties for all examples to use app wide theming (#3478)
Made colorScheme and typographyScheme properties in the class interfaces for all our examples.
Moved theming away from example inits and into viewDidLoad
Small update for slider example to allow it to grab the theming properly.
Related Pivotal: https://www.pivotaltracker.com/story/show/156616695
2018-04-25 15:15:17 -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
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
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
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
Yarden Eitan
29d760c7d6
Added isPresentable to catalog files, ported over ZShadow to dragons. (#2726) 2017-12-15 12:20:35 -05: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
Randall Li
b1ec22207f
Fixed float conversion build errors (#2602)
* Fixed float conversion build errors
Implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float')

Found by turning on warnings via: https://github.com/material-components/material-components-ios/pull/2480

* More Fixed float conversion build errors
Implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float')

Found by turning on warnings via: https://github.com/material-components/material-components-ios/pull/2480
2017-12-06 15:57:04 -05:00
Yurii Samsoniuk
2a96682230 Replace unnecessary imports with forward declarations (#2429)
* [Themes] Remove unnecessary imports.

* [TextFields] Remove unnecessary imports.

* [Typography] Do not use an umbrella header inside of a component.

* [Snackbar] Do not use self umbrella header.

* [ActivityIndicator] Do not use self umbrella header.

* [AppBar] Use umbrella headers.

* [AppBar] Remove self import header.

* [ButtonBar] Removed self umbrella header imports.

* [Buttons] Removed self umbrella header imports.

* [Collections] Update imports.

* [Dialogs] Moved import into an m file.

* [Collections] Fixed imports.

* [FeatureHighlight] Removed self umbrealla imports.

* [HeaderStackView] Reordered imports.

* [Ink] Replaced imports with forward declarations.

* [Slider] Replaced self umbrella import use.

* [Snackbar] Removed self umbrella header import.

* [Tabs] Changed math import. Replaced self umbrella header import.

* [Icons] Removed unnecessary imports.

* [Overlay] Replaced umbrella header import.

* [ShapeLibrary] Replace Shapes imports with an umbrella header.

* [Shapes] Replaced imports with forward declarations.

* [AppBar] Replace import with a forward declaration.

* [Examples] Updated imports.

* Fixed conflicting imports

* Added space between different import categories
2017-11-16 18:25:06 -05:00
Will Larche
3fc78fd868 [TextFields] Adding a doc: menu for styles (#2064)
* [TextFields] Beginning to update the docs to show the new controller styles.

* [TextFields] Correcting the name of a file.

* [TextFields] Adding content to controller styles doc.

* [TextFields] Images for the text field styles doc.

* [TextFields] Renaming styling doc.

* [TextFields] Moving doc images.

* [TextFields] Updating image ref paths.

* [TextFields] Text clarity in doc.

* [TextFields] Updated photo.

* [TextFields] Nits of grammar.

* [TextFields] Spelling correction.
2017-09-28 11:25:41 -04:00
Robert Moore
8940d77d6d [Catalog] Verify all examples provide CatalogByConvention methods (#1911)
All examples now have at least the required `+catalogBreadcrumbs` and `+catalogIsPrimaryDemo`.  All examples in the same breadcrumbs path have only one primary demo.  There should be only one `-catalogDescription` attached to the primary demo.

Closes #1897
2017-08-31 08:46:10 -04:00
Robert Moore
7c8778ed75 [FeatureHighlight] Shown views can receive taps (#1889)
Shown views with gesture recognizers or shown buttons with actions
should be able to receive taps while Feature Highlight is active.

Closes #1888
2017-08-24 18:06:09 -04:00