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
galiak11 committed May 5, 2020
2 parents a625f33 + c257e6e commit 0daf0ec
Show file tree
Hide file tree
Showing 58 changed files with 817 additions and 212 deletions.
62 changes: 62 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
# 109.2.0

This minor release includes bug fixes and tests for ActionSheet, BottomAppBar, BottomSheet, Cards, Dialogs, FlexibleHeader, NavigationBar and TextFields.

## New features

New example snapshot tests added to Cards, Dialogs, FlexibleHeader and NavigationBar.

## Component changes

### ActionSheet

* [Add test showcasing how when an Action's image is set it does not update an ActionSheet.](https://github.com/material-components/material-components-ios/commit/d30de4507cf9dd80bd1cf487fa0d3f09cc931416) (Cody Weaver)
* [Support setting image later in lifecycle](https://github.com/material-components/material-components-ios/commit/b9822411b97730324dedca19492d895c68fc880a) (Cody Weaver)

### BottomAppBar

* [Have BottomAppBar respect safe area](https://github.com/material-components/material-components-ios/commit/9220d5b801487df51560e61327e8c47305c02bdf) (Andrew Overton)

### BottomSheet

* [Have the container sheet be laid out by the container view's bounds, not frame.](https://github.com/material-components/material-components-ios/commit/65b749fb56fc15fad14ff7f71c0fb432337ee033) (Yarden Eitan)
* [[BottomSheet]Set MDCSheetStateExtended for MDCBottomSheetController in its initializer.](https://github.com/material-components/material-components-ios/commit/c8ba09ff95259644b70481a90681de38d5d1e184) (Wenyu Zhang)

### Cards

* [Add example snapshot tests.](https://github.com/material-components/material-components-ios/commit/f4b7c8eb2cd04e2afe8437772c5f85b0b0aceb47) (Jeff Verkoeyen)

### Chips

* [Internal change](https://github.com/material-components/material-components-ios/commit/c3f17b143a0f710a3f88a90d82f0baf4ca761622) (Bryan Oltman)

### Collections

* [Internal change.](https://github.com/material-components/material-components-ios/commit/a866a00f778d73c44261327a86914e2ed73d40be) (Wenyu Zhang)

### Dialogs

* [Add example snapshot tests.](https://github.com/material-components/material-components-ios/commit/1920b96b2ab03f2ba2faf89b62396e71777b1303) (Jeff Verkoeyen)
* [Allow MDCAlertController to become first responder.](https://github.com/material-components/material-components-ios/commit/da54c6f67a28691ecb3962e963f36d50ec501358) (Wenyu Zhang)
* [Document icon image scaling condition](https://github.com/material-components/material-components-ios/commit/5b5156eab6bb4412ebef0f95b87c96308afb413b) (Galia Kaufman)
* [No public changes, just a test that reproduces the issue.](https://github.com/material-components/material-components-ios/commit/99d6facc5bd41455bb86e6246745be29b699d67d) (Iryna Berezan)

### FlexibleHeader

* [Add example snapshot tests.](https://github.com/material-components/material-components-ios/commit/4a22863ca074ee5c5d1db7d7cd3e909e9feaf6ec) (Jeff Verkoeyen)

### NavigationBar

* [Add example snapshot tests.](https://github.com/material-components/material-components-ios/commit/9e3ab8703b8d7f2f124ceb90e9ceb01d7a60be99) (Jeff Verkoeyen)

### TextFields

* [Add borderRadius property](https://github.com/material-components/material-components-ios/commit/fb10ae1b1fc70a689949ac5e46e72a54751116c5) (Jonathan Willing)
* [Internal change.](https://github.com/material-components/material-components-ios/commit/81bd1dd07f3029dd7850fdfa299a58e06216b109) (Wenyu Zhang)

## Multi-component changes

* [Replace App Bar docs](https://github.com/material-components/material-components-ios/commit/7814b0c4600ac42504521d02178bcbaea79cbbe4) (Andrew Overton)

---

# 109.1.0

This minor release includes new examples for Dialogs, and bug fixes BottomSheet, Chips, and
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 = "109.1.0"
mdc.version = "109.2.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 = "109.1.0"
mdc.version = "109.2.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 = "109.1.0"
s.version = "109.2.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 = "109.1.0"
s.version = "109.2.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 = "109.1.0"
s.version = "109.2.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 @@
109.1.0
109.2.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>109.1.0</string>
<string>109.2.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>109.1.0</string>
<string>109.2.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>109.1.0</string>
<string>109.2.0</string>
<key>CFBundleVersion</key>
<string>109.1.0</string>
<string>109.2.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 = "109.1.0"
s.version = "109.2.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
2 changes: 1 addition & 1 deletion components/ActionSheet/src/MDCActionSheetAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ typedef void (^MDCActionSheetHandler)(MDCActionSheetAction *_Nonnull action);
Action sheet actions must have an image that will be set within actionWithTitle:image:handler:
method.
*/
@property(nonatomic, nullable, readonly) UIImage *image;
@property(nonatomic, nullable) UIImage *image;

/**
The @c accessibilityIdentifier for the view associated with this action.
Expand Down
63 changes: 47 additions & 16 deletions components/ActionSheet/src/MDCActionSheetController.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,41 @@
static const CGFloat kActionTextAlpha = (CGFloat)0.87;
static const CGFloat kDividerDefaultAlpha = (CGFloat)0.12;

@interface MDCActionSheetController () <MDCBottomSheetPresentationControllerDelegate,
UITableViewDelegate,
UITableViewDataSource>
@property(nonatomic, strong) UITableView *tableView;
@property(nonatomic, strong) MDCActionSheetHeaderView *header;

/** The view that divides the header from the table. */
@property(nonatomic, strong, nonnull) UIView *headerDividerView;

/**
Determines if a @c MDCActionSheetItemTableViewCell should add leading padding or not.
@note Defaults to @c NO.
*/
@property(nonatomic, assign) BOOL addLeadingPaddingToCell;

/**
Reloads the tables data and does a layout pass.
*/
- (void)updateTable;

@end

@interface MDCActionSheetAction ()

@property(nonatomic, nullable, copy) MDCActionSheetHandler completionHandler;

/**
The @c MDCActionSheetController responsible for presenting the action.
@note This is only set when the @c MDCActionSheetController's view is in the heirarchy else it is
@c nil.
*/
@property(nonatomic, weak, nullable) MDCActionSheetController *actionSheet;

@end

@implementation MDCActionSheetAction
Expand Down Expand Up @@ -67,23 +98,13 @@ - (id)copyWithZone:(__unused NSZone *)zone {
return action;
}

@end

@interface MDCActionSheetController () <MDCBottomSheetPresentationControllerDelegate,
UITableViewDelegate,
UITableViewDataSource>
@property(nonatomic, strong) UITableView *tableView;
@property(nonatomic, strong) MDCActionSheetHeaderView *header;

/** The view that divides the header from the table. */
@property(nonatomic, strong, nonnull) UIView *headerDividerView;

/**
Determines if a @c MDCActionSheetItemTableViewCell should add leading padding or not.
- (void)setImage:(UIImage *)image {
_image = image;
if (self.actionSheet) {
[self.actionSheet updateTable];
}
}

@note Defaults to @c NO.
*/
@property(nonatomic, assign) BOOL addLeadingPaddingToCell;
@end

@implementation MDCActionSheetController {
Expand Down Expand Up @@ -237,6 +258,10 @@ - (void)viewDidAppear:(BOOL)animated {
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];

for (MDCActionSheetAction *action in self.actions) {
action.actionSheet = self;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
self.mdc_bottomSheetPresentationController.delegate = self;
Expand All @@ -247,6 +272,12 @@ - (void)viewWillAppear:(BOOL)animated {
[self.view layoutIfNeeded];
}

- (void)viewDidDisappear:(BOOL)animated {
for (MDCActionSheetAction *action in self.actions) {
action.actionSheet = nil;
}
}

- (BOOL)accessibilityPerformEscape {
if (!self.dismissOnBackgroundTap) {
return NO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -771,4 +771,23 @@ - (void)testActionSheetWithHeaderShownButNoTitleOrMessage {
[self generateSnapshotAndVerifyForView:self.actionSheetController.view];
}

- (void)testActionSheetWhenActionImageIsSetAfterBeingSetAsAction {
// Given
self.actionSheetController = [MDCActionSheetController actionSheetControllerWithTitle:nil];
MDCActionSheetAction *action = [MDCActionSheetAction actionWithTitle:kShortTitle1Latin
image:nil
handler:nil];
[self.actionSheetController addAction:action];

// When
[self.actionSheetController.view setNeedsLayout];
[self.actionSheetController.view layoutIfNeeded];
[self.actionSheetController viewWillAppear:NO];
action.image = [UIImage mdc_testImageOfSize:CGSizeMake(24, 24)];
[self.actionSheetController.view layoutIfNeeded];

// Then
[self generateSnapshotAndVerifyForView:self.actionSheetController.view];
}

@end
Loading

0 comments on commit 0daf0ec

Please sign in to comment.