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
Jeff Verkoeyen committed Jan 27, 2020
2 parents e5005ca + 8fa9bdb commit 459b7ab
Show file tree
Hide file tree
Showing 178 changed files with 1,595 additions and 390 deletions.
77 changes: 77 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,80 @@
# 103.1.0

This minor release introduces iOS 13 support for BottomNavigation, divider customization for ActionSheet actions, and several bug fixes.

## New features

### ActionSheet

MDCActionSheetAction has two new APIs, `dividerColor` and `showsDivider`. These APIs can be used to show a divider above the action.

```objc
action.showsDivider = YES;
action.dividerColor = UIColor.greenColor;
```

MDCActionSheetController now has a delegate, `MDCActionSheetControllerDelegate`, that can be used to react to action sheet dismissal.

```objc
actionSheet.delegate = self;

- (void)actionSheetControllerDidDismiss:(MDCActionSheetController *)actionSheetController {
NSLog(@"Did dismiss");
}
```

### BottomNavigation

MDCBottomNavigationBar now supports iOS 13's large content viewer functionality.

## Component changes

### ActionSheet

* [Action sheet divider (#9449)](https://github.com/material-components/material-components-ios/commit/0d632ff762d69049463817a80db7149a4c535a16) (Cody Weaver)
* [Add delegate to support dismissal notification (#9475)](https://github.com/material-components/material-components-ios/commit/42b004fcd7108825bf9d8f436c557a0a11fd2a97) (Bryan Oltman)

### AppBar

* [Fix swipe to go back gesture for MDCAppBarNavigationController. (#9448)](https://github.com/material-components/material-components-ios/commit/53ab07d693a8a27f96d12dc17715b768d16059af) (featherless)

### BottomNavigation

* [Adds large content viewer support (#9451)](https://github.com/material-components/material-components-ios/commit/69d39caeb96c2c2dc4ff80e10269ba815c799159) (Eric Lee)
* [Fix bug in delegate method call (#9489)](https://github.com/material-components/material-components-ios/commit/e51a83afeb149b2e051f9abb8b43ce134f0b23f4) (Robert Moore)

### Dialogs

* [Use dot notation for properties and copyedits. (#9458)](https://github.com/material-components/material-components-ios/commit/33e69ab97351299ad6c3daac93946422922d7b1c) (Randall Li)

### FeatureHighlight

* [Allow UIAccessibility to activate the "dismiss" affordance. (#9486)](https://github.com/material-components/material-components-ios/commit/076aaa29dc039ec393533f27094903d9eebbcb6b) (Robert Moore)

### FlexibleHeader

* [Annotate to-be-deprecated APIs accordingly. (#9492)](https://github.com/material-components/material-components-ios/commit/9efa83581e90da776d848a9ae12140b0a695cc00) (featherless)

### NavigationDrawer

* [Update `transitionPercentageForContentOffset:` to use `kEpsilon` (#9471)](https://github.com/material-components/material-components-ios/commit/5e316d7a1575bd7cfcd4b20d083cfdcd3ddefc68) (Jake Rockland)

### Snackbar

* [Add example to show snackbar with keyboard (#9479)](https://github.com/material-components/material-components-ios/commit/c95a4449972c43da4642e622a3247a4c16ab7687) (Bryan Oltman)
* [Update dismiss animation duration (#9472)](https://github.com/material-components/material-components-ios/commit/a20a5f6aa6ee704a49b9ec3270a7d547003e457c) (Yarden Eitan)

### TextControls

* [Update README (#9466)](https://github.com/material-components/material-components-ios/commit/c70ad694273d71e33c9edd6b268692c21e9bd4fb) (Andrew Overton)

### TextFields

* [Add identity check in -setTextColor: in MDCTextField (#9480)](https://github.com/material-components/material-components-ios/commit/7a48d3997fafb2b7a9e8ed4b76cf39772389430d) (Andrew Overton)
* [MDCTextInputControllerOutlinedTextArea border width fix (#9454)](https://github.com/material-components/material-components-ios/commit/b28e09d345e518a042609b9a176e9ca99d98b024) (Andrew Overton)

---

# 103.0.0

This major release includes a refactoring of the TextControls libraries, a theming extension for TextFields' underline controller,
Expand Down
5 changes: 3 additions & 2 deletions 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 = "103.0.0"
mdc.version = "103.1.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 Expand Up @@ -321,7 +321,8 @@ Pod::Spec.new do |mdc|
"components/#{component.base_name}/tests/unit/supplemental/*.{h,m,swift}"
]
unit_tests.exclude_files = [
"components/#{component.base_name}/tests/unit/MDCBottomNavigationBarControllerTests.m"
"components/#{component.base_name}/tests/unit/MDCBottomNavigationBarControllerTests.m",
"components/#{component.base_name}/tests/unit/MDCBottomNavigationBarControllerDelegateTests.m"
]
unit_tests.resources = "components/#{component.base_name}/tests/unit/resources/*"
end
Expand Down
5 changes: 3 additions & 2 deletions 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 = "103.0.0"
mdc.version = "103.1.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 Expand Up @@ -64,7 +64,8 @@ Pod::Spec.new do |mdc|

component.test_spec 'UnitTests' do |unit_tests|
unit_tests.source_files = [
"components/#{component.base_name}/tests/unit/MDCBottomNavigationBarControllerTests.m"
"components/#{component.base_name}/tests/unit/MDCBottomNavigationBarControllerTests.m",
"components/#{component.base_name}/tests/unit/MDCBottomNavigationBarControllerDelegateTests.m"
]
end
end
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 = "103.0.0"
s.version = "103.1.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 = "103.0.0"
s.version = "103.1.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 = "103.0.0"
s.version = "103.1.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 @@
103.0.0
103.1.0
6 changes: 0 additions & 6 deletions catalog/MDCCatalog/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MDCAppBarNavigationContro
let rootNodeViewController = MDCCatalogComponentsController(node: tree)
navigationController.pushViewController(rootNodeViewController, animated: false)

// In the event that an example view controller hides the navigation bar we generally want to
// ensure that the edge-swipe pop gesture can still take effect. This may be overly-assumptive
// but we'll explore other alternatives when we have a concrete example of this approach causing
// problems.
navigationController.interactivePopGestureRecognizer?.delegate = navigationController

self.window?.rootViewController = navigationController
self.window?.makeKeyAndVisible()

Expand Down
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>103.0.0</string>
<string>103.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>103.0.0</string>
<string>103.1.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>103.0.0</string>
<string>103.1.0</string>
<key>CFBundleVersion</key>
<string>103.0.0</string>
<string>103.1.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 = "103.0.0"
s.version = "103.1.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
1 change: 1 addition & 0 deletions components/ActionSheet/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ mdc_snapshot_objc_library(
name = "snapshot_test_lib",
deps = [
":ActionSheet",
":privateHeaders",
],
)

Expand Down
1 change: 1 addition & 0 deletions components/ActionSheet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ the screen and displays actions a user can take.
<li class="icon-list-item icon-list-item--spec"><a href="https://material.io/go/design-action-sheet">Material Design guidelines: ActionSheet</a></li>
<li class="icon-list-item icon-list-item--link">Class: <a href="https://material.io/components/ios/catalog/action-sheet/api-docs/Classes/MDCActionSheetAction.html">MDCActionSheetAction</a></li>
<li class="icon-list-item icon-list-item--link">Class: <a href="https://material.io/components/ios/catalog/action-sheet/api-docs/Classes/MDCActionSheetController.html">MDCActionSheetController</a></li>
<li class="icon-list-item icon-list-item--link">Protocol: <a href="https://material.io/components/ios/catalog/action-sheet/api-docs/Protocols/MDCActionSheetControllerDelegate.html">MDCActionSheetControllerDelegate</a></li>
</ul>

## Table of contents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
#import "MaterialContainerScheme.h"
#import "MaterialTypographyScheme.h"

@interface ActionSheetTypicalUseExampleViewController : UIViewController
@interface ActionSheetTypicalUseExampleViewController
: UIViewController <MDCActionSheetControllerDelegate>

@property(nonatomic, strong) MDCButton *showButton;
@property(nonatomic, strong) id<MDCContainerScheming> containerScheme;
Expand Down Expand Up @@ -88,9 +89,15 @@ - (void)showActionSheet {
[actionSheet addAction:favoriteAction];
[actionSheet addAction:emailAction];
[actionSheet applyThemeWithScheme:self.containerScheme];
actionSheet.delegate = self;
[self presentViewController:actionSheet animated:YES completion:nil];
}

#pragma mark - MDCActionSheetControllerDelegate
- (void)actionSheetControllerDidDismiss:(MDCActionSheetController *)actionSheetController {
NSLog(@"Did dismiss");
}

@end

@implementation ActionSheetTypicalUseExampleViewController (CatalogByConvention)
Expand Down
33 changes: 33 additions & 0 deletions components/ActionSheet/src/MDCActionSheetController.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,20 @@
#import "MaterialElevation.h"

@class MDCActionSheetAction;
@class MDCActionSheetController;

/**
Defines methods that allows the adopting delegate to respond to messages from an
@c MDCActionSheetController.
*/
@protocol MDCActionSheetControllerDelegate <NSObject>
@optional

/**
Tells the delegate that the action sheet was dismissed.
*/
- (void)actionSheetControllerDidDismiss:(nonnull MDCActionSheetController *)actionSheetController;
@end

/**
MDCActionSheetController displays an alert message to the user, similar to
Expand Down Expand Up @@ -90,6 +104,11 @@ __attribute__((objc_subclassing_restricted)) @interface MDCActionSheetController
*/
- (void)addAction:(nonnull MDCActionSheetAction *)action;

/**
The object that acts as the delegate of the @c MDCActionSheetController
*/
@property(nonatomic, weak, nullable) id<MDCActionSheetControllerDelegate> delegate;

/**
The actions that the user can take in response to the action sheet.

Expand Down Expand Up @@ -303,4 +322,18 @@ typedef void (^MDCActionSheetHandler)(MDCActionSheetAction *_Nonnull action);
*/
@property(nonatomic, copy, nullable) UIColor *tintColor;

/**
The color of the divider at the top of the action.

@note Defaults to clear.
*/
@property(nonatomic, copy, nonnull) UIColor *dividerColor;

/**
Controls whether a divider is shown at the top of the action.

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

@end
20 changes: 20 additions & 0 deletions components/ActionSheet/src/MDCActionSheetController.m
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ - (instancetype)initWithTitle:(NSString *)title
_title = [title copy];
_image = [image copy];
_completionHandler = [handler copy];
_dividerColor = UIColor.clearColor;
}
return self;
}
Expand All @@ -59,6 +60,8 @@ - (id)copyWithZone:(__unused NSZone *)zone {
action.accessibilityLabel = self.accessibilityLabel;
action.titleColor = self.titleColor;
action.tintColor = self.tintColor;
action.dividerColor = self.dividerColor;
action.showsDivider = self.showsDivider;
return action;
}

Expand Down Expand Up @@ -161,6 +164,12 @@ - (void)addAction:(MDCActionSheetAction *)action {
return [_actions copy];
}

- (void)loadView {
[super loadView];

self.mdc_bottomSheetPresentationController.delegate = self;
}

- (void)viewDidLoad {
[super viewDidLoad];

Expand Down Expand Up @@ -330,6 +339,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView
cell.addLeadingPadding = self.addLeadingPaddingToCell;
cell.actionTextColor = action.titleColor ?: self.actionTextColor;
cell.contentEdgeInsets = self.contentEdgeInsets;
cell.dividerColor = action.dividerColor;
cell.showsDivider = action.showsDivider;
return cell;
}

Expand Down Expand Up @@ -524,4 +535,13 @@ - (CGFloat)mdc_currentElevation {
return self.elevation;
}

#pragma mark - MDCBottomSheetPresentationControllerDelegate

- (void)bottomSheetPresentationControllerDidDismissBottomSheet:
(nonnull MDCBottomSheetController *)controller {
if ([self.delegate respondsToSelector:@selector(actionSheetControllerDidDismiss:)]) {
[self.delegate actionSheetControllerDidDismiss:self];
}
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,21 @@
*/
@property(nonatomic, assign) UIEdgeInsets contentEdgeInsets;

/**
The color of the divider at the top of the action.

@note Defaults to clear.
*/
@property(nonatomic, copy, nonnull) UIColor *dividerColor;

/**
Controls whether a divider is shown at the top of the action.

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

/** The label used to represent the action's @c title. */
@property(nonatomic, strong, nonnull) UILabel *actionLabel;

@end
Loading

0 comments on commit 459b7ab

Please sign in to comment.