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
codeman7 committed Jun 15, 2020
2 parents 180499a + 666a07d commit 6f114f5
Show file tree
Hide file tree
Showing 48 changed files with 649 additions and 153 deletions.
76 changes: 76 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,79 @@
# 109.8.0

In this minor release we added indeterminate mode to `MDCProgressView`. As well as various bug fixes to ActionSheet, Banner, Dialog, and TextFields components.

## New features

`MDCProgressView` now supports indeterminate mode.

```objc
MDCProgressView *progressView = [[MDCProgressView alloc] init];
progressView.mode = MDCProgressViewModeIndeterminate;
[progressView startAnimating];
```

## API changes

### Buttons

*new* property: `defaultContentEdgeInsets` in `MDCButton`

### ProgressView

*new* enum: `MDCProgressViewMode`

*new* property: `mode` in `MDCProgressView`

*new* property: `animating` in `MDCProgressView`

*new* method: `setMode:animated:completion:` in `MDCProgressView`

*new* method: `startAnimating` in `MDCProgressView`

*new* method: `stopAnimating` in `MDCProgressView`

## Component changes

### ActionSheet

* [Mark title as accessibility `.header`](https://github.com/material-components/material-components-ios/commit/386ba003220db035244c9d66cfe1468e1110ee37) (Rob Moore)

### Banner

* [Support two buttons on a single row style banner.](https://github.com/material-components/material-components-ios/commit/c13125fb26e64aea98392855ec3bfcda2a89ff36) (Wenyu Zhang)

### Buttons

* [Expose `defaultContentEdgeInsets` readonly property on MDCButton in regular header for the class, rather than only in the subclassing header, as clients may need to reset content insets back to their defaults after using a themer, even if they do not subclass MDCButton.](https://github.com/material-components/material-components-ios/commit/df6658771a83f2e8d3637f7ff0549437fb9c1d5f) (Jake Rockland)

### Dialogs

* [Voice over reads the message twice](https://github.com/material-components/material-components-ios/commit/8b4e6058db8a5235ef0ca145427795850c6b676f) (Nobody)

### ProgressView

* [Add and indeterminate state to the progress bar.](https://github.com/material-components/material-components-ios/commit/1a75f9dbbb5e5297834c1deb2c604d63175f4ed7) (Nobody)

### Tabs

* [Add explicit cast in MDCTabBarViewTests.](https://github.com/material-components/material-components-ios/commit/7c4dab62cf371ee9f89a9bff26c0d2ba1a0eb015) (Wenyu Zhang)
* [Internal change](https://github.com/material-components/material-components-ios/commit/a66e645d94f6d59e5ba8f97e75447ee57b3b7144) (Jeff Verkoeyen)

### TextFields

* [Return the empty string instead of nil in MDCTextField's accessibilityValue method to avoid VoiceOver defaulting to [super accessibilityValue].](https://github.com/material-components/material-components-ios/commit/d4880b46008f1636b39a50f939b746811994e37e) (Bryan Oltman)

### private/TextControlsPrivate

* [Rename + small refactor of horizontal positioning stuff](https://github.com/material-components/material-components-ios/commit/765676cca8d7705fe56c1d796c920b96fd45f5d0) (Andrew Overton)

## Multi-component changes

* [Add a convenience math method to calculate the correct visibleAreaInsets given a frame and a minimum touch target.](https://github.com/material-components/material-components-ios/commit/6bd4757079daa8a85828303d4826d46cb6e05583) (Yarden Eitan)
* [Change side view positioning for MDCUnderlinedTextField](https://github.com/material-components/material-components-ios/commit/c302339943de305772db2809fe864a53cbe5ab0f) (Andrew Overton)

---

# 109.7.0

This minor release makes accessibility improvements related to high contrast colors, adds new functionality to Buttons, Chips, Dialogs, Snackbars, and Tabs, and adds a new TextControls text field, `MDCUnderlinedTextField`, which is intended to replace `MDCTextInputControllerLegacyDefault` and `MDCTextInputControllerUnderline`.
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.7.0"
mdc.version = "109.8.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.7.0"
mdc.version = "109.8.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.7.0"
s.version = "109.8.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.7.0"
s.version = "109.8.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.7.0"
s.version = "109.8.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.7.0
109.8.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.7.0</string>
<string>109.8.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>109.7.0</string>
<string>109.8.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.7.0</string>
<string>109.8.0</string>
<key>CFBundleVersion</key>
<string>109.7.0</string>
<string>109.8.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.7.0"
s.version = "109.8.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 @@ -47,6 +47,7 @@ - (instancetype)initWithFrame:(CGRect)frame {
_titleLabel.font = [UIFont mdc_standardFontForMaterialTextStyle:MDCFontTextStyleSubheadline];
_titleLabel.numberOfLines = 0;
_titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
_titleLabel.accessibilityTraits |= UIAccessibilityTraitHeader;

[self addSubview:_messageLabel];
_messageLabel.font = [UIFont mdc_standardFontForMaterialTextStyle:MDCFontTextStyleBody1];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ - (void)showSingleLineLongTextStyleBanner {

MDCButton *button = bannerView.leadingButton;
[button setTitle:@"Dismiss" forState:UIControlStateNormal];
bannerView.trailingButton.hidden = YES;
bannerView.imageView.hidden = YES;
bannerView.showsDivider = YES;

Expand Down
3 changes: 1 addition & 2 deletions components/Banner/src/MDCBannerView.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ typedef NS_ENUM(NSInteger, MDCBannerViewLayoutStyle) {
MDCBannerViewLayoutStyleAutomatic, // Layout is set automatically based on how elements are
// configured on banner view. One of three other layouts will
// be used internally.
MDCBannerViewLayoutStyleSingleRow, // All elements on the same row, only supports one button.
// trailingButton is hidden under this layout style.
MDCBannerViewLayoutStyleSingleRow, // All elements on the same row.
MDCBannerViewLayoutStyleMultiRowStackedButton, // Multilple rows with stacked button layout
MDCBannerViewLayoutStyleMultiRowAlignedButton, // Multiple rows with aligned buttons horizontally
};
Expand Down
12 changes: 3 additions & 9 deletions components/Banner/src/MDCBannerView.m
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,6 @@ - (void)commonBannerViewInit {
_mdc_overrideBaseElevation = -1;
}

- (void)setBannerViewLayoutStyle:(MDCBannerViewLayoutStyle)bannerViewLayoutStyle {
_bannerViewLayoutStyle = bannerViewLayoutStyle;
if (bannerViewLayoutStyle == MDCBannerViewLayoutStyleSingleRow) {
// Only leadingButton is supported in MDCBannerViewLayoutStyleSingleRow.
self.trailingButton.hidden = YES;
}
}

- (void)setDividerColor:(UIColor *)dividerColor {
self.divider.backgroundColor = dividerColor;
}
Expand Down Expand Up @@ -442,7 +434,9 @@ - (void)updateConstraintsWithLayoutStyle:(MDCBannerViewLayoutStyle)layoutStyle {
if (layoutStyle == MDCBannerViewLayoutStyleSingleRow) {
self.imageViewConstraintCenterY.active = YES;
self.textViewConstraintCenterY.active = YES;
self.buttonContainerConstraintWidthWithLeadingButton.active = YES;
if (self.trailingButton.hidden) {
self.buttonContainerConstraintWidthWithLeadingButton.active = YES;
}
self.buttonContainerConstraintTopWithMargin.active = YES;
if (self.leadingButton.hidden) {
self.textViewConstraintTrailing.active = YES;
Expand Down
39 changes: 39 additions & 0 deletions components/Banner/tests/snapshot/MDCBannerSnapshotTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ - (void)testSingleRowStyleLongTextWithSingleActionLTR {
[button1 setTitle:@"Action1" forState:UIControlStateNormal];
[button1 setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
button1.uppercaseTitle = YES;
self.bannerView.trailingButton.hidden = YES;
self.bannerView.bannerViewLayoutStyle = MDCBannerViewLayoutStyleSingleRow;
self.bannerView.imageView.hidden = YES;

Expand All @@ -344,6 +345,7 @@ - (void)testSingleRowStyleLongTextWithSingleActionRTLInArabic {
[button1 setTitle:@"Action1" forState:UIControlStateNormal];
[button1 setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
button1.uppercaseTitle = YES;
self.bannerView.trailingButton.hidden = YES;
self.bannerView.bannerViewLayoutStyle = MDCBannerViewLayoutStyleSingleRow;
[self changeViewToRTL:self.bannerView];
self.bannerView.imageView.hidden = YES;
Expand All @@ -352,6 +354,43 @@ - (void)testSingleRowStyleLongTextWithSingleActionRTLInArabic {
[self generateSnapshotAndVerifyForView:self.bannerView];
}

- (void)testSingleRowStyleShortTextWithTwoActionsLTR {
// When
self.bannerView.textView.text = kBannerShortText;
MDCButton *button1 = self.bannerView.leadingButton;
[button1 setTitle:@"Action1" forState:UIControlStateNormal];
[button1 setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
button1.uppercaseTitle = YES;
MDCButton *button2 = self.bannerView.trailingButton;
[button2 setTitle:@"Action2" forState:UIControlStateNormal];
[button2 setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
button2.uppercaseTitle = YES;
self.bannerView.bannerViewLayoutStyle = MDCBannerViewLayoutStyleSingleRow;
self.bannerView.imageView.hidden = YES;

// Then
[self generateSnapshotAndVerifyForView:self.bannerView];
}

- (void)testSingleRowStyleShortTextWithTwoActionsRTL {
// When
self.bannerView.textView.text = kBannerShortText;
MDCButton *button1 = self.bannerView.leadingButton;
[button1 setTitle:@"Action1" forState:UIControlStateNormal];
[button1 setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
button1.uppercaseTitle = YES;
MDCButton *button2 = self.bannerView.trailingButton;
[button2 setTitle:@"Action2" forState:UIControlStateNormal];
[button2 setTitleColor:UIColor.blackColor forState:UIControlStateNormal];
button2.uppercaseTitle = YES;
self.bannerView.bannerViewLayoutStyle = MDCBannerViewLayoutStyleSingleRow;
self.bannerView.imageView.hidden = YES;
[self changeViewToRTL:self.bannerView];

// Then
[self generateSnapshotAndVerifyForView:self.bannerView];
}

- (void)testLongTextWithTwoActionsAndIconLTR {
// When
self.bannerView.textView.text = kBannerLongText;
Expand Down
23 changes: 7 additions & 16 deletions components/Buttons/examples/ButtonsTypicalUseExample.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@

#import "MaterialButtons.h"
#import "MaterialButtons+Theming.h"
#import "MaterialContainerScheme.h"
#import "MaterialTypography.h"
#import "MaterialMath.h"
#import "MaterialContainerScheme.h"

#import "supplemental/ButtonsTypicalUseSupplemental.h"

Expand Down Expand Up @@ -60,14 +61,9 @@ - (void)viewDidLoad {
MDCButton *containedButton = [[MDCButton alloc] init];
[containedButton setTitle:@"Button" forState:UIControlStateNormal];
[containedButton applyContainedThemeWithScheme:self.containerScheme];
CGSize containedButtonSize = [containedButton intrinsicContentSize];
CGFloat containedButtonVerticalInset =
MAX(0, (kMinimumAccessibleButtonSize.height - containedButtonSize.height) / 2);
CGFloat containedButtonHorizontalInset =
MAX(0, (kMinimumAccessibleButtonSize.width - containedButtonSize.width) / 2);
containedButton.visibleAreaInsets =
UIEdgeInsetsMake(containedButtonVerticalInset, containedButtonHorizontalInset,
containedButtonVerticalInset, containedButtonHorizontalInset);
[containedButton sizeToFit];
containedButton.visibleAreaInsets = MDCVisibleAreaInsetsForMinimumTappability(
containedButton.frame, kMinimumAccessibleButtonSize);
[containedButton sizeToFit];
[containedButton addTarget:self
action:@selector(didTap:)
Expand All @@ -93,14 +89,9 @@ - (void)viewDidLoad {
MDCButton *textButton = [[MDCButton alloc] init];
[textButton applyTextThemeWithScheme:self.containerScheme];
[textButton setTitle:@"Button" forState:UIControlStateNormal];
CGSize textButtonSize = [textButton intrinsicContentSize];
CGFloat textButtonVerticalInset =
MAX(0, (kMinimumAccessibleButtonSize.height - textButtonSize.height) / 2);
CGFloat textButtonHorizontalInset =
MAX(0, (kMinimumAccessibleButtonSize.width - textButtonSize.width) / 2);
[textButton sizeToFit];
textButton.visibleAreaInsets =
UIEdgeInsetsMake(textButtonVerticalInset, textButtonHorizontalInset, textButtonVerticalInset,
textButtonHorizontalInset);
MDCVisibleAreaInsetsForMinimumTappability(textButton.frame, kMinimumAccessibleButtonSize);
[textButton sizeToFit];
[textButton addTarget:self
action:@selector(didTap:)
Expand Down
5 changes: 5 additions & 0 deletions components/Buttons/src/MDCButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@
*/
@property(nonatomic, assign) UIEdgeInsets visibleAreaInsets;

/**
The default content edge insets of the button. They are set at initialization time.
*/
@property(nonatomic, readonly) UIEdgeInsets defaultContentEdgeInsets;

/**
The offset (in points) of the button's inkView or rippleView (depending on which is being used -
see @c enableRippleBehavior)
Expand Down
3 changes: 0 additions & 3 deletions components/Buttons/src/private/MDCButton+Subclassing.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,4 @@
/** The bounding path of the button. The shadow will follow that path. */
- (nonnull UIBezierPath *)boundingPath;

/** The default content edge insets of the button. They are set at initialization time. */
- (UIEdgeInsets)defaultContentEdgeInsets;

@end
5 changes: 5 additions & 0 deletions components/Dialogs/src/MDCAlertController.m
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,11 @@ - (void)setupAlertView {
self.alertView.titleLabel.accessibilityLabel = self.titleAccessibilityLabel ?: self.title;
self.alertView.messageTextView.accessibilityLabel =
self.messageAccessibilityLabel ?: self.message ?: self.attributedMessage.string;
// Set messageTextView's accessibilityValue to the empty string to resolve b/158732017.
// MessageTextView acts as a label and should not have an accessibilityValue.
// Setting the accessibilityValue to nil causes VoiceOver to use the default value, which is the
// text of the message, so the value must be set to the empty string instead.
self.alertView.messageTextView.accessibilityValue = @"";
self.alertView.messageTextView.delegate = self;

self.alertView.titleIconImageView.accessibilityLabel = self.imageAccessibilityLabel;
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 *MDCLibraryInfoVersionString = @"109.7.0";
static NSString const *MDCLibraryInfoVersionString = @"109.8.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: "109.7.0", etc.
// Accept: "109.8.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
Loading

0 comments on commit 6f114f5

Please sign in to comment.