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 Apr 13, 2020
2 parents 1ebe3c1 + 23de723 commit c20fecd
Show file tree
Hide file tree
Showing 79 changed files with 2,120 additions and 512 deletions.
74 changes: 74 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,77 @@
# 108.1.0

This minor release improves our support of the new iPadOS cursor APIs, deprecates a themer, and
adds the ability to animate a floating button's mode.

## New deprecations

BottomSheet's ShapeThemer is now deprecated.

## New features

Improved UIPointerInteraction support for ActionSheet, Buttons, and Dialogs.

MDCFloatingButton has a new animated API for animating the mode from normal to expanded.

```objc
[button setMode:MDCFloatingButtonModeExpanded animated:YES];
```

## API changes

## Component changes

### ActionSheet

* [Add UIPointerInteraction support for actions..](https://github.com/material-components/material-components-ios/commit/45671537f593d07164d2d8ec15edd9a651f680a7) (Wenyu Zhang)

### BottomSheet

* [Deprecate the ShapeThemer.](https://github.com/material-components/material-components-ios/commit/1cf770cc40f1b29f1f89b0a3ed03f5f8899e4647) (Jeff Verkoeyen)

### Buttons

* [Add a snapshot test for floating buttons in normal mode with a label.](https://github.com/material-components/material-components-ios/commit/bc113b658c9a9e1befe6e3b4f83d6fa3b0e9db87) (Jeff Verkoeyen)
* [Add custom UIButtonPointerStyleProvider to MDCButton for better iPadOS pointer interaction.](https://github.com/material-components/material-components-ios/commit/5a2b2caae09680e38950dfb4c81c2c14f7a57359) (Bryan Oltman)
* [Add support to MDCFloatingButton for animating mode changes.](https://github.com/material-components/material-components-ios/commit/6ac7e6c3d87795a6ade75500c7c6af768f1463f0) (Jeff Verkoeyen)
* [Disable pointer interactions for MDCFloatingButton during animation.](https://github.com/material-components/material-components-ios/commit/4f75f7c33f8cb5e7999aa638102f04ce6de5f153) (Bryan Oltman)
* [Fix broken link in Buttons docs](https://github.com/material-components/material-components-ios/commit/8c27dcf2e53f038ba97e4e6452143a8f223c35b7) (Andrew Overton)
* [Fix build error](https://github.com/material-components/material-components-ios/commit/f5841c6d2fe269f4b3cadde869e1db44d1ca49cc) (Andrew Overton)
* [Standardize all examples on the same <Component><Example>Example pattern.](https://github.com/material-components/material-components-ios/commit/3a157e1f4309fbf2c2fe4404acbbfcd34136666c) (Jeff Verkoeyen)
* [Standardize all test names on <Symbol><TestCategory>Tests.](https://github.com/material-components/material-components-ios/commit/57ec631be27332140267393711e1c06400452fb1) (Jeff Verkoeyen)
* [Update MDCButton to use the proposed pointer effect in pointerStyleProvider.](https://github.com/material-components/material-components-ios/commit/bff4209df216fd538dcb8d49b3941179b4a8a767) (Bryan Oltman)
* [Use static storage for all local consts.](https://github.com/material-components/material-components-ios/commit/4454d0be942d588fcea5a390fb78711c07513a6c) (Jeff Verkoeyen)

### Dialogs

* [Add UIPointerInteraction support for buttons..](https://github.com/material-components/material-components-ios/commit/d36b5e8f3d12b4123032a3a3abc9296984a617a3) (Wenyu Zhang)
* [Add a Testing target](https://github.com/material-components/material-components-ios/commit/f0747fdac58b97c1252e0c985e48913dce129c22) (Galia Kaufman)
* [Adding accessory view tests](https://github.com/material-components/material-components-ios/commit/969f6f55460312e5f16236ad0e06c3e725f1fb74) (Galia Kaufman)
* [Clean up some comments.](https://github.com/material-components/material-components-ios/commit/57a566909fb7d89247b93887262c7cb93597c75f) (Dave MacLachlan)
* [Cleanup: move deprecated API to private header.](https://github.com/material-components/material-components-ios/commit/2f0a4af1c9a965cbe76b23ca5f1f92f500d11983) (Galia Kaufman)
* [Disable broken test.](https://github.com/material-components/material-components-ios/commit/9c32878a48bc074e315f1edada3dd06b5302059e) (Jeff Verkoeyen)
* [Resolve issue with sizing a dialog's accessoryView.](https://github.com/material-components/material-components-ios/commit/579370c4d6ae72931c83dcf32f6a62ef47473464) (Nobody)
* [Using Testing target in configuration snapshots.](https://github.com/material-components/material-components-ios/commit/2e19a8aa7e363e49c7d345f76ce4b402bf245b68) (Galia Kaufman)
* [Using the new Testing target in accessory snapshots.](https://github.com/material-components/material-components-ios/commit/f7d799a9cfb50384e2f304920fcfb87d574b6a55) (Galia Kaufman)
* [Using the new Testing target in actions snapshots.](https://github.com/material-components/material-components-ios/commit/e48d79a9cc82c9187a80dcd24d513052554dbb79) (Galia Kaufman)
* [Using the new Testing target in insets snapshots.](https://github.com/material-components/material-components-ios/commit/666ed14ba0cd16bb4914f0cbbad8f022b1e7ac15) (Galia Kaufman)
* [Using the new Testing target in insets unit tests.](https://github.com/material-components/material-components-ios/commit/7346de3ce076b426cfc6f0e877ac457c255fd700) (Galia Kaufman)

### Ripple

* [Add a respondsToSelector check to resolve crashes of unrecognized selector.](https://github.com/material-components/material-components-ios/commit/1e969f0e46be66ddc8401c34e444a1378100a661) (Yarden Eitan)

### TextControls

* [This change finishes adding TextControls examples to the internal Catalog.](https://github.com/material-components/material-components-ios/commit/965cde39c85ca3e0e1e6295784321065c786dfe0) (Andrew Overton)

## Multi-component changes

* [Expose the catalog by convention tree via the AppDelegate and walk the tree with the UI test runner.](https://github.com/material-components/material-components-ios/commit/c2c1cc64b36fd93877a66e39867ec4917ad82a59) (Jeff Verkoeyen)
* [Fix a lot of formatting issues with material.io and some broken links](https://github.com/material-components/material-components-ios/commit/f9a72c3df80e89904fa72ad058032059e74fcf59) (Andrew Overton)

---

# 108.0.0

This major release removes the default `init` methods from MDCSemanticColorScheme, improves support
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 = "108.0.0"
mdc.version = "108.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
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 = "108.0.0"
mdc.version = "108.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
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 = "108.0.0"
s.version = "108.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 = "108.0.0"
s.version = "108.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 = "108.0.0"
s.version = "108.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 @@
108.0.0
108.1.0
8 changes: 8 additions & 0 deletions catalog/MDCCatalog/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MDCAppBarNavigationContro
var window: UIWindow?

let navigationController = MDCAppBarNavigationController()
var tree: CBCNode?

func application(_ application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Expand All @@ -38,6 +39,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MDCAppBarNavigationContro
// The navigation tree will only take examples that implement
// and return YES to catalogIsPresentable.
let tree = CBCCreatePresentableNavigationTree()
self.tree = tree

navigationController.delegate = self

Expand All @@ -60,6 +62,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, MDCAppBarNavigationContro
return true
}

// This method is exposed solely for the purposes of UI test runners to be able to fetch the
// catalog by convention example tree.
@objc func navigationTree() -> CBCNode? {
return self.tree
}

@objc func themeDidChange(notification: NSNotification) {
let colorScheme = AppTheme.containerScheme.colorScheme
for viewController in navigationController.children {
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>108.0.0</string>
<string>108.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>108.0.0</string>
<string>108.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>108.0.0</string>
<string>108.1.0</string>
<key>CFBundleVersion</key>
<string>108.0.0</string>
<string>108.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 = "108.0.0"
s.version = "108.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
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ @interface MDCActionSheetItemTableViewCell ()
@property(nonatomic, strong, nonnull) UIView *divider;
@end

#ifdef __IPHONE_13_4
@interface MDCActionSheetItemTableViewCell (PointerInteractions) <UIPointerInteractionDelegate>
@end
#endif

@implementation MDCActionSheetItemTableViewCell {
MDCActionSheetAction *_itemAction;
NSLayoutConstraint *_titleLeadingConstraint;
Expand Down Expand Up @@ -139,6 +144,13 @@ - (void)commonMDCActionSheetItemViewInit {
.active = YES;
[_actionImageView.widthAnchor constraintEqualToConstant:kImageHeightAndWidth].active = YES;
[_actionImageView.heightAnchor constraintEqualToConstant:kImageHeightAndWidth].active = YES;

#ifdef __IPHONE_13_4
if (@available(iOS 13.4, *)) {
UIPointerInteraction *pointerInteraction = [[UIPointerInteraction alloc] initWithDelegate:self];
[self.contentView addInteraction:pointerInteraction];
}
#endif
}

- (void)layoutSubviews {
Expand Down Expand Up @@ -230,4 +242,19 @@ - (void)setImageRenderingMode:(UIImageRenderingMode)imageRenderingMode {
[self setNeedsLayout];
}

#pragma mark - UIPointerInteractionDelegate

#ifdef __IPHONE_13_4
- (UIPointerStyle *)pointerInteraction:(UIPointerInteraction *)interaction
styleForRegion:(UIPointerRegion *)region API_AVAILABLE(ios(13.4)) {
UIPointerStyle *pointerStyle = nil;
if (interaction.view) {
UITargetedPreview *targetedPreview = [[UITargetedPreview alloc] initWithView:interaction.view];
UIPointerEffect *hoverEffect = [UIPointerHoverEffect effectWithPreview:targetedPreview];
pointerStyle = [UIPointerStyle styleWithEffect:hoverEffect shape:nil];
}
return pointerStyle;
}
#endif

@end
37 changes: 37 additions & 0 deletions components/ActionSheet/tests/unit/MDCActionSheetTableCellTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -336,4 +336,41 @@ - (void)testSetActionSheetItemDividerShownSetsTheDividerShownOnTheCell {
XCTAssertTrue(cell.showsDivider);
}

- (void)testPointerInteractionsOnTheCellByDefault {
#ifdef __IPHONE_13_4
if (@available(iOS 13.4, *)) {
// Given
MDCActionSheetItemTableViewCell *cell =
[[MDCActionSheetItemTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:@"Foo"];

// Then
XCTAssertEqual(cell.contentView.interactions.count, 1);
XCTAssertTrue(
[cell.contentView.interactions.firstObject isKindOfClass:[UIPointerInteraction class]]);
}
#endif
}

- (void)testPointerInteractionsOnTheCellWithActionIsAdded {
#ifdef __IPHONE_13_4
if (@available(iOS 13.4, *)) {
// Given
MDCActionSheetAction *action = [MDCActionSheetAction actionWithTitle:@"Foo"
image:nil
handler:nil];

// When
[self.actionSheet addAction:action];

// Then
MDCActionSheetItemTableViewCell *cell =
[MDCActionSheetTestHelper getCellFromActionSheet:self.actionSheet atIndex:0];
XCTAssertEqual(cell.contentView.interactions.count, 1);
XCTAssertTrue(
[cell.contentView.interactions.firstObject isKindOfClass:[UIPointerInteraction class]]);
}
#endif
}

@end
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ + (NSDictionary *)catalogMetadata {
@"bottom of the screen.",
@"primaryDemo" : @YES,
@"presentable" : @YES,
@"flaky" : @YES,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,8 @@
Track progress here: https://github.com/material-components/material-components-ios/issues/7172
Learn more at docs/theming.md#migration-guide-themers-to-theming-extensions
*/
@interface MDCBottomSheetControllerShapeThemer : NSObject
@end

@interface MDCBottomSheetControllerShapeThemer (ToBeDeprecated)
__deprecated_msg("There is no replacement for this API yet.")
@interface MDCBottomSheetControllerShapeThemer : NSObject

/**
Applies a shape scheme's properties to an MDCBottomSheetController.
Expand All @@ -42,6 +40,7 @@
Learn more at docs/theming.md#migration-guide-themers-to-theming-extensions
*/
+ (void)applyShapeScheme:(nonnull id<MDCShapeScheming>)shapeScheme
toBottomSheetController:(nonnull MDCBottomSheetController *)bottomSheetController;
toBottomSheetController:(nonnull MDCBottomSheetController *)bottomSheetController
__deprecated_msg("There is no replacement for this API yet.");

@end
Binary file added components/Buttons/docs/assets/shrine-fabs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c20fecd

Please sign in to comment.