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.
Adds a new scheme that vends fonts with an associated scaling curve.
This is a BREAKING CHANGE due to a new, required property in the MDCTypographyScheming protocol.
To easily migrate, clients can add the following method to their custom implementations of MDCTypographyScheming.
- (BOOL)mdc_adjustsFontForContentSizeCategory {
return NO;
}
Next iteration of our Dynamic Type.
Mimics Apple's new APIs. (UIFontMetrics)
Adds MDCFontScalar to attach curves.
Adds UIFont category to expose fontScaledForCategory methods.
Adds new MDCTypographyScheme with scalable fonts.
Adds sample to demonstrate new curves.
### Context
By default, Objective-C code will only perform availability checks for iOS APIs introduced from iOS 11 and up. We can enable -Wunguarded-availability to turn on available checks for older SDKs.
Additional context for this behavior comes from [llvm](https://reviews.llvm.org/D34264);
> [This patch](https://reviews.llvm.org/D34264) adds a new warning flag called -Wunguarded-availability-new. If -Wunguarded-availability is off, this warning only warns about uses of APIs that have been introduced in macOS >= 10.13, iOS >= 11, watchOS >= 4 and tvOS >= 11. This warning is on by default. We decided to use this kind of solution as we didn't want to turn on -Wunguarded-availability by default, as we didn't want our users to get warnings about uses of old APIs in their existing projects.
### What's happening in this change
This change turns on -Wunguarded-availability. This has the effect of the compiler performing availability checks for all APIs at or above the current deployment target (iOS 8.0). As such, this PR addresses several instances of code that were not performing availability checks.
Going forward, we will be able to use availability to encode our supported SDKs into the APIs that we provide. For example, we could annotate MDCActivityIndicator with NS_AVAILABLE_IOS(9_0) and all of our code would then have to use runtime checks prior to using this API.
### Caveats
Because -Wunguarded-availability is not enabled by default in Objective-C, our clients will need to proactively enable this flag in order to be warned of any use of APIs that support OS versions < 11.0. We can mitigate this risk in two ways:
1. Clearly announce any changes in our supported OS versions.
2. Encourage clients to enable -Wunguarded-availability.
Our creativity knows no bounds.
### 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\.
*\*/
```
```
/\*
*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 ([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 ([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.
```
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.
```
* [Typography] Add TypographyScheme example
The new Typography Scheme as missing examples and the old Typography examples
did not have sufficient contrast ratios for AA-level accessible text.
Internal: b/77907063
* Reducing section divider opacity
* Added warnings to examples.
* fixed some warnings
* using button sender parameter.
* use button sender in example
* use button sender in example
* removed sender from methods that don’t use it.
* removed sender from methods that don’t use it.
* use button sender in example
* use button sender in example
* use button sender in example
* use button sender in example
* Fixed init of header configurator to use passed in parameter
* removed unused API
* use button sender in example
* Revert "Added warnings to examples."
This reverts commit 91f0480f86cb609c47b00f1346f82de67c31c4e9.
* fixed example: Using the view controllers navigationItem rather than creating a new one.
* removed finished checks from animation blocks in examples.
* reverted id sender checks
* revert id sender check for Flexible header UINavigationBar
* revert clug
* revert clug
* addressing nits
* removed sender check for FeatureHighlightTypicalUseView
* more nits
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
* 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.
* WIP
* WIP
* Simplified build script and fixed it to build all schemes.
* WIP
* Renamed script to build_all and added better output.
* Add scripts/list_xcode_workspaces.
* Filtered out the CocoaPods schemes.
* Use Xcode to update Swift to v3.
* Updated tracked touches map from NSNumber to Int.
* Fixed button sorting that was not actually sorting.
* targetContentOffset no longer allowed to be nil.
* "Fixed" failing test by reducing random number range?
* Swift 3 syntax change.
* Swift 3 syntax change.
* Removed invalid center-aligning tests.
Fixed default nav bar alignment test.
We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has...
Summary:
We can credit any contributor who would like to be credited this way, by adding them on request to the AUTHORS file. The copyright statement changes are required for this to work. Note that this has no legal change, since the contributors always retained their copyright despite the copyright notice, but it's a nice acknowledgement.
Changed copyright statement to include non-Google authors.
Command run:
find * \( -name '*\.m' -or -name '*\.h' -or -name '*\.swift' \) -and -not \( -path 'scripts/external*' -name Pods \) -print0 | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/'
Added non-source files.
Command run:
grep -Rl 'Copyright .* Google Inc' * --exclude-dir scripts/external --null | xargs -0 sed -i '' 's/Copyright \(.*\) Google Inc/Copyright \1 the Material Components for iOS authors/'
Reviewers: featherless, O1 Material components iOS, randallli
Reviewed By: O1 Material components iOS, randallli
Tags: #material_components_ios
Differential Revision: http://codereview.cc/D1415
Summary: "Material design" is not capitalized except when referring to the actual Material Design team at Google.
Reviewers: O1 Material components iOS, randallli
Reviewed By: O1 Material components iOS, randallli
Subscribers: randallli, featherless
Tags: #material_components_ios
Differential Revision: http://codereview.cc/D1306
Summary:
Breaking changes:
Typography Component will no longer depends on Roboto Font Loader Component.
Instructions on how to fix:
Depend on Roboto Font Loader directly if you need to use it.
Reviewers: ajsecord, #mdc_ios_owners
Reviewed By: ajsecord, #mdc_ios_owners
Subscribers: lpromero, featherless
Projects: #material_components_ios
Differential Revision: http://codereview.cc/D459