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
afweiss committed Jan 19, 2021
2 parents 07cab9a + 9620631 commit 9f98163
Show file tree
Hide file tree
Showing 29 changed files with 418 additions and 77 deletions.
54 changes: 54 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,57 @@
# 120.0.0

In this major release, we deleted the `elevationOverlayColor` property from MDCSemanticColorScheme, added a `placeholderColor` property to MDCTextControls, added a `shapedBorderColor` property and a `shapedBorderWidth` property to MDCShapedView, and made multiple bug fixes.

## Breaking changes

### ColorScheme
The `elevationOverlayColor` property has been deleted.

## New features

### ShapedView
Added `shapedBorderColor` and `shapedBorderWidth` properties.

### TextControls
Added `placeholderColor` property.

## Component changes

### BottomSheet

* [Fix bug that was causing messy animation when a keyboard is going to appear after the bottom sheet dismisses.](https://github.com/material-components/material-components-ios/commit/4deaee13215776f82c104e4008c68168f8a62fba) (Alyssa Weiss)

### NavigationDrawer

* [Rotation UI Bug Fix This change is a slight alteration to the change introduced in cl/347036858 this moves the added code to the bottom of the method so as to not interfere with the recursive call.](https://github.com/material-components/material-components-ios/commit/6b4b0290a9df02f995f306e96a188b4b80745870) (Nobody)

### ShadowLayer

* [Add example for performance testing.](https://github.com/material-components/material-components-ios/commit/8da92053bd494128be6f659dd04c24f95ffa8b74) (Cody Weaver)

### Shapes

* [Add properties to configure the border color/width of `MDCShapedView`.](https://github.com/material-components/material-components-ios/commit/2d6db967af07c5805c7ded4cc56a7735a6c6337f) (Darren Mo)

### Snackbar

* [Add present+dismiss unit test for legacy snackbar.](https://github.com/material-components/material-components-ios/commit/11e4afa57cb8e59403715aa6bac4ec74788d1462) (Yarden Eitan)
* [Make imports more explicit](https://github.com/material-components/material-components-ios/commit/2158cbeda7e7b30e74d3635e315e707c06ef560a) (Cody Weaver)

### Tabs

* [Remove iOS 10 check in accessibilityTrait handling since only iOS 10 + is supported now](https://github.com/material-components/material-components-ios/commit/738a505dacefbb2371b5e0ae04989192eaa56370) (Alyssa Weiss)

### TextControls

* [Add placeholderColor property](https://github.com/material-components/material-components-ios/commit/48808bfe67683fbed035a9519be0b958ae9ae714) (Andrew Overton)

### schemes/Color

* [Delete elevationOverlayColor: It is not used in any theming extensions.](https://github.com/material-components/material-components-ios/commit/4195a48cca0c55245629f7eecb650ee1d292e635) (Randall Li)

---

# 119.5.0

In this minor release, we added a new userDraggingEnabled API to MDCBottomDrawerViewController.
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 = "119.5.0"
mdc.version = "120.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 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 = "119.5.0"
s.version = "120.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 = "119.5.0"
s.version = "120.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 = "119.5.0"
s.version = "120.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 @@
119.5.0
120.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>119.5.0</string>
<string>120.0.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>119.5.0</string>
<string>120.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>119.5.0</string>
<string>120.0.0</string>
<key>CFBundleVersion</key>
<string>119.5.0</string>
<string>120.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 = "119.5.0"
s.version = "120.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
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import <WebKit/WebKit.h>

#import "private/MDCSheetContainerView.h"
#import "MDCBottomSheetController.h"
#import "MDCBottomSheetPresentationControllerDelegate.h"
#import "MDCSheetContainerViewDelegate.h"
#import "MaterialMath.h"
Expand Down Expand Up @@ -228,6 +229,7 @@ - (void)dismissPresentedControllerIfNecessary:(UITapGestureRecognizer *)tapRecog
return;
}

self.sheetView.willBeDismissed = YES;
id<MDCBottomSheetPresentationControllerDelegate> strongDelegate = self.delegate;
[self.presentingViewController
dismissViewControllerAnimated:YES
Expand Down
1 change: 1 addition & 0 deletions components/BottomSheet/src/private/MDCSheetContainerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
@property(nonatomic, weak, nullable) id<MDCSheetContainerViewDelegate> delegate;
@property(nonatomic, readonly) MDCSheetState sheetState;
@property(nonatomic) CGFloat preferredSheetHeight;
@property(nonatomic) BOOL willBeDismissed;

/**
When set to false, the bottom sheet controller can't be dismissed by dragging the sheet down.
Expand Down
9 changes: 8 additions & 1 deletion components/BottomSheet/src/private/MDCSheetContainerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#import "MDCSheetContainerView.h"

#import "MDCSheetState.h"
#import "MDCDraggableView.h"
#import "MDCDraggableViewDelegate.h"
#import "MDCSheetBehavior.h"
Expand Down Expand Up @@ -60,6 +61,7 @@ - (instancetype)initWithFrame:(CGRect)frame
scrollView:(UIScrollView *)scrollView {
self = [super initWithFrame:frame];
if (self) {
self.willBeDismissed = NO;
if (UIAccessibilityIsVoiceOverRunning()) {
_sheetState = MDCSheetStateExtended;
} else {
Expand Down Expand Up @@ -358,7 +360,12 @@ - (void)sheetBehaviorDidUpdate {

- (void)keyboardStateChangedWithNotification:(__unused NSNotification *)notification {
if (self.window) {
[self animatePaneWithInitialVelocity:CGPointZero];
// Only add animation if the view is not set to be dismissed with the new keyboard. Otherwise,
// the view will first adjust height to fit above the keyboard and then dismiss, which appears
// glitchy on the screen.
if (!self.willBeDismissed) {
[self animatePaneWithInitialVelocity:CGPointZero];
}
}
}

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 kMDCLibraryInfoVersionString = @"119.5.0";
static NSString* const kMDCLibraryInfoVersionString = @"120.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: "119.5.0", etc.
// Accept: "120.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
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
#import "MDCBottomDrawerContainerViewController.h"

#import "MDCBottomDrawerHeader.h"
#import "MDCBottomDrawerState.h"
#import "MDCBottomDrawerContainerViewControllerDelegate.h"
#import "MDCBottomDrawerHeaderMask.h"
#import "MDCBottomDrawerShadowedView.h"
#import "MaterialShadowElevations.h"
#import "MaterialShadowLayer.h"
#import "MaterialApplication.h"
#import "MaterialMath.h"
#import "MaterialUIMetrics.h"
Expand Down Expand Up @@ -1099,11 +1101,6 @@ - (void)cacheLayoutCalculationsWithAddedContentHeight:(CGFloat)addedContentHeigh

CGFloat scrollingDistance = _contentHeaderTopInset + totalHeight;
_contentHeightSurplus = scrollingDistance - containerHeight;
// readded `presentingViewYOffset` because offset is cancelled out
// by being included in both the `scrollingDistance` and `containerHeight`.
// Because `containerHeight` is used in independent calculations
// we can't remove the offset from there.
_contentHeightSurplus += self.presentingViewYOffset;
if ([self shouldPresentFullScreen]) {
self.drawerState = MDCBottomDrawerStateFullScreen;
} else if (_contentHeightSurplus <= 0) {
Expand All @@ -1116,6 +1113,13 @@ - (void)cacheLayoutCalculationsWithAddedContentHeight:(CGFloat)addedContentHeigh
CGFloat addedContentheight = _contentHeaderTopInset - _contentHeightSurplus;
[self cacheLayoutCalculationsWithAddedContentHeight:addedContentheight];
}
// Readded `presentingViewYOffset` because offset is cancelled out
// by being included in both the `scrollingDistance` and `containerHeight`.
// Because `containerHeight` is used in independent calculations
// we can't remove the offset from there.
// This y-offset should be readded at the end of this method, this is to prevent it from being
// included in the recursive call in the conditional above.
_contentHeightSurplus += self.presentingViewYOffset;
}

- (CGFloat)transitionPercentageForContentOffset:(CGPoint)contentOffset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,6 @@ - (void)testContentHeightSurplusIsAddingYOffset {
self.navigationDrawer.headerViewController.preferredContentSize = CGSizeMake(100, 200);
self.navigationDrawer.contentViewController.preferredContentSize = CGSizeMake(100, 200);
[self.navigationDrawer.presentationController presentationTransitionWillBegin];
// This will be used to assert the `contentHeightSurplus` The height surplus is calculated by
// adding the content height and the header height. We then add the `presentingViewYOffset`.
// The offset is calculated by subtracting the frame height with the presenting bounds height.
// The presenting view bounds here is 0 and the content and header height get cancelled out in
// the surplus calculation. So the surplus ends up being the frame height
CGFloat frameHeight = CGRectGetHeight(self.navigationDrawer.view.frame);

// When
self.navigationDrawer.maximumDrawerHeight = 0;
Expand All @@ -314,7 +308,7 @@ - (void)testContentHeightSurplusIsAddingYOffset {
XCTAssertEqual(presentationController.bottomDrawerContainerViewController.maximumDrawerHeight,
0);
XCTAssertEqual(presentationController.bottomDrawerContainerViewController.contentHeightSurplus,
frameHeight);
880);
} else {
XCTFail(@"The presentation controller should be class of kind "
@"MDCBottomDrawerPresentationController but is %@",
Expand Down
Loading

0 comments on commit 9f98163

Please sign in to comment.