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
yarneo committed May 7, 2019
2 parents c406196 + c9b0881 commit e98ef9c
Show file tree
Hide file tree
Showing 30 changed files with 54 additions and 43 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,15 @@
# 84.1.1

This patch release fixes ActionSheet to lay out its content correctly when there is a safe area present, for iOS 11 and newer.

## Changes

### ActionSheet

* [Have content positioned based on the layout margins of the container. (#7331)](https://github.com/material-components/material-components-ios/commit/87366d1f7b558d9547d1afceb8253b4386ce5f0e) (Yarden Eitan)

---

# 84.1.0

This minor release adds enhancements to PageControl and Ink, bug fixes for FlexibleHeader, Ink, NavigationBar, and Ripple, and additional test coverage for ActionSheet and NavigationBar.
Expand Down
2 changes: 1 addition & 1 deletion MaterialComponents.podspec
Expand Up @@ -2,7 +2,7 @@ load 'scripts/generated/icons.rb'

Pod::Spec.new do |mdc|
mdc.name = "MaterialComponents"
mdc.version = "84.1.0"
mdc.version = "84.1.1"
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
@@ -1,6 +1,6 @@
Pod::Spec.new do |mdc|
mdc.name = "MaterialComponentsBeta"
mdc.version = "84.1.0"
mdc.version = "84.1.1"
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
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialComponentsEarlGreyTests"
s.version = "84.1.0"
s.version = "84.1.1"
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
Expand Up @@ -15,7 +15,7 @@ experimental_resources = [

Pod::Spec.new do |s|
s.name = "MaterialComponentsExamples"
s.version = "84.1.0"
s.version = "84.1.1"
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
Expand Up @@ -53,7 +53,7 @@ end

Pod::Spec.new do |s|
s.name = "MaterialComponentsSnapshotTests"
s.version = "84.1.0"
s.version = "84.1.1"
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
@@ -1 +1 @@
84.1.0
84.1.1
4 changes: 2 additions & 2 deletions catalog/MDCCatalog/Info.plist
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>84.1.0</string>
<string>84.1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>84.1.0</string>
<string>84.1.1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIAppFonts</key>
Expand Down
4 changes: 2 additions & 2 deletions catalog/MDCDragons/Info.plist
Expand Up @@ -15,9 +15,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>84.1.0</string>
<string>84.1.1</string>
<key>CFBundleVersion</key>
<string>84.1.0</string>
<string>84.1.1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
Expand Down
2 changes: 1 addition & 1 deletion catalog/MaterialCatalog/MaterialCatalog.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MaterialCatalog"
s.version = "84.1.0"
s.version = "84.1.1"
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
5 changes: 5 additions & 0 deletions components/ActionSheet/src/MDCActionSheetController.m
Expand Up @@ -141,6 +141,11 @@ - (void)viewDidLoad {

self.view.backgroundColor = self.backgroundColor;
self.tableView.frame = self.view.bounds;
self.view.preservesSuperviewLayoutMargins = YES;
if (@available(iOS 11.0, *)) {
self.view.insetsLayoutMarginsFromSafeArea = NO;
self.tableView.insetsLayoutMarginsFromSafeArea = NO;
}
[self.view addSubview:self.tableView];
[self.view addSubview:self.header];
}
Expand Down
16 changes: 6 additions & 10 deletions components/ActionSheet/src/private/MDCActionSheetHeaderView.m
Expand Up @@ -20,9 +20,9 @@
static const CGFloat kTitleLabelAlpha = (CGFloat)0.87;
static const CGFloat kMessageLabelAlpha = (CGFloat)0.6;
static const CGFloat kMessageOnlyPadding = 23;
static const CGFloat kLeadingPadding = 16;
static const CGFloat kLeadingPadding = 0;
static const CGFloat kTopStandardPadding = 16;
static const CGFloat kTrailingPadding = 16;
static const CGFloat kTrailingPadding = 0;
static const CGFloat kTitleOnlyPadding = 18;
static const CGFloat kMiddlePadding = 8;

Expand All @@ -38,6 +38,7 @@ @implementation MDCActionSheetHeaderView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
self.preservesSuperviewLayoutMargins = YES;
_titleLabel = [[UILabel alloc] initWithFrame:CGRectZero];
_messageLabel = [[UILabel alloc] initWithFrame:CGRectZero];
[self addSubview:_titleLabel];
Expand All @@ -63,7 +64,7 @@ - (void)layoutSubviews {

CGSize size = CGRectInfinite.size;
size.width = CGRectGetWidth(self.bounds);
CGRect labelFrame = [self frameWithSafeAreaInsets:self.bounds];
CGRect labelFrame = [self frameWithLayoutMargins:self.bounds];
labelFrame = CGRectStandardize(labelFrame);
labelFrame.size.width = labelFrame.size.width - kLeadingPadding - kTrailingPadding;
CGSize titleSize = [self.titleLabel sizeThatFits:labelFrame.size];
Expand Down Expand Up @@ -100,13 +101,8 @@ - (CGSize)sizeThatFits:(CGSize)size {
return contentSize;
}

- (CGRect)frameWithSafeAreaInsets:(CGRect)frame {
UIEdgeInsets safeAreaInsets = UIEdgeInsetsZero;
if (@available(iOS 11.0, *)) {
safeAreaInsets = self.safeAreaInsets;
safeAreaInsets.top = 0;
}
return UIEdgeInsetsInsetRect(frame, safeAreaInsets);
- (CGRect)frameWithLayoutMargins:(CGRect)frame {
return UIEdgeInsetsInsetRect(frame, self.layoutMargins);
}

- (void)setTitle:(NSString *)title {
Expand Down
Expand Up @@ -17,11 +17,11 @@
#import <MaterialComponents/MaterialTypography.h>

static const CGFloat kLabelAlpha = (CGFloat)0.87;
static const CGFloat kImageLeadingPadding = 16;
static const CGFloat kImageLeadingPadding = 8;
static const CGFloat kImageTopPadding = 16;
static const CGFloat kImageHeightAndWidth = 24;
static const CGFloat kTitleLeadingPadding = 72;
static const CGFloat kTitleTrailingPadding = 16;
static const CGFloat kTitleLeadingPadding = 64;
static const CGFloat kTitleTrailingPadding = 8;
static const CGFloat kActionItemTitleVerticalPadding = 18;

@interface MDCActionSheetItemTableViewCell ()
Expand All @@ -33,7 +33,7 @@ @interface MDCActionSheetItemTableViewCell ()
@implementation MDCActionSheetItemTableViewCell {
MDCActionSheetAction *_itemAction;
NSLayoutConstraint *_titleLeadingConstraint;
NSLayoutConstraint *_titleWidthConstraint;
NSLayoutConstraint *_titleTrailingConstraint;
}

@synthesize mdc_adjustsFontForContentSizeCategory = _mdc_adjustsFontForContentSizeCategory;
Expand Down Expand Up @@ -82,22 +82,21 @@ - (void)commonMDCActionSheetItemViewInit {
constant:-kActionItemTitleVerticalPadding]
.active = YES;
_titleLeadingConstraint = [NSLayoutConstraint constraintWithItem:_actionLabel
attribute:NSLayoutAttributeLeading
attribute:NSLayoutAttributeLeadingMargin
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeLeading
attribute:NSLayoutAttributeLeadingMargin
multiplier:1
constant:leadingConstant];
_titleLeadingConstraint.active = YES;
CGFloat width = CGRectGetWidth(self.contentView.frame) - leadingConstant - kTitleTrailingPadding;
_titleWidthConstraint = [NSLayoutConstraint constraintWithItem:_actionLabel
attribute:NSLayoutAttributeWidth
relatedBy:NSLayoutRelationEqual
toItem:nil
attribute:NSLayoutAttributeNotAnAttribute
multiplier:1
constant:width];
_titleWidthConstraint.active = YES;
_titleTrailingConstraint = [NSLayoutConstraint constraintWithItem:self.contentView
attribute:NSLayoutAttributeTrailingMargin
relatedBy:NSLayoutRelationEqual
toItem:_actionLabel
attribute:NSLayoutAttributeTrailingMargin
multiplier:1
constant:kTitleTrailingPadding];
_titleTrailingConstraint.active = YES;
if (!_inkTouchController) {
_inkTouchController = [[MDCInkTouchController alloc] initWithView:self];
[_inkTouchController addInkView];
Expand All @@ -115,10 +114,10 @@ - (void)commonMDCActionSheetItemViewInit {
constant:kImageTopPadding]
.active = YES;
[NSLayoutConstraint constraintWithItem:_actionImageView
attribute:NSLayoutAttributeLeading
attribute:NSLayoutAttributeLeadingMargin
relatedBy:NSLayoutRelationEqual
toItem:self.contentView
attribute:NSLayoutAttributeLeading
attribute:NSLayoutAttributeLeadingMargin
multiplier:1
constant:kImageLeadingPadding]
.active = YES;
Expand Down Expand Up @@ -152,8 +151,7 @@ - (void)layoutSubviews {
leadingConstant = kImageLeadingPadding;
}
_titleLeadingConstraint.constant = leadingConstant;
CGFloat width = CGRectGetWidth(self.contentView.frame) - leadingConstant - kTitleTrailingPadding;
_titleWidthConstraint.constant = width;
_titleTrailingConstraint.constant = kTitleTrailingPadding;

self.actionImageView.image = [_itemAction.image imageWithRenderingMode:self.imageRenderingMode];
}
Expand Down
2 changes: 1 addition & 1 deletion components/LibraryInfo/src/MDCLibraryInfo.m
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 = @"84.1.0";
static NSString const *MDCLibraryInfoVersionString = @"84.1.1";

@implementation MDCLibraryInfo

Expand Down
2 changes: 1 addition & 1 deletion components/LibraryInfo/tests/unit/LibraryInfoTests.swift
Expand Up @@ -21,7 +21,7 @@ class LibraryInfoTests: XCTestCase {
// Given

// This regex pattern does the following:
// Accept: "84.1.0", etc.
// Accept: "84.1.1", 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
2 changes: 1 addition & 1 deletion demos/supplemental/RemoteImageServiceForMDCDemos.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RemoteImageServiceForMDCDemos"
s.version = "84.1.0"
s.version = "84.1.1"
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e98ef9c

Please sign in to comment.