72 Commits

Author SHA1 Message Date
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
featherless
bbe4a23fe0
Remove all __IPHONE_11_0 checks now that we no longer support Xcode 8. (#4915)
We can now make use of @available throughout our codebase.

We support Xcode 9 and up, which includes the iOS 11 SDK. This means we can remove any guards for SDKs prior to iOS 11.

This was cleaned up by running a global find-and-replace with the following regular expression:

```
Find:#if defined\(__IPHONE_11_0\) && \(__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_11_0\)\n(.+if \(@available\(iOS 11.0, \*\)\) \{(?:.|\n)*?)(?:#else(?:.|\n)*?)?\n#endif
Replace:$1
```

With some additional cleanup for stragglers that didn't match this pattern. Note that else clauses were intentionally dropped.

Closes https://github.com/material-components/material-components-ios/issues/4909
2018-08-28 09:57:30 -04:00
Will Larche
53876c3dca
[Typography] 3rd PR on font equality (#4435)
* [TextFields] Adding todos for #4331

* [TextFields] Creating simple equality files.

* [TextFields] Prevents fonts that are almost the same but not quite from messing up the rendering.

* [Typography] Adding tests for font equality.

* [TextFields] Formatting.

* [Typography] Adding Math to the bazel file.

* [Typography] PR feedback.

* [Typography] PR feedback.

* [Typography] Comment.

* [Typography] PR feedback.

* [Typography] PR feedback.

* [Typography] Updating podspec.

* [Typography] Asserts for bazel.

* [Typography] Logging for tests.

* [Typography] Loggin.g

* [Typography] Removing logging and the deeper check.

* [Typography] Making simple equality a category.

* [TextFields] Using new method.
2018-06-26 11:45:13 -07:00
Yarden Eitan
7cf1050222 remove file that wasn't removed from revert 2018-06-07 11:23:19 -04:00
Yarden Eitan
45c6fba187 Revert "[TextFields] Prevents functionally equivalent fonts from causing rendering jumps (#4344)"
This reverts commit de44925eb609f1a06c6529fbd06ba7d5f80dcfa9.
2018-06-07 11:17:31 -04:00
Yarden Eitan
03de0e2359 add foundation import 2018-06-06 15:32:30 -04:00
Will Larche
de44925eb6
[TextFields] Prevents functionally equivalent fonts from causing rendering jumps (#4344)
* [TextFields] Adding todos for #4331

* [TextFields] Creating simple equality files.

* [TextFields] Prevents fonts that are almost the same but not quite from messing up the rendering.

* [Typography] Adding tests for font equality.

* [TextFields] Formatting.

* [Typography] Adding Math to the bazel file.

* [Typography] PR feedback.

* [Typography] PR feedback.

* [Typography] Comment.

* [Typography] PR feedback.

* [Typography] PR feedback.

* [Typography] Updating podspec.

* [Typography] Asserts for bazel.

* [Typography] Logging for tests.

* [Typography] Loggin.g

* [Typography] Removing logging and the deeper check.
2018-06-05 15:32:58 -04:00
featherless
fa155e0d17
[Typography] Add deprecation notice to the MDCTypography APIs and README (#3633)
This adds deprecation notices to the component's README.md and the individual APIs.

Pivotal story: https://www.pivotaltracker.com/story/show/157238605
2018-05-01 22:58:05 -04:00
Adrian Secord
72045ffd6d
[Docs] Updated known short link destination URLs to use short links. (#3575)
* Updated known shortlink destination URLs to use short links.

* Updated stray links in the CHANGELOG.md.

* Fixed FAB shortlink.

* Applied replacements to everything outside of components/.
2018-04-28 11:27:59 -04:00
Thomas-Redding-G
97465d22bb Support Dynamic Type in extensions for iOS >= 10. (#3127)
* Support Dynamic Type in extensions for iOS >= 10.

* Prevent compiler error in Xcode 8.

* Fixed compiler error.
2018-03-22 12:50:26 -04:00
Ian Gordon
74b0819a89 Silence internal warning 2018-01-10 18:42:38 -05:00
Yarden Eitan
3fe2bff374
[Podspec] Fix podspec warnings when issuing a lint (#2811)
* added supressing of partial-availability and changed image bit depth to remove podspec warnings on linting

* added code check
2018-01-08 11:45:11 -05:00
ianegordon
93e21f1483
[Typography] font initializer based on style and Dynamic Type (#2666) 2017-12-11 12:52:52 -05:00
ianegordon
4da22ef2a7
[Typography] Add standard (non-Dynamic Type) font convenience method (#2629)
[Typography] Add standard (non-Dynamic Type) font convenience methods
2017-12-07 15:47:17 -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
Adrian Secord
479f7b1141 Remove trailing whitespace everywhere. (#2168) 2017-10-13 11:33:35 -04:00
Sam Morrison
87cb35b13e Match MDCTypography docs with nullability annotations (#2117)
Closes #1244
2017-10-09 09:47:40 -04:00
Yurii Samsoniuk
edd0dbc1b9 [Typography] Match large font family on iOS 9+ (#1880)
* Use the same font family when loading fonts as iOS does by default.

Resolves #1805.

* Format test.

* Format test.

* Updated comment.
2017-08-23 16:14:01 -04:00
Robert Moore
a2968c6dec [Typography] Fixing nullability attributes for fonts (#1696)
* [Typography] Fixing nullability attributes for fonts

Some of our fonts are nullable but the API was incorrectly marked as
nonnull.  Correcting the API to match the actual nullability of the
returned objects

Closes #1694

* Fixing nil check when setting singleton font loader
2017-07-25 21:34:23 -04:00
Robert Moore
ebabb3385a [Fonts] Cache system fonts (#1689)
`[UIFont systemFontForSize:weight]` performs some kind of internal
caching (it returns the same pointers) but the performance is relatively
poor compared to an actual NSCache. Introducing a cache in the
MDCSystemFontLoader and clearing the cache whenever the Content Category
size changes (dynamic type notifications) even though we're not
currently using those fonts.

Performance is improved when scrolling MDCCollectionViewTextCells, which
retrieve the fonts in `prepareForReuse`.
2017-07-25 14:52:54 -04:00
Robert Moore
fa10d655d7 Remove uses of typeof and the ?: operator (#1601)
Make the code base more portable by replacing some GNU extension code
with C99-compatible versions.

* Replace shortcut ?: operator with explicit middle (true) terms
* Remove pointer inequality checks in conditionals
* (Cleanup) Change to #include for <tgmath.h> based on style guide

Closes #846
2017-07-11 17:39:45 -04:00
Randall Li
266a716f60 Fix imports to use umbrella imports (#1529)
* [ColorThemes] Use umbrella header instead of MDCColorScheme

* [Application] Use umbrella header instead of class header

* [Button] use umbrella header in private header

* [Typography] use umbrella header in private header

* icons using umbrella header in individual icon class

* [Icons] added header to umbrella header

* [collection] umbrella header instead of class header in test

* [Collections] use umbrella header in private header

* [ActivityIndicator] use umbrella header in private header

* [ButtonBar] use umbrella header in private header

* [Dialog] use umbrella header in private header

* [featurehighlight] use umbrella header in private header

* [snackbar] use umbrella header in private header

* [textFields] use umbrella header in private header

* [thumbtrack] use umbrella header in private header

* [Overlay] use umbrella header in private header

also removed spurious ’s’ at end of MaterialOverlay.h file

* [slider] use umbrella header in private header

* [buttonBar] use umbrella header in private header

* [slider] use umbrella header in test

* [Overlay] fixed overlay reference to use umbrella header
2017-06-19 15:57:48 -04:00
ianegordon
843675b374 [Typography] MDCPreferredFontForStyle now includes the system font family. (#1472)
* MDCPreferredFontForStyle now included the system font family.

* Update font array on size category change
2017-05-31 15:45:28 -04:00
randallli
9cae7fca7b Revert "Fix case-sensitive imports from private to Private. Causing compilation failures in Xcode 8.3.2 about non-portable path."
This reverts commit f21c482e742e1a14b9ae8d500eceaf8468997fd1.
2017-05-25 16:23:03 -04:00
randallli
f21c482e74 Fix case-sensitive imports from private to Private. Causing compilation failures in Xcode 8.3.2 about non-portable path.
PiperOrigin-RevId: 157139179
2017-05-25 15:34:16 -04:00
Scott Hyndman
4a011e75a5 [Docs] Docstravaganza (#1330)
* [Docs] Adds platform configuration for the doc site.

* [Docs] Adds path metadata for documentation site.

This field is used to determine where the file will appear in the
doc site.

* [Docs] Updates Material guideline links to latest URL.

material.google.com -> material.io/guidelines

* [Docs] Introduces a separate component index for the docsite.

* [Docs] Changes the directory used for site generation.

* [Docs] Moves documentation-site-only Markdown into its own directory.

* [Docs] Changes material.io links to use https.

* [Docs] Renames the howto and contributing docsite sections to docs.

* [Docs] Adds a navTitle field to the collection editing/styling pages.

* [Docs] Changes the FAQ heading to be one size bigger.

* [Docs] Changes the tutorial title.

* [Docs] Adds icons to three more components.

* [Docs] Introduces a root component directory called /catalog/.

* [Docs] Adds an icon to the AnimationTiming component.

* [Docs] Adds an icon for the typography component.

* [Docs] Reformats the docsite index.
2017-05-01 17:27:38 -04:00
Will Larche
d8a58feecd [All] Formatting. (#1329) 2017-04-18 18:10:02 -04:00
ianegordon
2bda2c118e [Typography] Workaround for medium system font on iOS 8 (#1292)
* [Typography] Workaround for medium system font on iOS 8

* Add issue number
2017-04-04 17:35:06 -04:00
Randall Li
bbfad4f894 [Typography] Added fallback logic for getting bold/italic fonts so that if there are no fonts then it returns the system bold/italic fonts. (#1277) 2017-03-24 15:27:24 -04:00
Will Larche
8c5350de31 [All] Formatting. (#1269) 2017-03-22 12:18:15 -04:00
Randall Li
7ddf3fb0c6 [Typography] added boldFontFromFont: and italicFontFormFont: (#1261) 2017-03-20 15:42:04 -04:00
Randall Li
5328641bff [Typography] Added strong dependency to MDFTextAccessiblity for fallbackack logic when isLargeForContrastRatios: is unspecified. (#1250)
* [Typography] Added strong dependency to MDFTextAccessiblity for fallback logic when isLargeForContrastRatios: is unspecified.

* copied logic out of MDFTextAccessibilty instead of depending on it.

* reverse cocoa pod 1.2.0

* fixed nullablilty and added comment
2017-03-14 21:58:14 -04:00
Randall Li
f922779b29 [Typography] added boldItalic font to optional protocol of the TypographyFontLoading protocol (#1252)
* [Typography] added boldItalic font to optional protocol of the TypographyFontLoading protocol

* revert cocoa pods version number

* fixed bold/regular variable name

* added comment for font size must be greater than  0
2017-03-14 19:03:58 -04:00
Ian Gordon
af8ca9ed1a Merge branch 'release-candidate' 2017-03-09 12:54:43 -05:00
Randall Li
9fa1bf999b [Typography] Make system font return medium and light versions of Helvetica instead of regularSystemFont. (#1246) 2017-03-09 12:53:24 -05:00
Ian Gordon
2e1f56390e Fix import directory 2017-03-09 05:12:43 -05:00
Adrian Secord
502136ba89 Remove unused header that causes circular dependency. (#1240)
(between Typography and Typography/private.)
2017-03-08 11:43:55 -05:00
Randall Li
36ca5ec407 [Typography] Added isLargeForContrastRatio to protocol (#1232)
* [Typography] Added isLargeForContrastRatio so that we can make the font tell us if it is has large fonts.

* lint

* added fuller doc

* fixed system font loader to return optional protocol method isLargeForContrastRatio

* removed class method

* moved bold and italic to be optional properties.

* Update MDCTypography.m

* added UIFontWeightMedium weak check.
2017-03-07 16:58:29 -05:00
Randall Li
6485223703 switch it to a objc test (#1226) 2017-03-01 10:28:45 -05:00
Randall Li
975680a9cb Added bold and italics to the system fontloader and MDCTypographyFontLoader protocol (#1225)
* Added bold and italics to the system fontloader and MDCTypographyFontLoader protocol

* added test for system font loader
2017-02-28 16:43:06 -05:00
ianegordon
9bea2218a6 [Typography] Add warning about custom fonts and Dynamic Type (#1224) 2017-02-27 15:35:41 -05:00
ianegordon
cee7266d2f [Typography] Silence warning (#1206) 2017-02-14 21:50:13 -05:00
randallli
10df6be438 [Typography] Added missing import for FontTextStyle 2017-02-10 13:39:51 -05:00
ianegordon
774d2f03a8 [Typography] Initial Material Text Style API (#1178)
* [Typography] Initial MDC Font Styles

* Add documentation and code cleanup.
* clang-format new code.
* Feedback
2017-01-30 12:18:00 -05:00
Randall Li
ab0f705a37 updated bare measurements. (#1063) 2016-12-14 11:57:15 -05:00
Randall Li
e02c983136 [Typography] Removed runtime check for MDCRoboto within typography. (#1055) 2016-12-14 11:12:21 -05:00
Adrian Secord
1e965bf573 Revert "[Typography] Removes the runtime inspection that uses Roboto if it can be found (via MDCRobotoFontLoader) (#713)"
Partial revert of only the implementation and unit test, not docs.

This reverts commit 6834ae3efc45a87933e6fb6cdfdc942c0ffbe509.
2016-12-13 14:24:37 -05:00
Randall Li
6834ae3efc [Typography] Removes the runtime inspection that uses Roboto if it can be found (via MDCRobotoFontLoader) (#713)
* [Typography] Removes the runtime inspection that uses Roboto if it can be found (via MDCRobotoFontLoader) (#712)

* [Typography] Removed runtime inspection for MDCRobotoFontLoader and using Roboto if found.

* corrected readme's

* [Typography] Removed runtime inspection for MDCRobotoFontLoader and using Roboto if found.

Summary:
Corrected readme's
Fixed tests

Reviewers: O1 Material components iOS!

Tags: #material_components_ios

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

* Switch to roboto in apppDel

* Removed default clause in Typography readme and added similar clause to RobotoFontLoader warning about font assets being added to your App

* sort imports for appdel

* fix app delegate imports

* removed roboto font loader form app del

* reorder swift objective c examples
2016-12-12 17:51:45 -05:00