Skip to content

Commit

Permalink
Merge branch 'release-candidate' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Moore committed Sep 24, 2019
2 parents 4b52e54 + 4f7cd7c commit 64d3238
Show file tree
Hide file tree
Showing 20 changed files with 37 additions and 111 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# 92.0.0

This major release removes the `mdc_adjustsFontForContentSizeCategory` API
from `MDCTypographyScheming`. It makes
`useCurrentContentSizeCategoryWhenApplied` required for all implementations.

## Breaking changes

Classes conforming to `MDCTypographyScheming` must now provide the API
`useCurrentContentSizeCategoryWhenApplied`. It was previously recommended that
it be bound to the value of `mdc_adjustsFontForContentSizeCategory`.

## Changes

## schemes/Typography

* [Replace `mdc_adjustsFontForContentSizeCategory` with (#8476)](https://github.com/material-components/material-components-ios/commit/fd3395b5297c9dd4e4aeb25c02dee6026720c962) (Robert Moore)

---

# 91.1.1

This patch release corrects initalization of AppBar and splits the typography scheme so the protocol can be
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponents.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ load 'scripts/generated/icons.rb'

Pod::Spec.new do |mdc|
mdc.name = "MaterialComponents"
mdc.version = "91.1.1"
mdc.version = "92.0.0"
mdc.authors = "The Material Components authors."
mdc.summary = "A collection of stand-alone production-ready UI libraries focused on design details."
mdc.homepage = "https://github.com/material-components/material-components-ios"
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsBeta.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |mdc|
mdc.name = "MaterialComponentsBeta"
mdc.version = "91.1.1"
mdc.version = "92.0.0"
mdc.authors = "The Material Components authors."
mdc.summary = "A collection of stand-alone alpha UI libraries that are not yet guaranteed to be ready for general production use. Use with caution."
mdc.homepage = "https://github.com/material-components/material-components-ios"
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsEarlGreyTests.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialComponentsEarlGreyTests"
s.version = "91.1.1"
s.version = "92.0.0"
s.authors = "The Material Components authors."
s.summary = "This spec is an aggregate of all the Material Components EarlGrey tests."
s.description = "This spec is made for use in the MDC Catalog."
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsExamples.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialComponentsExamples"
s.version = "91.1.1"
s.version = "92.0.0"
s.authors = "The Material Components authors."
s.summary = "This spec is an aggregate of all the Material Components examples."
s.description = "This spec is made for use in the MDC Catalog. Used in conjunction with CatalogByConvention we create our Material Catalog."
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponentsSnapshotTests.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ end

Pod::Spec.new do |s|
s.name = "MaterialComponentsSnapshotTests"
s.version = "91.1.1"
s.version = "92.0.0"
s.authors = "The Material Components authors."
s.summary = "This spec is an aggregate of all the Material Components snapshot tests."
s.homepage = "https://github.com/material-components/material-components-ios"
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
91.1.1
92.0.0
4 changes: 2 additions & 2 deletions catalog/MDCCatalog/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>91.1.1</string>
<string>92.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>91.1.1</string>
<string>92.0.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIAppFonts</key>
Expand Down
4 changes: 2 additions & 2 deletions catalog/MDCDragons/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>91.1.1</string>
<string>92.0.0</string>
<key>CFBundleVersion</key>
<string>91.1.1</string>
<string>92.0.0</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
2 changes: 1 addition & 1 deletion catalog/MaterialCatalog/MaterialCatalog.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialCatalog"
s.version = "91.1.1"
s.version = "92.0.0"
s.summary = "Helper Objective-C classes for the MDC catalog."
s.description = "This spec is made for use in the MDC Catalog."
s.homepage = "https://github.com/material-components/material-components-ios"
Expand Down
10 changes: 1 addition & 9 deletions components/Banner/src/Theming/MDCBannerView+MaterialTheming.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,8 @@ - (void)applyThemeWithColorScheme:(id<MDCColorScheming>)colorScheme {

- (void)applyThemeWithTypographyScheme:(id<MDCTypographyScheming>)typographyScheme {
UIFont *textFont = typographyScheme.body2;
BOOL useCurrentContentSizeCategoryWhenApplied = NO;
if ([typographyScheme respondsToSelector:@selector(useCurrentContentSizeCategoryWhenApplied)]) {
useCurrentContentSizeCategoryWhenApplied =
typographyScheme.useCurrentContentSizeCategoryWhenApplied;
} else {
useCurrentContentSizeCategoryWhenApplied =
typographyScheme.mdc_adjustsFontForContentSizeCategory;
}

if (useCurrentContentSizeCategoryWhenApplied) {
if (typographyScheme.useCurrentContentSizeCategoryWhenApplied) {
textFont = [textFont mdc_scaledFontForTraitEnvironment:self];
}
self.textView.font = textFont;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,8 @@ @implementation MDCChipViewTypographyThemer
+ (void)applyTypographyScheme:(nonnull id<MDCTypographyScheming>)typographyScheme
toChipView:(nonnull MDCChipView *)chipView {
UIFont *titleFont = typographyScheme.body2;
BOOL useCurrentContentSizeCategoryWhenApplied = NO;
if ([typographyScheme respondsToSelector:@selector(useCurrentContentSizeCategoryWhenApplied)]) {
useCurrentContentSizeCategoryWhenApplied =
typographyScheme.useCurrentContentSizeCategoryWhenApplied;
} else {
useCurrentContentSizeCategoryWhenApplied =
typographyScheme.mdc_adjustsFontForContentSizeCategory;
}

if (useCurrentContentSizeCategoryWhenApplied) {
if (typographyScheme.useCurrentContentSizeCategoryWhenApplied) {
titleFont = [titleFont mdc_scaledFontForTraitEnvironment:chipView];
}
chipView.titleFont = titleFont;
Expand Down
10 changes: 0 additions & 10 deletions components/Chips/tests/unit/ChipViewTypographyThemerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ @interface ChipViewTypographyThemerTests : XCTestCase

@implementation ChipViewTypographyThemerTests

- (void)testFontThemerWithNoDynamicTypeSupport {
MDCChipView *chip = [[MDCChipView alloc] init];
MDCTypographyScheme *typographyScheme = [[MDCTypographyScheme alloc] init];
typographyScheme.mdc_adjustsFontForContentSizeCategory = NO;

[MDCChipViewTypographyThemer applyTypographyScheme:typographyScheme toChipView:chip];

XCTAssertEqualObjects(chip.titleLabel.font, typographyScheme.body2);
}

- (void)testFontThemerWhenCurrentContentSizeCategoryIsUsed {
if (@available(iOS 10.0, *)) {
// Given
Expand Down
2 changes: 1 addition & 1 deletion components/LibraryInfo/src/MDCLibraryInfo.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// This string is updated automatically as a part of the release process and should not be edited
// manually. Do not rename this constant or change the formatting without updating the release
// scripts.
static NSString const *MDCLibraryInfoVersionString = @"91.1.1";
static NSString const *MDCLibraryInfoVersionString = @"92.0.0";

@implementation MDCLibraryInfo

Expand Down
2 changes: 1 addition & 1 deletion components/LibraryInfo/tests/unit/LibraryInfoTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ - (void)testVersionFormat {
// Given

// This regex pattern does the following:
// Accept: "91.1.1", etc.
// Accept: "92.0.0", etc.
// Reject: "0.0.0", "1.2", "1", "-1.2.3", "Hi, I'm a version 1.2.3", "1.2.3 is my version", etc.
//
// Note the major version must be >= 1 since "0.0.0" is used as the version when something goes
Expand Down
11 changes: 1 addition & 10 deletions components/List/src/TypographyThemer/MDCListTypographyThemer.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,7 @@ + (void)applyTypographyScheme:(id<MDCTypographyScheming>)typographyScheme
UIFont *titleFont = typographyScheme.subtitle1;
UIFont *detailFont = typographyScheme.body2;

BOOL useCurrentContentSizeCategoryWhenApplied = NO;
if ([typographyScheme respondsToSelector:@selector(useCurrentContentSizeCategoryWhenApplied)]) {
useCurrentContentSizeCategoryWhenApplied =
typographyScheme.useCurrentContentSizeCategoryWhenApplied;
} else {
useCurrentContentSizeCategoryWhenApplied =
typographyScheme.mdc_adjustsFontForContentSizeCategory;
}

if (useCurrentContentSizeCategoryWhenApplied) {
if (typographyScheme.useCurrentContentSizeCategoryWhenApplied) {
titleFont = [titleFont mdc_scaledFontForTraitEnvironment:cell];
detailFont = [detailFont mdc_scaledFontForTraitEnvironment:cell];
}
Expand Down
12 changes: 0 additions & 12 deletions components/schemes/Typography/src/MDCTypographyScheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,3 @@ typedef NS_ENUM(NSInteger, MDCTypographySchemeDefaults) {
- (nonnull instancetype)initWithDefaults:(MDCTypographySchemeDefaults)defaults;

@end

@interface MDCTypographyScheme (ToBeDeprecated)

/**
@warning Will eventually be deprecated and removed. Please use
useCurrentContentSizeCategoryWhenApplied instead.
Modifying this property will also modify useCurrentContentSizeCategoryWhenApplied, and vice-versa.
*/
@property(nonatomic, assign, readwrite) BOOL mdc_adjustsFontForContentSizeCategory;

@end
22 changes: 0 additions & 22 deletions components/schemes/Typography/src/MDCTypographyScheming.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,34 +85,12 @@
*/
@property(nonatomic, nonnull, readonly, copy) UIFont *overline;

/**
Whether user interface elements should automatically resize based on the device's setting.
This can be used by client to communicate whether they support dynamic type to both our theming
functionality and embedded frameworks that also render UI.
@warning This API will eventually be deprecated. Please use
@c useCurrentContentSizeCategoryWhenApplied instead.
@note The value of @c useCurrentContentSizeCategoryWhenApplied (if implemented) and @c
mdc_adjustsFontForContentSizeCategory must always be the same.
*/
@property(nonatomic, readonly) BOOL mdc_adjustsFontForContentSizeCategory __deprecated_msg(
"Use useCurrentContentSizeCategoryWhenApplied instead.");

@optional

/**
A hint for how fonts in this scheme should be applied to components in relation to Dynamic Type.
If this flag is enabled and the typography scheme's font is scalable with Dynamic Type, then fonts
should be adjusted for the current Dynamic Type content size category prior to being assigned to
the component.
@note This flag will become required in the future as a replacement for
@c mdc_adjustsFontForContentSizeCategory. The value of this flag needs to be the same as @c
mdc_adjustsFontForContentSizeCategory.
*/
@property(nonatomic, assign, readonly) BOOL useCurrentContentSizeCategoryWhenApplied;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,29 +167,4 @@ - (void)testTypographyScheme201902UseCurrentContentSizeCategoryWhenAppliedIsDisa
XCTAssertFalse(scheme.useCurrentContentSizeCategoryWhenApplied);
}

- (void)
testMdc_adjustsFontForContentSizeCategoryIsMappedToUseCurrentContentSizeCategoryWhenApplied {
// Given
MDCTypographyScheme *scheme =
[[MDCTypographyScheme alloc] initWithDefaults:MDCTypographySchemeDefaultsMaterial201804];

// When
scheme.mdc_adjustsFontForContentSizeCategory = YES;

// Then
XCTAssertTrue(scheme.useCurrentContentSizeCategoryWhenApplied);

// When
scheme.mdc_adjustsFontForContentSizeCategory = NO;

// Then
XCTAssertFalse(scheme.useCurrentContentSizeCategoryWhenApplied);

// When (just in case the initial "truth" equality was a coincidence)
scheme.mdc_adjustsFontForContentSizeCategory = YES;

// Then
XCTAssertTrue(scheme.useCurrentContentSizeCategoryWhenApplied);
}

@end
2 changes: 1 addition & 1 deletion demos/supplemental/RemoteImageServiceForMDCDemos.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RemoteImageServiceForMDCDemos"
s.version = "91.1.1"
s.version = "92.0.0"
s.summary = "A helper image class for the MDC demos."
s.description = "This spec is made for use in the MDC demos. It gets images via url."
s.homepage = "https://github.com/material-components/material-components-ios"
Expand Down

0 comments on commit 64d3238

Please sign in to comment.