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
Wenyu Zhang committed Oct 19, 2020
2 parents b245999 + b02d753 commit ae08ba9
Show file tree
Hide file tree
Showing 16 changed files with 102 additions and 22 deletions.
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# 118.1.0

In this minor release, we have made several improvements to the TextControls component.

## New features

### TextControls

Added `-baseTextFieldShouldDeleteBackward:` and `-baseTextField:shouldPerformAction:withSender:canPerformAction:` to `MDCBaseTextFieldDelegate`.

## Component changes

### TextControls

* [Add -baseTextField:shouldPerformAction:withSender:canPerformAction:](https://github.com/material-components/material-components-ios/commit/6d0e6146188f84cbe19ce319745efa397df8fb97) (Andrew Overton)
* [Add shouldDeleteBackward delegate method](https://github.com/material-components/material-components-ios/commit/364b062a5096ede477160db7e8ed980497e9fdd6) (Andrew Overton)
* [consider floating label min Y in - accessibilityPath](https://github.com/material-components/material-components-ios/commit/b8d8690259c4560abb1c1806a8de032287c6e56e) (Andrew Overton)

---

# 118.0.1

In this patch release, an MDCNavigationDrawer bug for accessibility dismissal is fixed and references to deprecated Math APIs are removed.
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 = "118.0.1"
mdc.version = "118.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 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 = "118.0.1"
s.version = "118.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 = "118.0.1"
s.version = "118.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 = "118.0.1"
s.version = "118.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 @@
118.0.1
118.1.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>118.0.1</string>
<string>118.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>118.0.1</string>
<string>118.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>118.0.1</string>
<string>118.1.0</string>
<key>CFBundleVersion</key>
<string>118.0.1</string>
<string>118.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 = "118.0.1"
s.version = "118.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
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 = @"118.0.1";
static NSString* const kMDCLibraryInfoVersionString = @"118.1.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: "118.0.1", etc.
// Accept: "118.1.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 @@ -45,6 +45,7 @@ @implementation MDCTextControlTextAreaConfiguratorExample (CatalogByConvention)
+ (NSDictionary *)catalogMetadata {
return @{
@"breadcrumbs" : @[ @"Text Controls", kExampleTitle ],
@"description" : @"Text areas let users enter and edit text.",
@"primaryDemo" : @NO,
@"presentable" : @YES,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ @implementation MDCTextControlTextFieldConfiguratorExample (CatalogByConvention)
+ (NSDictionary *)catalogMetadata {
return @{
@"breadcrumbs" : @[ @"Text Controls", kExampleTitle ],
@"description" : @"Text fields let users enter and edit text.",
@"primaryDemo" : @YES,
@"presentable" : @YES,
};
Expand Down
48 changes: 41 additions & 7 deletions components/TextControls/src/BaseTextFields/MDCBaseTextField.m
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,21 @@ - (void)setUpLabel {
[self addSubview:self.label];
}

#pragma mark UIResponder Overrides

- (BOOL)canPerformAction:(SEL)action withSender:(id)sender {
BOOL canPerformAction = [super canPerformAction:action withSender:sender];
if ([self.baseTextFieldDelegate
respondsToSelector:@selector(baseTextField:
shouldPerformAction:withSender:canPerformAction:)]) {
return [self.baseTextFieldDelegate baseTextField:self
shouldPerformAction:action
withSender:sender
canPerformAction:canPerformAction];
}
return canPerformAction;
}

#pragma mark UIView Overrides

- (void)layoutSubviews {
Expand Down Expand Up @@ -692,12 +707,22 @@ - (NSString *)accessibilityLabel {
}

- (UIBezierPath *)accessibilityPath {
return [UIBezierPath bezierPathWithRect:self.accessibilityFrame];
}

- (CGRect)accessibilityFrame {
if (self.window) {
CGRect frameInScreenCoordinates = [self convertRect:self.bounds
toCoordinateSpace:self.window.screen.coordinateSpace];
return [UIBezierPath bezierPathWithRect:frameInScreenCoordinates];
CGRect bounds = self.bounds;
CGFloat boundsMinY = CGRectGetMinY(bounds);
CGFloat floatingLabelMinY = CGRectGetMinY(self.layout.labelFrameFloating);
if (floatingLabelMinY < boundsMinY) {
CGFloat difference = boundsMinY - floatingLabelMinY;
bounds.origin.y = boundsMinY - difference;
bounds.size.height = bounds.size.height + difference;
}
return [self convertRect:bounds toCoordinateSpace:self.window.screen.coordinateSpace];
} else {
return [super accessibilityPath];
return [super accessibilityFrame];
}
}

Expand Down Expand Up @@ -763,9 +788,18 @@ - (nonnull UIColor *)trailingAssistiveLabelColorForState:(MDCTextControlState)st
#pragma mark UIKeyInput

- (void)deleteBackward {
[super deleteBackward];
if ([_baseTextFieldDelegate respondsToSelector:@selector(baseTextFieldDidDeleteBackward:)]) {
[_baseTextFieldDelegate baseTextFieldDidDeleteBackward:self];
BOOL shouldDeleteBackward = YES;
if ([self.baseTextFieldDelegate
respondsToSelector:@selector(baseTextFieldShouldDeleteBackward:)]) {
shouldDeleteBackward = [self.baseTextFieldDelegate baseTextFieldShouldDeleteBackward:self];
}

if (shouldDeleteBackward) {
[super deleteBackward];
if ([self.baseTextFieldDelegate
respondsToSelector:@selector(baseTextFieldDidDeleteBackward:)]) {
[self.baseTextFieldDelegate baseTextFieldDidDeleteBackward:self];
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,33 @@ covered by @c UITextFieldDelegate.
/**
This method is called at the end of @c MDCBaseTextField's implementation of @c -deleteBackward.
@param textField The MDCBaseTextField calling @c -deleteBackward.
@param textField The @c MDCBaseTextField calling @c -deleteBackward.
*/
- (void)baseTextFieldDidDeleteBackward:(MDCBaseTextField *)textField;
;

/**
This method is called at the beginning of @c -deleteBackward. If it returns @c NO, the superclass
(@c UITextField) implementation of @c -deleteBackward will not be called. If it is not implemented,
the superclass implementation of @c -deleteBackward will always be called.
@param textField The @c MDCBaseTextField calling @c -deleteBackward.
*/
- (BOOL)baseTextFieldShouldDeleteBackward:(MDCBaseTextField *)textField;

/**
This method is called from @c MDCBaseTextField's implementation of the @c UIResponder method @c
-canPerformAction:withSender:. Implementing this method can allow you to do things like preventing
the user from pasting into the text field, for example.
@param textField The MDCBaseTextField.
@param action The action.
@param sender The sender.
@param canPerformAction This is the value that the superclass implementation of @c
-canPerformAction:withSender: returns.
*/
- (BOOL)baseTextField:(MDCBaseTextField *)textField
shouldPerformAction:(SEL)action
withSender:(id)sender
canPerformAction:(BOOL)canPerformAction;

@end
2 changes: 1 addition & 1 deletion demos/supplemental/RemoteImageServiceForMDCDemos.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "RemoteImageServiceForMDCDemos"
s.version = "118.0.1"
s.version = "118.1.0"
s.summary = "A helper image class for the MDC demos."
s.description = "This spec is made for use in the MDC demos. It gets images via url."
s.homepage = "https://github.com/material-components/material-components-ios"
Expand Down

0 comments on commit ae08ba9

Please sign in to comment.