From 1118f14124858fe9a258b0971393e33b3966d2bf Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Tue, 11 Feb 2020 18:20:18 -0500 Subject: [PATCH 01/47] [Buttons] Delete deprecated MDCOutlinedButtonThemer (#9688) MDCOutlinedButtonThemer is deprecated and has no internal usage. Fixes #9687 --- .../Buttons/docs/theming-with-themers.md | 20 ---------- .../ButtonThemer/MDCOutlinedButtonThemer.h | 40 ------------------- .../ButtonThemer/MDCOutlinedButtonThemer.m | 37 ----------------- .../MaterialButtons+ButtonThemer.h | 1 - .../Buttons/tests/unit/ButtonThemerTests.m | 40 ------------------- .../DialogThemer/MDCAlertControllerThemer.m | 23 ++++++++++- 6 files changed, 21 insertions(+), 140 deletions(-) delete mode 100644 components/Buttons/src/ButtonThemer/MDCOutlinedButtonThemer.h delete mode 100644 components/Buttons/src/ButtonThemer/MDCOutlinedButtonThemer.m diff --git a/components/Buttons/docs/theming-with-themers.md b/components/Buttons/docs/theming-with-themers.md index 7e5daebb839..6bc5e242a06 100644 --- a/components/Buttons/docs/theming-with-themers.md +++ b/components/Buttons/docs/theming-with-themers.md @@ -59,26 +59,6 @@ MDCTextButtonThemer.applyScheme(buttonScheme, to: button) ``` -#### Outlined buttons - -An animation showing a Material Design outlined button. - -To theme a button as a Material Design outlined button, use `MDCOutlinedButtonThemer` -with an `MDCButton`. - - -#### Swift -```swift -MDCOutlinedButtonThemer.applyScheme(buttonScheme, to: button) -``` - -#### Objective-C - -```objc -[MDCOutlinedButtonThemer applyScheme:buttonScheme toButton:button]; -``` - - #### Contained buttons An animation showing a Material Design contained button. diff --git a/components/Buttons/src/ButtonThemer/MDCOutlinedButtonThemer.h b/components/Buttons/src/ButtonThemer/MDCOutlinedButtonThemer.h deleted file mode 100644 index b949f2c9bea..00000000000 --- a/components/Buttons/src/ButtonThemer/MDCOutlinedButtonThemer.h +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright 2018-present the Material Components for iOS authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "MaterialButtons.h" - -#import "MDCButtonScheme.h" - -/** - The Material Design outlined button themer for instances of MDCButton. - - @warning This API will eventually be deprecated. The replacement API is: - `MDCButton`'s `-applyOutlinedThemeWithScheme:` - Learn more at docs/theming.md#migration-guide-themers-to-theming-extensions - */ -__deprecated_msg("Please use MDCButton:applyOutlinedThemeWithScheme: instead.") - @interface MDCOutlinedButtonThemer : NSObject - -/** - Applies a button scheme's properties to an MDCButton using the outlined button style. - - @param scheme The button scheme to apply to the component instance. - @param button A component instance to which the scheme should be applied. - - @warning This API will eventually be deprecated. The replacement API is: - `MDCButton`'s `-applyOutlinedThemeWithScheme:` - Learn more at docs/theming.md#migration-guide-themers-to-theming-extensions - */ -+ (void)applyScheme:(nonnull id)scheme toButton:(nonnull MDCButton *)button; -@end diff --git a/components/Buttons/src/ButtonThemer/MDCOutlinedButtonThemer.m b/components/Buttons/src/ButtonThemer/MDCOutlinedButtonThemer.m deleted file mode 100644 index f725c759620..00000000000 --- a/components/Buttons/src/ButtonThemer/MDCOutlinedButtonThemer.m +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2018-present the Material Components for iOS authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "MDCOutlinedButtonThemer.h" - -#import "MaterialButtons+ColorThemer.h" -#import "MaterialButtons+ShapeThemer.h" -#import "MaterialButtons+TypographyThemer.h" - -@implementation MDCOutlinedButtonThemer - -+ (void)applyScheme:(nonnull id)scheme toButton:(nonnull MDCButton *)button { - [MDCOutlinedButtonColorThemer applySemanticColorScheme:scheme.colorScheme toButton:button]; - [MDCButtonShapeThemer applyShapeScheme:scheme.shapeScheme toButton:button]; - [MDCButtonTypographyThemer applyTypographyScheme:scheme.typographyScheme toButton:button]; - button.minimumSize = CGSizeMake(0, scheme.minimumHeight); - button.layer.cornerRadius = scheme.cornerRadius; - - NSUInteger maximumStateValue = UIControlStateNormal | UIControlStateSelected | - UIControlStateHighlighted | UIControlStateDisabled; - for (NSUInteger state = 0; state <= maximumStateValue; ++state) { - [button setBorderWidth:1 forState:state]; - } -} - -@end diff --git a/components/Buttons/src/ButtonThemer/MaterialButtons+ButtonThemer.h b/components/Buttons/src/ButtonThemer/MaterialButtons+ButtonThemer.h index 3f0eb0f8454..becb8191bbb 100644 --- a/components/Buttons/src/ButtonThemer/MaterialButtons+ButtonThemer.h +++ b/components/Buttons/src/ButtonThemer/MaterialButtons+ButtonThemer.h @@ -14,5 +14,4 @@ #import "MDCButtonScheme.h" #import "MDCContainedButtonThemer.h" -#import "MDCOutlinedButtonThemer.h" #import "MDCTextButtonThemer.h" diff --git a/components/Buttons/tests/unit/ButtonThemerTests.m b/components/Buttons/tests/unit/ButtonThemerTests.m index 42ee9c50caf..8fc54959c1f 100644 --- a/components/Buttons/tests/unit/ButtonThemerTests.m +++ b/components/Buttons/tests/unit/ButtonThemerTests.m @@ -57,46 +57,6 @@ - (void)testTextButtonThemer { [colorScheme.onSurfaceColor colorWithAlphaComponent:(CGFloat)0.38]); } -- (void)testOutlinedButtonThemer { - // Given - MDCButton *button = [[MDCButton alloc] init]; - MDCButtonScheme *scheme = [[MDCButtonScheme alloc] init]; - - // When - [MDCOutlinedButtonThemer applyScheme:scheme toButton:button]; - - // Then - // Color - XCTAssertEqualObjects([button backgroundColorForState:UIControlStateNormal], - [UIColor clearColor]); - XCTAssertEqualObjects([button backgroundColorForState:UIControlStateDisabled], - [button backgroundColorForState:UIControlStateNormal]); - XCTAssertEqualObjects([button titleColorForState:UIControlStateNormal], - scheme.colorScheme.primaryColor); - XCTAssertEqualWithAccuracy(button.disabledAlpha, 1, kEpsilonAccuracy); - XCTAssertEqualObjects(button.inkColor, - [scheme.colorScheme.primaryColor colorWithAlphaComponent:(CGFloat)0.16]); - XCTAssertEqualObjects([button borderColorForState:UIControlStateNormal], - [scheme.colorScheme.onSurfaceColor colorWithAlphaComponent:(CGFloat)0.12]); - XCTAssertEqualObjects([button borderColorForState:UIControlStateDisabled], - [button borderColorForState:UIControlStateNormal]); - - // Typography - XCTAssertEqualObjects([button titleFontForState:UIControlStateNormal], - scheme.typographyScheme.button); - - // Other - XCTAssertEqualWithAccuracy(button.minimumSize.height, scheme.minimumHeight, kEpsilonAccuracy); - XCTAssertEqualWithAccuracy(button.layer.cornerRadius, scheme.cornerRadius, kEpsilonAccuracy); - XCTAssertEqualWithAccuracy([button elevationForState:UIControlStateNormal], 0, kEpsilonAccuracy); - XCTAssertEqualWithAccuracy([button elevationForState:UIControlStateHighlighted], 0, - kEpsilonAccuracy); - XCTAssertEqualWithAccuracy([button borderWidthForState:UIControlStateNormal], 1, - kEpsilonAccuracy); - XCTAssertEqualWithAccuracy([button borderWidthForState:UIControlStateHighlighted], 1, - kEpsilonAccuracy); -} - - (void)testContainedButtonThemer { // Given MDCButton *button = [[MDCButton alloc] init]; diff --git a/components/Dialogs/src/DialogThemer/MDCAlertControllerThemer.m b/components/Dialogs/src/DialogThemer/MDCAlertControllerThemer.m index 1bc3cbccad6..05cb885e0b6 100644 --- a/components/Dialogs/src/DialogThemer/MDCAlertControllerThemer.m +++ b/components/Dialogs/src/DialogThemer/MDCAlertControllerThemer.m @@ -17,7 +17,9 @@ #import "../MDCAlertController+ButtonForAction.h" #import "MDCAlertColorThemer.h" #import "MDCAlertTypographyThemer.h" -#import "MaterialButtons+ButtonThemer.h" +#import "MaterialButtons+ColorThemer.h" +#import "MaterialButtons+ShapeThemer.h" +#import "MaterialButtons+TypographyThemer.h" #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-implementations" @@ -44,7 +46,7 @@ + (void)applyScheme:(nonnull id)alertScheme [MDCContainedButtonThemer applyScheme:alertScheme.buttonScheme toButton:button]; break; case MDCActionEmphasisMedium: - [MDCOutlinedButtonThemer applyScheme:alertScheme.buttonScheme toButton:button]; + [self applyOutlinedScheme:alertScheme.buttonScheme toButton:button]; break; case MDCActionEmphasisLow: // fallthrough default: @@ -53,4 +55,21 @@ + (void)applyScheme:(nonnull id)alertScheme } } } + +#pragma mark - Helpers ++ (void)applyOutlinedScheme:(nonnull id)scheme + toButton:(nonnull MDCButton *)button { + [MDCOutlinedButtonColorThemer applySemanticColorScheme:scheme.colorScheme toButton:button]; + [MDCButtonShapeThemer applyShapeScheme:scheme.shapeScheme toButton:button]; + [MDCButtonTypographyThemer applyTypographyScheme:scheme.typographyScheme toButton:button]; + button.minimumSize = CGSizeMake(0, scheme.minimumHeight); + button.layer.cornerRadius = scheme.cornerRadius; + + NSUInteger maximumStateValue = UIControlStateNormal | UIControlStateSelected | + UIControlStateHighlighted | UIControlStateDisabled; + for (NSUInteger state = 0; state <= maximumStateValue; ++state) { + [button setBorderWidth:1 forState:state]; + } +} + @end From 86b4fbcb2c2074b9e60dfb7987a3a1dc92c37937 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Tue, 11 Feb 2020 18:22:22 -0500 Subject: [PATCH 02/47] [TextFields] Delete deprecated MDCTextFieldTypographyThemer (#9689) MDCTextFieldTypographyThemer is deprecated and has no internal usage. Fixes #9661 --- ...extInputControllerFilled+MaterialTheming.m | 1 - ...tInputControllerOutlined+MaterialTheming.m | 2 - .../MDCTextFieldTypographyThemer.h | 76 ---------- .../MDCTextFieldTypographyThemer.m | 79 ----------- .../MaterialTextFields+TypographyThemer.h | 15 -- .../tests/unit/TextFieldTypographyThemer.m | 131 ------------------ 6 files changed, 304 deletions(-) delete mode 100644 components/TextFields/src/TypographyThemer/MDCTextFieldTypographyThemer.h delete mode 100644 components/TextFields/src/TypographyThemer/MDCTextFieldTypographyThemer.m delete mode 100644 components/TextFields/src/TypographyThemer/MaterialTextFields+TypographyThemer.h delete mode 100644 components/TextFields/tests/unit/TextFieldTypographyThemer.m diff --git a/components/TextFields/src/Theming/MDCTextInputControllerFilled+MaterialTheming.m b/components/TextFields/src/Theming/MDCTextInputControllerFilled+MaterialTheming.m index 067b41fedd6..1d9dea575dc 100644 --- a/components/TextFields/src/Theming/MDCTextInputControllerFilled+MaterialTheming.m +++ b/components/TextFields/src/Theming/MDCTextInputControllerFilled+MaterialTheming.m @@ -15,7 +15,6 @@ #import "MDCTextInputControllerFilled+MaterialTheming.h" #import -#import @implementation MDCTextInputControllerFilled (MaterialTheming) diff --git a/components/TextFields/src/Theming/MDCTextInputControllerOutlined+MaterialTheming.m b/components/TextFields/src/Theming/MDCTextInputControllerOutlined+MaterialTheming.m index 5ea1e1ccec3..20af092f558 100644 --- a/components/TextFields/src/Theming/MDCTextInputControllerOutlined+MaterialTheming.m +++ b/components/TextFields/src/Theming/MDCTextInputControllerOutlined+MaterialTheming.m @@ -14,8 +14,6 @@ #import "MDCTextInputControllerOutlined+MaterialTheming.h" -#import - static CGFloat const kOutlinedTextFieldActiveAlpha = (CGFloat)0.87; static CGFloat const kOutlinedTextFieldOnSurfaceAlpha = (CGFloat)0.6; static CGFloat const kOutlinedTextFieldDisabledAlpha = (CGFloat)0.38; diff --git a/components/TextFields/src/TypographyThemer/MDCTextFieldTypographyThemer.h b/components/TextFields/src/TypographyThemer/MDCTextFieldTypographyThemer.h deleted file mode 100644 index 97e1ec4feba..00000000000 --- a/components/TextFields/src/TypographyThemer/MDCTextFieldTypographyThemer.h +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2018-present the Material Components for iOS authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "MaterialTextFields.h" -#import "MaterialTypographyScheme.h" - -/** - The Material Design typography system's text field themer. - - @warning This API will eventually be deprecated. See the individual method documentation for - details on replacement APIs. - Learn more at docs/theming.md#migration-guide-themers-to-theming-extensions - */ -__deprecated_msg("Please use MDCTextInputControllerFilled+MaterialTheming.h or " - "MDCTextInputControllerOutlined+MaterialTheming.h instead.") - @interface MDCTextFieldTypographyThemer : NSObject - -/** - Applies a typography scheme's properties to a text input controller. - - @param typographyScheme The color scheme to apply to the component instance. - @param textInputController A component instance to which the color scheme should be applied. - - @warning This API will eventually be deprecated. The replacement API is: - `MDCTextInputControllerFilled`'s `-applyThemeWithScheme:` or - `MDCTextInputControllerOutlined`'s `-applyThemeWithScheme:`. - Learn more at docs/theming.md#migration-guide-themers-to-theming-extensions - */ -+ (void)applyTypographyScheme:(nonnull id)typographyScheme - toTextInputController:(nonnull id)textInputController - __deprecated_msg("Please use MDCTextInputControllerFilled+MaterialTheming.h or " - "MDCTextInputControllerOutlined+MaterialTheming.h instead."); - -/** - Applies a typography scheme to theme an specific class type responding to MDCTextInputController - protocol. Will not apply to existing instances. - - @param typographyScheme The typography scheme that applies to a MDCTextInputController. - @param textInputControllerClass A MDCTextInputController class that typography scheme will be - applied to. - - @warning This API will eventually be deprecated. There will be no replacement for this API. - Learn more at docs/theming.md#migration-guide-themers-to-theming-extensions - */ -+ (void)applyTypographyScheme:(nonnull id)typographyScheme - toAllTextInputControllersOfClass:(nonnull Class)textInputControllerClass - NS_SWIFT_NAME(apply(_:toAllControllersOfClass:)) - __deprecated_msg("Please use MDCTextInputControllerFilled+MaterialTheming.h or " - "MDCTextInputControllerOutlined+MaterialTheming.h instead."); - -/** - Applies a typography scheme's properties to a text input. - - @param typographyScheme The color scheme to apply to the component instance. - @param textInput A component instance to which the color scheme should be applied. - - @warning This API will eventually be deprecated. There will be no replacement for this API. - Learn more at docs/theming.md#migration-guide-themers-to-theming-extensions - */ -+ (void)applyTypographyScheme:(nonnull id)typographyScheme - toTextInput:(nonnull id)textInput - __deprecated_msg("Please use MDCTextInputControllerFilled+MaterialTheming.h or " - "MDCTextInputControllerOutlined+MaterialTheming.h instead."); - -@end diff --git a/components/TextFields/src/TypographyThemer/MDCTextFieldTypographyThemer.m b/components/TextFields/src/TypographyThemer/MDCTextFieldTypographyThemer.m deleted file mode 100644 index 704b19ddf02..00000000000 --- a/components/TextFields/src/TypographyThemer/MDCTextFieldTypographyThemer.m +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2018-present the Material Components for iOS authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "MDCTextFieldTypographyThemer.h" - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-implementations" -@implementation MDCTextFieldTypographyThemer -#pragma clang diagnostic pop - -+ (void)applyTypographyScheme:(id)typographyScheme - toTextInputController:(id)textInputController { - textInputController.inlinePlaceholderFont = typographyScheme.subtitle1; - textInputController.leadingUnderlineLabelFont = typographyScheme.caption; - textInputController.trailingUnderlineLabelFont = typographyScheme.caption; - if ([textInputController - conformsToProtocol:@protocol(MDCTextInputControllerFloatingPlaceholder)]) { - id textInputControllerFloatingPlaceholder = - (id)textInputController; - - // if caption.pointSize <= 0 there is no meaningful ratio so we fallback to default. - if (typographyScheme.caption.pointSize <= 0) { - textInputControllerFloatingPlaceholder.floatingPlaceholderScale = nil; - } else { - double ratio = typographyScheme.caption.pointSize / typographyScheme.subtitle1.pointSize; - textInputControllerFloatingPlaceholder.floatingPlaceholderScale = - [NSNumber numberWithDouble:ratio]; - } - } -} - -+ (void)applyTypographyScheme:(id)typographyScheme - toTextInput:(id)textInput { - textInput.font = typographyScheme.subtitle1; - textInput.placeholderLabel.font = typographyScheme.subtitle1; - textInput.leadingUnderlineLabel.font = typographyScheme.caption; - textInput.trailingUnderlineLabel.font = typographyScheme.caption; -} - -// TODO: (larche) Drop this "#if !defined..." and the pragmas when we drop Xcode 8 support. -// This is to silence a warning that doesn't appear in Xcode 9 when you use Class as an object. -#if !defined(__IPHONE_11_0) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wobjc-method-access" -#endif -+ (void)applyTypographyScheme:(id)typographyScheme - toAllTextInputControllersOfClass:(Class)textInputControllerClass { - [textInputControllerClass setInlinePlaceholderFontDefault:typographyScheme.subtitle1]; - [textInputControllerClass setTrailingUnderlineLabelFontDefault:typographyScheme.caption]; - [textInputControllerClass setLeadingUnderlineLabelFontDefault:typographyScheme.caption]; - if ([textInputControllerClass - conformsToProtocol:@protocol(MDCTextInputControllerFloatingPlaceholder)]) { - Class textInputControllerFloatingPlaceholderClass = - (Class)textInputControllerClass; - // if caption.pointSize <= 0 there is no meaningful ratio so we fallback to default. - if (typographyScheme.caption.pointSize <= 0) { - [textInputControllerFloatingPlaceholderClass setFloatingPlaceholderScaleDefault:0]; - } else { - CGFloat scale = typographyScheme.caption.pointSize / typographyScheme.subtitle1.pointSize; - [textInputControllerFloatingPlaceholderClass setFloatingPlaceholderScaleDefault:scale]; - } - } -} -#if !defined(__IPHONE_11_0) -#pragma clang diagnostic pop -#endif - -@end diff --git a/components/TextFields/src/TypographyThemer/MaterialTextFields+TypographyThemer.h b/components/TextFields/src/TypographyThemer/MaterialTextFields+TypographyThemer.h deleted file mode 100644 index 28f8546d4ac..00000000000 --- a/components/TextFields/src/TypographyThemer/MaterialTextFields+TypographyThemer.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2018-present the Material Components for iOS authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import "MDCTextFieldTypographyThemer.h" diff --git a/components/TextFields/tests/unit/TextFieldTypographyThemer.m b/components/TextFields/tests/unit/TextFieldTypographyThemer.m deleted file mode 100644 index a64efa52578..00000000000 --- a/components/TextFields/tests/unit/TextFieldTypographyThemer.m +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright 2018-present the Material Components for iOS authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#import - -#import "MaterialTextFields+TypographyThemer.h" -#import "MaterialTextFields.h" -#import "MaterialThemes.h" - -@interface MDCTextFieldTypographyThemer (ResetDefaults) - -+ (void)resetDefaultsForClass:(Class)class; - -@end - -@implementation MDCTextFieldTypographyThemer (ResetDefaults) - -// TODO: (larche) Drop this if defined and the pragmas when we drop Xcode 8 support. -// This is to silence a warning that doesn't appear in Xcode 9 when you use Class as an object. -#if !defined(__IPHONE_11_0) -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wobjc-method-access" -#endif -+ (void)resetDefaultsForClass:(Class)textInputControllerClass { - [textInputControllerClass setInlinePlaceholderFontDefault:nil]; - [textInputControllerClass setTrailingUnderlineLabelFontDefault:nil]; - [textInputControllerClass setLeadingUnderlineLabelFontDefault:nil]; - - if ([textInputControllerClass - conformsToProtocol:@protocol(MDCTextInputControllerFloatingPlaceholder)]) { - Class textInputControllerFloatingPlaceholderClass = - (Class)textInputControllerClass; - [textInputControllerFloatingPlaceholderClass setFloatingPlaceholderScaleDefault:0]; - } -} -#if !defined(__IPHONE_11_0) -#pragma clang diagnostic pop -#endif - -@end - -@interface TextFieldTypographyThemer : XCTestCase - -@end - -@implementation TextFieldTypographyThemer - -- (void)tearDown { - [super tearDown]; - [MDCTextFieldTypographyThemer resetDefaultsForClass:[MDCTextInputControllerFullWidth class]]; - [MDCTextFieldTypographyThemer resetDefaultsForClass:[MDCTextInputControllerBase class]]; -} - -- (void)testTypographyThemerSetsTheFontsForTextFieldProperly { - MDCTextField *textField = [[MDCTextField alloc] initWithFrame:CGRectZero]; - textField.font = [UIFont systemFontOfSize:28]; - textField.leadingUnderlineLabel.font = [UIFont systemFontOfSize:28]; - textField.trailingUnderlineLabel.font = [UIFont systemFontOfSize:28]; - textField.placeholderLabel.font = [UIFont systemFontOfSize:28]; - MDCTypographyScheme *typographyScheme = [[MDCTypographyScheme alloc] init]; - [MDCTextFieldTypographyThemer applyTypographyScheme:typographyScheme toTextInput:textField]; - XCTAssertEqualObjects(textField.leadingUnderlineLabel.font, typographyScheme.caption); - XCTAssertEqualObjects(textField.trailingUnderlineLabel.font, typographyScheme.caption); - XCTAssertEqualObjects(textField.placeholderLabel.font, typographyScheme.subtitle1); - XCTAssertEqualObjects(textField.font, typographyScheme.subtitle1); -} - -- (void)testTypographyThemerSetsTheFontsForTextInputControllerClass { - MDCTypographyScheme *typographyScheme = [[MDCTypographyScheme alloc] init]; - [MDCTextFieldTypographyThemer applyTypographyScheme:typographyScheme - toAllTextInputControllersOfClass:[MDCTextInputControllerFullWidth class]]; - XCTAssertEqualObjects([MDCTextInputControllerFullWidth trailingUnderlineLabelFontDefault], - typographyScheme.caption); - XCTAssertEqualObjects([MDCTextInputControllerFullWidth inlinePlaceholderFontDefault], - typographyScheme.subtitle1); -} - -- (void)testTypographyThemerSetsTheFontsForTextInputControllerFloatingPlaceHolderClass { - MDCTypographyScheme *typographyScheme = [[MDCTypographyScheme alloc] init]; - [MDCTextFieldTypographyThemer applyTypographyScheme:typographyScheme - toAllTextInputControllersOfClass:[MDCTextInputControllerBase class]]; - XCTAssertEqualObjects([MDCTextInputControllerBase trailingUnderlineLabelFontDefault], - typographyScheme.caption); - XCTAssertEqualObjects([MDCTextInputControllerBase leadingUnderlineLabelFontDefault], - typographyScheme.caption); - XCTAssertEqualObjects([MDCTextInputControllerBase inlinePlaceholderFontDefault], - typographyScheme.subtitle1); - XCTAssertEqual([MDCTextInputControllerBase floatingPlaceholderScaleDefault], - typographyScheme.caption.pointSize / typographyScheme.subtitle1.pointSize); -} - -- (void)testTypographyThemerSetsTheFontsForTextInputControllerInstance { - MDCTextInputControllerFullWidth *inputController = [[MDCTextInputControllerFullWidth alloc] init]; - inputController.trailingUnderlineLabelFont = [UIFont systemFontOfSize:80]; - inputController.inlinePlaceholderFont = [UIFont systemFontOfSize:80]; - MDCTypographyScheme *typographyScheme = [[MDCTypographyScheme alloc] init]; - [MDCTextFieldTypographyThemer applyTypographyScheme:typographyScheme - toTextInputController:inputController]; - XCTAssertEqualObjects(inputController.trailingUnderlineLabelFont, typographyScheme.caption); - XCTAssertEqualObjects(inputController.inlinePlaceholderFont, typographyScheme.subtitle1); -} - -- (void)testTypographyThemerSetsTheFontsForTextInputControllerFloatingPlaceHolderInstance { - MDCTextInputControllerBase *floatingInputController = [[MDCTextInputControllerBase alloc] init]; - floatingInputController.trailingUnderlineLabelFont = [UIFont systemFontOfSize:80]; - floatingInputController.leadingUnderlineLabelFont = [UIFont systemFontOfSize:80]; - floatingInputController.inlinePlaceholderFont = [UIFont systemFontOfSize:80]; - MDCTypographyScheme *typographyScheme = [[MDCTypographyScheme alloc] init]; - [MDCTextFieldTypographyThemer applyTypographyScheme:typographyScheme - toTextInputController:floatingInputController]; - XCTAssertEqualObjects(floatingInputController.trailingUnderlineLabelFont, - typographyScheme.caption); - XCTAssertEqualObjects(floatingInputController.leadingUnderlineLabelFont, - typographyScheme.caption); - XCTAssertEqualObjects(floatingInputController.inlinePlaceholderFont, typographyScheme.subtitle1); - XCTAssertEqual([floatingInputController.floatingPlaceholderScale doubleValue], - typographyScheme.caption.pointSize / typographyScheme.subtitle1.pointSize); -} - -@end From 0c8647cfca40fc04aa9da1ff7dde30efbe6456dc Mon Sep 17 00:00:00 2001 From: "copybara-service[bot]" <56741989+copybara-service[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2020 18:27:30 -0500 Subject: [PATCH 03/47] [Dialogs] Adding an adjustable insets feature flag. Flag default is NO. Clients must enable flag if they want to customize the inset. This flag has no effect yet in this CL. Adjustable layout logic will be introduced in followup CLs. (#9648) Adding an adjustable insets feature flag to the alert view private header. Default is NO.(b/132948073) --- .../Dialogs/src/private/MDCAlertControllerView+Private.h | 9 +++++++++ .../Dialogs/src/private/MDCAlertControllerView+Private.m | 1 + 2 files changed, 10 insertions(+) diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.h b/components/Dialogs/src/private/MDCAlertControllerView+Private.h index eff20a4583b..fa24d644cc0 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.h +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.h @@ -112,4 +112,13 @@ */ @property(nonatomic, assign) CGFloat actionsVerticalMargin; +/** + If YES, a new layout calculation that is customizable by the insets in this header file is used + to layout the dialog. If NO, we fall back to the legaccy layout calculation, ignoring all + customized inset values. + + Default value is @c NO. + */ +@property(nonatomic, assign) BOOL enableAdjustableInsets; + @end diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.m b/components/Dialogs/src/private/MDCAlertControllerView+Private.m index 439f3e71f0e..151e8b85e92 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.m +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.m @@ -61,6 +61,7 @@ - (instancetype)initWithFrame:(CGRect)frame { self.autoresizesSubviews = NO; self.clipsToBounds = YES; + self.enableAdjustableInsets = NO; self.titleIconInsets = UIEdgeInsetsMake(24.f, 24.f, 20.f, 24.f); self.titleInsets = UIEdgeInsetsMake(24.f, 24.f, 20.f, 24.f); self.contentInsets = UIEdgeInsetsMake(24.f, 24.f, 28.f, 24.f); From 2f542ca43af21e6ecb126692d943e04d65b28453 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Wed, 12 Feb 2020 00:11:09 -0500 Subject: [PATCH 04/47] [TextFields] Update snapshot goldens (#9691) New golden images were generated using `./.kokoro -d bazel -t //components/TextFields/...` and Xcode 10.3. They're replacing faulty images generated by recording in Xcode. Partial rollback of https://github.com/material-components/material-components-ios/pull/9666 --- .../testTextFieldWithLongErrorText_11_2@2x.png | 4 ++-- .../testTextFieldWithLongHelperText_11_2@2x.png | 4 ++-- .../testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png | 4 ++-- .../testTextFieldWithLongPlaceholderText_11_2@2x.png | 4 ++-- .../testTextFieldWithShortErrorText_11_2@2x.png | 4 ++-- .../testTextFieldWithShortHelperText_11_2@2x.png | 4 ++-- .../testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png | 4 ++-- .../testTextFieldWithShortPlaceholderText_11_2@2x.png | 4 ++-- .../testTextFieldWithLongErrorText_11_2@2x.png | 4 ++-- .../testTextFieldWithLongHelperText_11_2@2x.png | 4 ++-- .../testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png | 4 ++-- .../testTextFieldWithLongPlaceholderText_11_2@2x.png | 4 ++-- .../testTextFieldWithShortErrorText_11_2@2x.png | 4 ++-- .../testTextFieldWithShortHelperText_11_2@2x.png | 4 ++-- .../testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png | 4 ++-- .../testTextFieldWithShortPlaceholderText_11_2@2x.png | 4 ++-- .../testTextFieldWithLongPlaceholderText_11_2@2x.png | 4 ++-- .../testTextFieldWithShortPlaceholderText_11_2@2x.png | 4 ++-- .../testTextFieldWithLongPlaceholderText_11_2@2x.png | 4 ++-- .../testTextFieldWithShortPlaceholderText_11_2@2x.png | 4 ++-- 20 files changed, 40 insertions(+), 40 deletions(-) diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongErrorText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongErrorText_11_2@2x.png index 1424930038a..c7d12ef95a4 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongErrorText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongErrorText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3e235a54080da3d24564afc3e3a33922a78e6fff651973925d844337ba658276 -size 40759 +oid sha256:67eeb2ffed17e17b026d2ddb85505f6631ee476647960c10e259e1a5ccd744d8 +size 40728 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongHelperText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongHelperText_11_2@2x.png index 300198bd486..c49ba0590ff 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongHelperText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongHelperText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f9005ac9a862bf136b9cd00222b640a73ac7302834793458753a010ade181aa5 -size 52588 +oid sha256:d6af63899e906cf11548f611a17f790ab557c5f260d79ad01fd0da7237fe1d06 +size 52558 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png index 52faf087d69..2a91129f604 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:060781c281069f30b5e15405fd2fed99343df60dbb26780623cc7bd42b59316b -size 22157 +oid sha256:dfd5fb2f90330b6f38b60559efd109665c7e6f0fba12d4c69cd7e6661780d247 +size 21494 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png index f0e29a60021..3d5689c2830 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a398350efc0bf2b76c435dd6642228e679cc1077c4598e8b144b78c6663c7f10 -size 23739 +oid sha256:138ecc2fbcfc7b3dbe225ac689213d41f6cc88ab43ac00624643e5253e3dc1cc +size 9218 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortErrorText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortErrorText_11_2@2x.png index b1faed887e4..2aff2d4c26c 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortErrorText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortErrorText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3fb95b9ebb09ac396f54a61b06eaa614a5ce69bef24125bd401ec545688b45a7 -size 17124 +oid sha256:2835124dd6071210b0489a2f031deae2b2a23d8fbb008745af0a3d6d037ea844 +size 16647 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortHelperText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortHelperText_11_2@2x.png index 30da2dadc94..c1704d664de 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortHelperText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortHelperText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e823465ec4d05ff323ccc24c86ca1080cb81621f90f095be89926470c27bd388 -size 16785 +oid sha256:543f175a62abce270de0980a729f143d59b16e8a70459aa749b43c13dd803f99 +size 16319 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png index c70a4d432b4..2cf38f36811 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4472ec84f59800f4faf1f408f87dfd4207752bd72635037146c45543c93aa7a6 -size 15489 +oid sha256:f37595441d12765055aa3fdd15309c7d758e61c9f612c6134640e3ca41437d1e +size 14838 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png index 5591071f30a..4eaf3026043 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0b24f67ae496d4f8a6750bad8d9241c928a037eb71ecfd4b26a06807f525342c -size 15822 +oid sha256:6613dad6ba3815a8bf4a452ea76860ca170d887279b2d42ec4565547bae01060 +size 4989 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongErrorText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongErrorText_11_2@2x.png index 61a4ccb4fc5..fb664cf8617 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongErrorText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongErrorText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3ad2a29e9894b10760e59d47c67cdc7675ef25e1b2f1bf848f19a44a05a16adf -size 37018 +oid sha256:5930ba5d1c858485c159ecbd77d456a3527e388e7b312f79697404c70e577338 +size 36957 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongHelperText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongHelperText_11_2@2x.png index 9257d6a51f5..facbf9b7ef6 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongHelperText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongHelperText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a8931410394e61d964d4c3c5ce28215b0c8f51690053653a3e936dd23021a9e6 -size 49213 +oid sha256:9f4135625d13539c49d524f6e2e3929709e1ea5531414560c18cc544553e9ea5 +size 49192 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png index 53b67729a11..11f6f15c2de 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongPlaceholderTextDisabled_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2bbe595572300e26d3271c1c70fb86bcbf58e3be33192dac7145be7ed29ae9c9 -size 17477 +oid sha256:7209e43f0129f5b68ebe6105238f9d2b4af1743cc0aaca5489ac8746801f751e +size 17020 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png index 2b861984d23..3d5689c2830 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:274c585c1011bf8b67478f99a48e78565588764a09ea2f8b6198bba8715b5ea9 -size 19641 +oid sha256:138ecc2fbcfc7b3dbe225ac689213d41f6cc88ab43ac00624643e5253e3dc1cc +size 9218 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortErrorText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortErrorText_11_2@2x.png index 689e2f04e06..e063f03ace7 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortErrorText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortErrorText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6c83694b7add451d4d43ff4f903ff02ffe2ac74b4ea5dc50d1866334ffc405c6 -size 12686 +oid sha256:f2fa09e13a89539046b87791a059251189bc90025d3b4ffeb3d71b0b5b79235e +size 12416 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortHelperText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortHelperText_11_2@2x.png index 3c7d94302a8..04903e5db49 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortHelperText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortHelperText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:427dc6fc4e6a3a29342c5f9142f84783ab5a65ec97edae2576172f541b8aa897 -size 12345 +oid sha256:81cc4bfb7f9163a06a17caff50fd4d1ed5084eaea82634c60dfa42f7990c07a0 +size 12098 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png index 4fc924dc9d9..3dba2439cfd 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortPlaceholderTextDisabled_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4d706265aa2bb2ae69078a5eca0e55eb7c4b4cdc775f253cab7f6f00e3598ec9 -size 11078 +oid sha256:6b3d307094f925ed2df4a01f95b3e79268e9afc4710b24b14ce381880b79c6c1 +size 10629 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png index 7914e38d4fe..4eaf3026043 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldFilledControllerPreferredFontXSSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd4b5489488851f0d797794f70479875a25253714ce4c859bf9af576cea52b8b -size 11985 +oid sha256:6613dad6ba3815a8bf4a452ea76860ca170d887279b2d42ec4565547bae01060 +size 4989 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png index 7b0abf8c2b9..3ac3790720e 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:07544d0493c5cc6a72a8c3264c7ffa02321232bbbe8f31a13a04933d38082901 -size 26118 +oid sha256:6e9ac11e65398b99fe4be8bdae63f1b5d02d48643c53d0ccc0e5f8b14e3d36a3 +size 16289 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png index ea4a0694655..74863fd7932 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontAXXXLSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1a274af0f94edc220a01dd07a3f61b4d6a4e40d06d84728f8f578106c7c9f531 -size 16682 +oid sha256:ec4827c9cf9ebb4060ed3bbcab37602c993bc5587301257742cc8b2a34647649 +size 8033 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontXSSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontXSSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png index fcc6ecf9136..3ac3790720e 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontXSSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontXSSnapshotTests/testTextFieldWithLongPlaceholderText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c719025013605cf6a411ffd125c7e69304cbfe6d6411f2054b4866f303f96ab8 -size 22816 +oid sha256:6e9ac11e65398b99fe4be8bdae63f1b5d02d48643c53d0ccc0e5f8b14e3d36a3 +size 16289 diff --git a/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontXSSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontXSSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png index 5e23c575b45..74863fd7932 100644 --- a/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontXSSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCTextFieldOutlinedControllerPreferredFontXSSnapshotTests/testTextFieldWithShortPlaceholderText_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:eb1d0b512252276aa355f908cbb76c804259f5b40717aa1f60f1a6e9c67e225a -size 13238 +oid sha256:ec4827c9cf9ebb4060ed3bbcab37602c993bc5587301257742cc8b2a34647649 +size 8033 From 6f744afc44ec6b53b0cf7e344a39e6de5211e683 Mon Sep 17 00:00:00 2001 From: Yarden Eitan Date: Wed, 12 Feb 2020 14:18:51 +0200 Subject: [PATCH 05/47] fix snapshot tests for CI (#9698) New golden images were generated using ./.kokoro -d bazel -t //components/FeatureHighlight/... and ./.kokoro -d bazel -t //components/Snackbar/... using Xcode 10.3. They're replacing faulty images generated by recording in Xcode. --- .../testPreferredFontForAXXXLContentSizeCategory_11_2@2x.png | 4 ++-- .../testPreferredFontForXSContentSizeCategory_11_2@2x.png | 4 ++-- .../testSnackbarOverlayViewWithHighElevation_11_2@2x.png | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/snapshot_test_goldens/goldens_64/MDCFeatureHighlightSnapshotTests/testPreferredFontForAXXXLContentSizeCategory_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCFeatureHighlightSnapshotTests/testPreferredFontForAXXXLContentSizeCategory_11_2@2x.png index 02fe2976aa6..a0a8da65815 100644 --- a/snapshot_test_goldens/goldens_64/MDCFeatureHighlightSnapshotTests/testPreferredFontForAXXXLContentSizeCategory_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCFeatureHighlightSnapshotTests/testPreferredFontForAXXXLContentSizeCategory_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bbb7fbcf6e3ddeeaed1c3862ead120db1e0aca1f0003e0556bae09e964354528 -size 54952 +oid sha256:82b928c356003f1554e2b21da55d3f08aacda45178943f74e34504735a1a506e +size 37109 diff --git a/snapshot_test_goldens/goldens_64/MDCFeatureHighlightSnapshotTests/testPreferredFontForXSContentSizeCategory_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCFeatureHighlightSnapshotTests/testPreferredFontForXSContentSizeCategory_11_2@2x.png index 0cf56bad2cb..34a4996dfad 100644 --- a/snapshot_test_goldens/goldens_64/MDCFeatureHighlightSnapshotTests/testPreferredFontForXSContentSizeCategory_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCFeatureHighlightSnapshotTests/testPreferredFontForXSContentSizeCategory_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:868d2b8d3419b3e9ca9d11d18742069020d1565d14cbd9c24126893fa55aa24a -size 50605 +oid sha256:0e38339ec8841d6064323c89865c547f159d9839316ae4afacb851801283ffdf +size 40895 diff --git a/snapshot_test_goldens/goldens_64/MDCSnackbarMessageViewSnapshotTests/testSnackbarOverlayViewWithHighElevation_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCSnackbarMessageViewSnapshotTests/testSnackbarOverlayViewWithHighElevation_11_2@2x.png index 4551b0a9358..c9722aba879 100644 --- a/snapshot_test_goldens/goldens_64/MDCSnackbarMessageViewSnapshotTests/testSnackbarOverlayViewWithHighElevation_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCSnackbarMessageViewSnapshotTests/testSnackbarOverlayViewWithHighElevation_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f81e91c7830006a7aaff251d6d54f5f256b12342d1eb72a8d34af6040c8cb36d -size 55340 +oid sha256:baeecef3e233b49c38dc59dc09a4e77d78275686c15b09159c39ae8914ba0710 +size 44744 From 8e782d43a2d0a8033f0c65809c9dd09624ff3dbd Mon Sep 17 00:00:00 2001 From: "copybara-service[bot]" <56741989+copybara-service[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2020 09:58:26 -0500 Subject: [PATCH 06/47] [FlexibleHeader] Added property for minimumHeaderViewHeight (#9649) Create new property, minimumHeaderViewHeight, to describe an amount of header to remain on the screen after shiftBehavior is enabled and header has been shifted/scrolled off screen. --- .../src/MDCFlexibleHeaderView+ShiftBehavior.h | 5 ++ .../src/MDCFlexibleHeaderView.m | 50 ++++++++++++------- 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/components/FlexibleHeader/src/MDCFlexibleHeaderView+ShiftBehavior.h b/components/FlexibleHeader/src/MDCFlexibleHeaderView+ShiftBehavior.h index 30de07439b3..3ff3fca7fd8 100644 --- a/components/FlexibleHeader/src/MDCFlexibleHeaderView+ShiftBehavior.h +++ b/components/FlexibleHeader/src/MDCFlexibleHeaderView+ShiftBehavior.h @@ -124,6 +124,11 @@ typedef NS_ENUM(NSInteger, MDCFlexibleHeaderContentImportance) { */ @property(nonatomic) BOOL statusBarHintCanOverlapHeader; +/** + The minimum amount of header height to remain when `shiftBehavior` is enabled. + */ +@property(nonatomic) CGFloat minimumHeaderViewHeight; + /** Hides the view by changing its alpha when the header shifts. Note that this only happens when the header shifting behavior is set to MDCFlexibleHeaderShiftBehaviorEnabled. diff --git a/components/FlexibleHeader/src/MDCFlexibleHeaderView.m b/components/FlexibleHeader/src/MDCFlexibleHeaderView.m index 580844ce597..e8e358f4d36 100644 --- a/components/FlexibleHeader/src/MDCFlexibleHeaderView.m +++ b/components/FlexibleHeader/src/MDCFlexibleHeaderView.m @@ -325,6 +325,8 @@ - (void)commonMDCFlexibleHeaderViewInit { self.layer.shadowRadius = 4; self.layer.shadowOpacity = 0; + self.minimumHeaderViewHeight = 0.0; + NSString *voiceOverNotification; if (@available(iOS 11.0, *)) { voiceOverNotification = UIAccessibilityVoiceOverStatusDidChangeNotification; @@ -627,7 +629,7 @@ - (CGFloat)fhv_existingContentInsetAdjustmentForScrollView:(UIScrollView *)scrol // // Our desired top content inset is always at least: // -// _maximumHeight (with safe area insets removed) + [_safeAreas topSafeAreaInset] +// _maximumHeight (with safe area insets removed) + [_safeAreas topSafeAreaInset] // // This ensures that when our scroll view is scrolled to its top that our header is able to be fully // expanded. @@ -1130,22 +1132,7 @@ - (void)fhv_updateLayout { } // Calculate the upper bound of the accumulator based on what phase we're in. - - CGFloat upperBound; - - if (self.canAlwaysExpandToMaximumHeight && ![self fhv_canShiftOffscreen]) { - // Don't allow any shifting. - upperBound = 0; - } else if (headerHeight < 0) { - // Header is shifting while detached from content. - upperBound = [self fhv_accumulatorMax] + [self fhv_anchorLength]; - } else if (headerHeight < self.minMaxHeight.minimumHeightWithTopSafeArea) { - // Header is shifting while attached to content. - upperBound = [self fhv_accumulatorMax]; - } else { - // Header is not shifting. - upperBound = 0; - } + CGFloat upperBound = [self upperBoundWithHeaderHeight:headerHeight]; // Ensure that we don't lose any deltaY by first capping the accumulator within its valid // range. @@ -1178,6 +1165,35 @@ - (void)fhv_updateLayout { _shiftAccumulatorLastContentOffsetIsValid = YES; } +- (CGFloat)upperBoundWithHeaderHeight:(CGFloat)headerHeight { + CGFloat upperBound; + if (self.canAlwaysExpandToMaximumHeight && ![self fhv_canShiftOffscreen]) { + // Don't allow any shifting. + upperBound = 0; + } else if (headerHeight < 0) { + if (self.minimumHeaderViewHeight != 0.0) { + // Set upperBound distance to be between + // |maximum height| and |remaining minimum height after shifting|. + upperBound = self.minMaxHeight.maximumHeightWithoutTopSafeArea - self.minimumHeaderViewHeight; + } else { + upperBound = [self fhv_accumulatorMax] + [self fhv_anchorLength]; + } + } else if (headerHeight < self.minMaxHeight.minimumHeightWithTopSafeArea) { + if (self.minimumHeaderViewHeight != 0.0) { + // Set upperBound distance to be between + // |maximum height| and |remaining minimum height after shifting|. + upperBound = self.minMaxHeight.maximumHeightWithoutTopSafeArea - self.minimumHeaderViewHeight; + } else { + upperBound = [self fhv_accumulatorMax]; + } + + } else { + // Header is not shifting. + upperBound = 0; + } + return upperBound; +} + - (CGFloat)fhv_anchorLength { switch (_headerContentImportance) { case MDCFlexibleHeaderContentImportanceDefault: From 1d8d647f1f534de4366c8722992b67858d7ba444 Mon Sep 17 00:00:00 2001 From: "copybara-service[bot]" <56741989+copybara-service[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2020 14:37:05 -0500 Subject: [PATCH 07/47] [Component] MDCButton. (#9667) [Component] MDCButton. Corrected a spelling mistake in the error response for touch target dimensions. --- components/Buttons/src/MDCButton.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Buttons/src/MDCButton.m b/components/Buttons/src/MDCButton.m index 2cc6de86751..dc0f77e3c03 100644 --- a/components/Buttons/src/MDCButton.m +++ b/components/Buttons/src/MDCButton.m @@ -297,7 +297,7 @@ - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ NSLog( - @"Button touch target does not meet minimum size guidlines of (%0.f, %0.f). Button: %@, " + @"Button touch target does not meet minimum size guidelines of (%0.f, %0.f). Button: %@, " @"Touch Target: %@", MDCButtonMinimumTouchTargetWidth, MDCButtonMinimumTouchTargetHeight, [self description], NSStringFromCGSize(CGSizeMake(width, height))); From ecddca8d58d8e02fb350d31277693dbaff56f952 Mon Sep 17 00:00:00 2001 From: Galia Kaufman Date: Thu, 13 Feb 2020 07:30:14 -0500 Subject: [PATCH 08/47] [Dialogs] Adding accessory view vertical inset to private header (#9692) Adding accessory view vertical inset to private header, with a default value of 20.0, which is a backward compatible value (b/132948073). --- .../private/MDCAlertControllerView+Private.h | 17 ++++++++++++----- .../private/MDCAlertControllerView+Private.m | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.h b/components/Dialogs/src/private/MDCAlertControllerView+Private.h index fa24d644cc0..f13a037b16e 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.h +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.h @@ -55,6 +55,15 @@ */ @property(nonatomic, assign) BOOL adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable; +/** + If YES, a new layout calculation that is customizable by the insets in this header file is used + to layout the dialog. If NO, we fall back to the legaccy layout calculation, ignoring all + customized inset values. + + Default value is @c NO. + */ +@property(nonatomic, assign) BOOL enableAdjustableInsets; + /** The margins around the title icon or the title icon view against the dialog edges (top, leading, trailing) and the title (bottom). Note that the actual @@ -113,12 +122,10 @@ @property(nonatomic, assign) CGFloat actionsVerticalMargin; /** - If YES, a new layout calculation that is customizable by the insets in this header file is used - to layout the dialog. If NO, we fall back to the legaccy layout calculation, ignoring all - customized inset values. + The vertical inset between the accessory view and the message, if both are present. - Default value is @c NO. + Default value is 20. */ -@property(nonatomic, assign) BOOL enableAdjustableInsets; +@property(nonatomic, assign) CGFloat accessoryViewVerticalInset; @end diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.m b/components/Dialogs/src/private/MDCAlertControllerView+Private.m index 151e8b85e92..4dd43d05c64 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.m +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.m @@ -68,6 +68,7 @@ - (instancetype)initWithFrame:(CGRect)frame { self.actionsInsets = UIEdgeInsetsMake(8.f, 8.f, 8.f, 8.f); self.actionsHorizontalMargin = 8.f; self.actionsVerticalMargin = 12.f; + self.accessoryViewVerticalInset = 20.f; self.titleScrollView = [[UIScrollView alloc] initWithFrame:CGRectZero]; [self addSubview:self.titleScrollView]; From 95518f48d4fe6c10e13cbdcfcc3a1c863697298d Mon Sep 17 00:00:00 2001 From: Randall Li Date: Thu, 13 Feb 2020 12:17:57 -0500 Subject: [PATCH 09/47] [buttons] Fix tvOS target bug. (#9705) PiperOrigin-RevId: 294713878 --- components/Buttons/src/MDCButton.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Buttons/src/MDCButton.m b/components/Buttons/src/MDCButton.m index dc0f77e3c03..cd68a1cf9c3 100644 --- a/components/Buttons/src/MDCButton.m +++ b/components/Buttons/src/MDCButton.m @@ -170,7 +170,7 @@ - (void)commonMDCButtonInit { // Disable default highlight state. self.adjustsImageWhenHighlighted = NO; -#ifndef TARGET_OS_TV +#if (!defined(TARGET_OS_TV) || TARGET_OS_TV == 0) self.showsTouchWhenHighlighted = NO; #endif @@ -198,7 +198,7 @@ - (void)commonMDCButtonInit { action:@selector(touchDragExit:forEvent:) forControlEvents:UIControlEventTouchDragExit]; -#ifndef TARGET_OS_TV +#if (!defined(TARGET_OS_TV) || TARGET_OS_TV == 0) // Block users from activating multiple buttons simultaneously by default. self.exclusiveTouch = YES; #endif From 43706fa2f9c919421867e442656b24c6dd762da1 Mon Sep 17 00:00:00 2001 From: Randall Li Date: Thu, 13 Feb 2020 13:21:04 -0500 Subject: [PATCH 10/47] Delete NavigationDrawer OWNERS file (#9696) This file has the PII of Googlers. https://github.com/material-components/material-components-ios/blob/stable/CODEOWNERS is github friendly version of the same information. --- components/NavigationDrawer/OWNERS | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 components/NavigationDrawer/OWNERS diff --git a/components/NavigationDrawer/OWNERS b/components/NavigationDrawer/OWNERS deleted file mode 100644 index 5e1f1c57235..00000000000 --- a/components/NavigationDrawer/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -# go/mdc-contributing - -# Please see the main OWNERS file under the parent folder -# material_components_ios/ to find the core owners of this component. -approve-only: rockland - From 5884725f8746bfaecbc02ed509cb70eac42c5428 Mon Sep 17 00:00:00 2001 From: Randall Li Date: Thu, 13 Feb 2020 13:21:22 -0500 Subject: [PATCH 11/47] Delete Dialogs OWNERS file (#9697) This file has the PII of Googlers. https://github.com/material-components/material-components-ios/blob/stable/CODEOWNERS is github friendly version of the same information. --- components/Dialogs/OWNERS | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 components/Dialogs/OWNERS diff --git a/components/Dialogs/OWNERS b/components/Dialogs/OWNERS deleted file mode 100644 index 5b06bf4afd9..00000000000 --- a/components/Dialogs/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# go/mdc-contributing - -# Please see the main OWNERS file under the parent folder -# material_components_ios/ to find the core owners of this component. -approve-only: iberezan # Rollbacks and fast follows From e6ef298bdff1f25005f013777f9e534cb4b6a6d4 Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Thu, 13 Feb 2020 13:33:59 -0500 Subject: [PATCH 12/47] [TextControls] Changes from text-area-feature-branch with additional podspec and BUILD file changes (#9711) Because CI wasn't working earlier this week I merged the initial text area PRs (https://github.com/material-components/material-components-ios/pull/9682 and https://github.com/material-components/material-components-ios/pull/9684) into a [feature branch](https://github.com/material-components/material-components-ios/tree/text-area-feature-branch) in the main repo. This PR contains those changes, as well as a commit to update the BUILD file and podspec (3da2803), a commit that makes it compile (6a06594), and a commit to run clang (078cd70). The changes in these last three commits have not been reviewed, unlike the ones from the PRs into the feature branch. Related to #9407. --- MaterialComponents.podspec | 23 +++- components/TextControls/BUILD | 18 ++++ .../src/BaseTextAreas/MDCBaseTextArea.h | 27 +++++ .../src/BaseTextAreas/MDCBaseTextArea.m | 101 ++++++++++++++++++ .../private/MDCBaseTextAreaTextView.h | 47 ++++++++ .../private/MDCBaseTextAreaTextView.m | 75 +++++++++++++ .../src/BaseTextFields/MDCBaseTextField.m | 7 +- .../src/Shared/MDCTextControl.h | 4 + 8 files changed, 295 insertions(+), 7 deletions(-) create mode 100644 components/TextControls/src/BaseTextAreas/MDCBaseTextArea.h create mode 100644 components/TextControls/src/BaseTextAreas/MDCBaseTextArea.m create mode 100644 components/TextControls/src/BaseTextAreas/private/MDCBaseTextAreaTextView.h create mode 100644 components/TextControls/src/BaseTextAreas/private/MDCBaseTextAreaTextView.m diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 1fadbe2b80a..22d15464453 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -1557,7 +1557,28 @@ Pod::Spec.new do |mdc| component.public_header_files = "components/#{component.base_name.split('+')[0]}/src/#{component.base_name.split('+')[1]}/*.h" component.source_files = "components/#{component.base_name.split('+')[0]}/src/#{component.base_name.split('+')[1]}/*.{h,m}" end - + + # TextControls+BaseTextAreas + + mdc.subspec "TextControls+BaseTextAreas" do |component| + component.ios.deployment_target = '9.0' + component.public_header_files = "components/#{component.base_name.split('+')[0]}/src/#{component.base_name.split('+')[1]}/*.h" + component.source_files = [ "components/#{component.base_name.split('+')[0]}/src/#{component.base_name.split('+')[1]}/*.{h,m}", + "components/#{component.base_name.split('+')[0]}/src/#{component.base_name.split('+')[1]}/private/*.{h,m}" + ] + + component.dependency "MaterialComponents/private/TextControlsPrivate+Shared" + component.dependency "MaterialComponents/private/TextControlsPrivate+BaseStyle" + component.dependency "MDFInternationalization" + + component.test_spec 'UnitTests' do |unit_tests| + unit_tests.source_files = [ + "components/#{component.base_name.split('+')[0]}/tests/unit/#{component.base_name.split('+')[1]}/*.{h,m,swift}" + ] + unit_tests.dependency "MaterialComponents/schemes/Container" + end + end + # TextControls+BaseTextFields mdc.subspec "TextControls+BaseTextFields" do |component| diff --git a/components/TextControls/BUILD b/components/TextControls/BUILD index dfca752d158..21e9f1f511f 100644 --- a/components/TextControls/BUILD +++ b/components/TextControls/BUILD @@ -42,6 +42,15 @@ mdc_extension_objc_library( ], ) +mdc_extension_objc_library( + name = "BaseTextAreas", + deps = [ + ":BaseTextAreasPrivate", + "//components/private/TextControlsPrivate:BaseStyle", + "//components/private/TextControlsPrivate:Shared", + ], +) + mdc_extension_objc_library( name = "BaseTextFields", deps = [ @@ -51,6 +60,15 @@ mdc_extension_objc_library( ], ) +mdc_objc_library( + name = "BaseTextAreasPrivate", + hdrs = native.glob(["src/BaseTextAreas/private/*.h"]), + includes = ["src/BaseTextAreas/private"], + visibility = [ + ":TextControlsPackageGroup", + ], +) + mdc_objc_library( name = "BaseTextFieldsPrivate", hdrs = native.glob(["src/BaseTextFields/private/*.h"]), diff --git a/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.h b/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.h new file mode 100644 index 00000000000..104ad193a99 --- /dev/null +++ b/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.h @@ -0,0 +1,27 @@ +// Copyright 2020-present the Material Components for iOS authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import + +/** + A UIControl subclass that leverages UITextView to provide multi-line text input +*/ +@interface MDCBaseTextArea : UIControl + +/** + The UITextView contained within the text area. + */ +@property(strong, nonatomic, readonly, nonnull) UITextView *textView; + +@end diff --git a/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.m b/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.m new file mode 100644 index 00000000000..6e56d31004f --- /dev/null +++ b/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.m @@ -0,0 +1,101 @@ +// Copyright 2020-present the Material Components for iOS authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "MDCBaseTextArea.h" + +#import "private/MDCBaseTextAreaTextView.h" + +@interface MDCBaseTextArea () + +@property(strong, nonatomic) MDCBaseTextAreaTextView *textAreaTextView; +@end + +@implementation MDCBaseTextArea + +#pragma mark Object Lifecycle + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self commonMDCBaseTextAreaInit]; + } + return self; +} + +- (instancetype)initWithCoder:(NSCoder *)aDecoder { + self = [super initWithCoder:aDecoder]; + if (self) { + [self commonMDCBaseTextAreaInit]; + } + return self; +} + +- (void)commonMDCBaseTextAreaInit { + [self setUpTextAreaSpecificSubviews]; + [self observeTextViewNotifications]; +} + +- (void)dealloc { + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +#pragma mark Setup + +- (void)setUpTextAreaSpecificSubviews { + self.textAreaTextView = [[MDCBaseTextAreaTextView alloc] init]; + self.textAreaTextView.textAreaTextViewDelegate = self; + [self addSubview:self.textAreaTextView]; +} + +#pragma mark UIView Overrides + +- (void)layoutSubviews { + [super layoutSubviews]; + self.textAreaTextView.frame = self.bounds; +} + +#pragma mark Responding to text view changes + +- (void)textViewChanged:(NSNotification *)notification { + [self setNeedsLayout]; +} + +#pragma mark Custom Accessors + +- (UITextView *)textView { + return self.textAreaTextView; +} + +#pragma mark MDCBaseTextAreaTextViewDelegate + +- (void)textAreaTextView:(MDCBaseTextAreaTextView *)textView + willBecomeFirstResponder:(BOOL)willBecome { + [self setNeedsLayout]; +} + +- (void)textAreaTextView:(MDCBaseTextAreaTextView *)textView + willResignFirstResponder:(BOOL)willResign { + [self setNeedsLayout]; +} + +#pragma mark Notifications + +- (void)observeTextViewNotifications { + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(textViewChanged:) + name:UITextViewTextDidChangeNotification + object:nil]; +} + +@end diff --git a/components/TextControls/src/BaseTextAreas/private/MDCBaseTextAreaTextView.h b/components/TextControls/src/BaseTextAreas/private/MDCBaseTextAreaTextView.h new file mode 100644 index 00000000000..05b549950a3 --- /dev/null +++ b/components/TextControls/src/BaseTextAreas/private/MDCBaseTextAreaTextView.h @@ -0,0 +1,47 @@ +// Copyright 2020-present the Material Components for iOS authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import + +@class MDCBaseTextAreaTextView; + +/** + This protocol allows the MDCBaseTextAreaTextView to inform the text area of important responder + events. + */ +@protocol MDCBaseTextAreaTextViewDelegate + +/** +This method is called when the text view is about to become the first responder. + */ +- (void)textAreaTextView:(nonnull MDCBaseTextAreaTextView *)textView + willBecomeFirstResponder:(BOOL)willBecome; + +/** +This method is called when the text view is about to resign the first responder. + */ +- (void)textAreaTextView:(nonnull MDCBaseTextAreaTextView *)textView + willResignFirstResponder:(BOOL)willResign; +@end + +/** +This private UITextView subclass is used by the MDCBaseTextArea to handle multi-line text + */ +@interface MDCBaseTextAreaTextView : UITextView + +/** + A delegate conforming to MDCBaseTextAreaTextViewDelegate + */ +@property(nonatomic, weak, nullable) id textAreaTextViewDelegate; +@end diff --git a/components/TextControls/src/BaseTextAreas/private/MDCBaseTextAreaTextView.m b/components/TextControls/src/BaseTextAreas/private/MDCBaseTextAreaTextView.m new file mode 100644 index 00000000000..c48e9029db4 --- /dev/null +++ b/components/TextControls/src/BaseTextAreas/private/MDCBaseTextAreaTextView.m @@ -0,0 +1,75 @@ +// Copyright 2020-present the Material Components for iOS authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "MDCBaseTextAreaTextView.h" +#import "MDCTextControl.h" + +@implementation MDCBaseTextAreaTextView + +- (instancetype)initWithCoder:(NSCoder *)coder { + self = [super initWithCoder:coder]; + if (self) { + [self commonMDCBaseTextAreaTextViewInit]; + } + return self; +} + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self commonMDCBaseTextAreaTextViewInit]; + } + return self; +} + +- (void)commonMDCBaseTextAreaTextViewInit { + self.backgroundColor = UIColor.clearColor; + self.textContainerInset = UIEdgeInsetsZero; + self.layoutMargins = UIEdgeInsetsZero; + self.textContainer.lineFragmentPadding = 0; + self.font = MDCTextControlDefaultUITextFieldFont(); + self.clipsToBounds = NO; + self.showsVerticalScrollIndicator = NO; + self.showsHorizontalScrollIndicator = NO; +} + +- (void)setFont:(UIFont *)font { + [super setFont:font ?: MDCTextControlDefaultUITextFieldFont()]; +} + +- (UIFont *)font { + return [super font] ?: MDCTextControlDefaultUITextFieldFont(); +} + +- (BOOL)resignFirstResponder { + BOOL superclassDidResignFirstResponder = [super resignFirstResponder]; + SEL selector = @selector(textAreaTextView:willResignFirstResponder:); + if ([self.textAreaTextViewDelegate respondsToSelector:selector]) { + [self.textAreaTextViewDelegate textAreaTextView:self + willResignFirstResponder:superclassDidResignFirstResponder]; + } + return superclassDidResignFirstResponder; +} + +- (BOOL)becomeFirstResponder { + BOOL superclassDidBecomeFirstResponder = [super becomeFirstResponder]; + SEL selector = @selector(textAreaTextView:willBecomeFirstResponder:); + if ([self.textAreaTextViewDelegate respondsToSelector:selector]) { + [self.textAreaTextViewDelegate textAreaTextView:self + willBecomeFirstResponder:superclassDidBecomeFirstResponder]; + } + return superclassDidBecomeFirstResponder; +} + +@end diff --git a/components/TextControls/src/BaseTextFields/MDCBaseTextField.m b/components/TextControls/src/BaseTextFields/MDCBaseTextField.m index 8e2d604e45b..46cfd3ce42a 100644 --- a/components/TextControls/src/BaseTextFields/MDCBaseTextField.m +++ b/components/TextControls/src/BaseTextFields/MDCBaseTextField.m @@ -496,18 +496,13 @@ - (void)drawPlaceholderInRect:(CGRect)rect { #pragma mark Fonts - (UIFont *)normalFont { - return self.font ?: [self uiTextFieldDefaultFont]; + return self.font ?: MDCTextControlDefaultUITextFieldFont(); } - (UIFont *)floatingFont { return [self.containerStyle floatingFontWithNormalFont:self.normalFont]; } -- (UIFont *)uiTextFieldDefaultFont { - // This value comes from https://developer.apple.com/documentation/uikit/uitextfield/1619604-font - return [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; -} - #pragma mark Dynamic Type - (void)setAdjustsFontForContentSizeCategory:(BOOL)adjustsFontForContentSizeCategory { diff --git a/components/private/TextControlsPrivate/src/Shared/MDCTextControl.h b/components/private/TextControlsPrivate/src/Shared/MDCTextControl.h index 789446892da..20806576eda 100644 --- a/components/private/TextControlsPrivate/src/Shared/MDCTextControl.h +++ b/components/private/TextControlsPrivate/src/Shared/MDCTextControl.h @@ -23,6 +23,10 @@ #import "MDCTextControlState.h" #import "MDCTextControlVerticalPositioningReference.h" +static inline UIFont *_Nonnull MDCTextControlDefaultUITextFieldFont() { + return [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; +} + static const CGFloat kMDCTextControlDefaultAnimationDuration = (CGFloat)0.15; @protocol MDCTextControlStyle; From 65113bb1d9517bdee48395b62e066565f3d6eed4 Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Thu, 13 Feb 2020 14:38:35 -0500 Subject: [PATCH 13/47] Remove test spec (#9718) https://github.com/material-components/material-components-ios/pull/9711 causes the library to fail pod lib lint validations because there are currently no source files in the test spec. This will of course change very soon but in case there's a release before it does we should land this PR. Related to #9407. --- MaterialComponents.podspec | 7 ------- 1 file changed, 7 deletions(-) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 22d15464453..9f85e37bcab 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -1570,13 +1570,6 @@ Pod::Spec.new do |mdc| component.dependency "MaterialComponents/private/TextControlsPrivate+Shared" component.dependency "MaterialComponents/private/TextControlsPrivate+BaseStyle" component.dependency "MDFInternationalization" - - component.test_spec 'UnitTests' do |unit_tests| - unit_tests.source_files = [ - "components/#{component.base_name.split('+')[0]}/tests/unit/#{component.base_name.split('+')[1]}/*.{h,m,swift}" - ] - unit_tests.dependency "MaterialComponents/schemes/Container" - end end # TextControls+BaseTextFields From d89fa3fb11b97727265254afac91c2f9be6afb21 Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Thu, 13 Feb 2020 16:41:10 -0500 Subject: [PATCH 14/47] [Material][Availability] Migrates Text Controls to MDCAvailability (#9720) This PR addresses the failures in https://github.com/material-components/material-components-ios/pull/9719, which was copybara'd from [cl/293702448](http://cl/293702448) --- MaterialComponents.podspec | 8 ++++++-- components/private/TextControlsPrivate/BUILD | 2 ++ .../src/FilledStyle/MDCTextControlStyleFilled.m | 9 +++++---- .../src/OutlinedStyle/MDCTextControlStyleOutlined.m | 5 +++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 9f85e37bcab..3fb168d1c7b 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -1603,6 +1603,7 @@ Pod::Spec.new do |mdc| "components/#{component.base_name.split('+')[0]}/src/#{component.base_name.split('+')[1]}/private/*.{h,m}" ] + component.dependency "MaterialComponents/Availability" component.dependency "MaterialComponents/TextControls+BaseTextFields" component.dependency "MaterialComponents/private/TextControlsPrivate+FilledStyle" @@ -1644,6 +1645,7 @@ Pod::Spec.new do |mdc| "components/#{component.base_name.split('+')[0]}/src/#{component.base_name.split('+')[1]}/private/*.{h,m}" ] + component.dependency "MaterialComponents/Availability" component.dependency "MaterialComponents/TextControls+BaseTextFields" component.dependency "MaterialComponents/private/TextControlsPrivate+OutlinedStyle" @@ -1953,9 +1955,10 @@ Pod::Spec.new do |mdc| component.source_files = [ "components/private/#{component.base_name.split('+')[0]}/src/#{component.base_name.split('+')[1]}/*.{h,m}" ] - component.dependency "MaterialComponents/private/TextControlsPrivate+Shared" + component.dependency "MaterialComponents/Availability" component.dependency "MaterialComponents/AnimationTiming" component.dependency "MaterialComponents/private/Math" + component.dependency "MaterialComponents/private/TextControlsPrivate+Shared" end private_spec.subspec "TextControlsPrivate+OutlinedStyle" do |component| @@ -1963,9 +1966,10 @@ Pod::Spec.new do |mdc| component.public_header_files = "components/private/#{component.base_name.split('+')[0]}/src/#{component.base_name.split('+')[1]}/*.h" component.source_files = [ "components/private/#{component.base_name.split('+')[0]}/src/#{component.base_name.split('+')[1]}/*.{h,m}" ] - component.dependency "MaterialComponents/private/TextControlsPrivate+Shared" + component.dependency "MaterialComponents/Availability" component.dependency "MaterialComponents/AnimationTiming" component.dependency "MaterialComponents/private/Math" + component.dependency "MaterialComponents/private/TextControlsPrivate+Shared" end private_spec.subspec "ThumbTrack" do |component| diff --git a/components/private/TextControlsPrivate/BUILD b/components/private/TextControlsPrivate/BUILD index 5d016651e0e..075b47ecf9d 100644 --- a/components/private/TextControlsPrivate/BUILD +++ b/components/private/TextControlsPrivate/BUILD @@ -68,6 +68,7 @@ mdc_extension_objc_library( deps = [ ":Shared", "//components/AnimationTiming", + "//components/Availability", "//components/private/Math", ], ) @@ -83,6 +84,7 @@ mdc_extension_objc_library( deps = [ ":Shared", "//components/AnimationTiming", + "//components/Availability", "//components/private/Math", ], ) diff --git a/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlStyleFilled.m b/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlStyleFilled.m index 492ae7c4f40..cd7726188c4 100644 --- a/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlStyleFilled.m +++ b/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlStyleFilled.m @@ -18,6 +18,7 @@ #import "MDCTextControl.h" #import "MDCTextControlVerticalPositioningReferenceFilled.h" +#include "MaterialAvailability.h" #import "UIBezierPath+MDCTextControlStyle.h" static const CGFloat kFilledContainerStyleTopCornerRadius = (CGFloat)4.0; @@ -68,11 +69,11 @@ - (void)commonMDCTextControlStyleFilledInit { - (void)setUpUnderlineColors { self.underlineColors = [NSMutableDictionary new]; UIColor *underlineColor = [UIColor blackColor]; -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { underlineColor = [UIColor labelColor]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) self.underlineColors[@(MDCTextControlStateNormal)] = underlineColor; self.underlineColors[@(MDCTextControlStateEditing)] = underlineColor; self.underlineColors[@(MDCTextControlStateDisabled)] = underlineColor; @@ -82,11 +83,11 @@ - (void)setUpFilledBackgroundColors { self.filledBackgroundColors = [NSMutableDictionary new]; UIColor *filledBackgroundColor = [UIColor blackColor]; filledBackgroundColor = [filledBackgroundColor colorWithAlphaComponent:(CGFloat)0.05]; -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { filledBackgroundColor = [UIColor secondarySystemBackgroundColor]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) self.filledBackgroundColors[@(MDCTextControlStateNormal)] = filledBackgroundColor; self.filledBackgroundColors[@(MDCTextControlStateEditing)] = filledBackgroundColor; diff --git a/components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlStyleOutlined.m b/components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlStyleOutlined.m index 5c0e867f489..7d808586a18 100644 --- a/components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlStyleOutlined.m +++ b/components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlStyleOutlined.m @@ -16,6 +16,7 @@ #import "MDCTextControl.h" #import "MDCTextControlVerticalPositioningReferenceOutlined.h" +#include "MaterialAvailability.h" #import "UIBezierPath+MDCTextControlStyle.h" static const CGFloat kOutlinedContainerStyleCornerRadius = (CGFloat)4.0; @@ -53,11 +54,11 @@ - (void)commonMDCTextControlStyleOutlinedInit { - (void)setUpOutlineColors { self.outlineColors = [NSMutableDictionary new]; UIColor *outlineColor = [UIColor blackColor]; -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { outlineColor = [UIColor labelColor]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) self.outlineColors[@(MDCTextControlStateNormal)] = outlineColor; self.outlineColors[@(MDCTextControlStateEditing)] = outlineColor; self.outlineColors[@(MDCTextControlStateDisabled)] = From d03c34293fb3935e2d24f306e5add2f81741ea21 Mon Sep 17 00:00:00 2001 From: Randall Li Date: Fri, 14 Feb 2020 09:08:07 -0500 Subject: [PATCH 15/47] [Material][Availability] Migrates Slider to MDCAvailability. (#9704) [Material][Availability] Migrates Slider to MDCAvailability. --- components/Slider/tests/snapshot/MDCSliderSnapshotTests.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/Slider/tests/snapshot/MDCSliderSnapshotTests.m b/components/Slider/tests/snapshot/MDCSliderSnapshotTests.m index 3527f576e41..f5d05f26da1 100644 --- a/components/Slider/tests/snapshot/MDCSliderSnapshotTests.m +++ b/components/Slider/tests/snapshot/MDCSliderSnapshotTests.m @@ -18,6 +18,7 @@ #import "../../src/private/MDCSlider+Private.h" #import "../../src/private/MDCSlider_Subclassable.h" +#import "MaterialAvailability.h" #import "MaterialSlider.h" #import "MaterialThumbTrack.h" @@ -548,7 +549,7 @@ - (void)testNotHollowThumbAtStart { } - (void)testDynamicColorSupport { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given UIColor *sliderDynamicColor = @@ -591,7 +592,7 @@ - (void)testDynamicColorSupport { UIView *snapshotView = [self.slider mdc_addToBackgroundView]; [self snapshotVerifyViewForIOS13:snapshotView]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (void)testPreferredFontForAXXXLContentSizeCategory { From 2d8d6a082fbf046df5b108b03e4566fb1fe91ea8 Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Fri, 14 Feb 2020 10:48:30 -0500 Subject: [PATCH 16/47] Move static const assignment to MDCTextControl.m (#9701) This change makes the static const in MDCTextControl.h a FOUNDATION_EXTERN const. Related to [b/143312111](http://b/143312111). --- .../src/Shared/MDCTextControl.h | 2 +- .../src/Shared/MDCTextControl.m | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 components/private/TextControlsPrivate/src/Shared/MDCTextControl.m diff --git a/components/private/TextControlsPrivate/src/Shared/MDCTextControl.h b/components/private/TextControlsPrivate/src/Shared/MDCTextControl.h index 20806576eda..57a3daacd87 100644 --- a/components/private/TextControlsPrivate/src/Shared/MDCTextControl.h +++ b/components/private/TextControlsPrivate/src/Shared/MDCTextControl.h @@ -27,7 +27,7 @@ static inline UIFont *_Nonnull MDCTextControlDefaultUITextFieldFont() { return [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; } -static const CGFloat kMDCTextControlDefaultAnimationDuration = (CGFloat)0.15; +FOUNDATION_EXTERN const CGFloat kMDCTextControlDefaultAnimationDuration; @protocol MDCTextControlStyle; diff --git a/components/private/TextControlsPrivate/src/Shared/MDCTextControl.m b/components/private/TextControlsPrivate/src/Shared/MDCTextControl.m new file mode 100644 index 00000000000..3710fc0681d --- /dev/null +++ b/components/private/TextControlsPrivate/src/Shared/MDCTextControl.m @@ -0,0 +1,17 @@ +// Copyright 2019-present the Material Components for iOS authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "MDCTextControl.h" + +const CGFloat kMDCTextControlDefaultAnimationDuration = (CGFloat)0.15; From 652077c779b06fc6b44e9bbae237f47e083c053c Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Fri, 14 Feb 2020 11:40:36 -0500 Subject: [PATCH 17/47] [Material][Availability] Migrates Action sheet to MDCAvailability. (#9733) [Material][Availability] Migrates Action sheet to MDCAvailability. --- MaterialComponents.podspec | 2 ++ components/ActionSheet/src/MDCActionSheetController.m | 5 +++-- .../src/Theming/MDCActionSheetController+MaterialTheming.m | 5 +++-- .../tests/unit/Theming/MDCActionSheetThemingTest.m | 5 +++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 755970de4f8..816a5e5ca6e 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -62,6 +62,7 @@ Pod::Spec.new do |mdc| "components/#{component.base_name}/src/private/*.{h,m}" ] + component.dependency "MaterialComponents/Availability" component.dependency "MaterialComponents/BottomSheet" component.dependency "MaterialComponents/Elevation" component.dependency "MaterialComponents/Ink" @@ -82,6 +83,7 @@ Pod::Spec.new do |mdc| extension.public_header_files = "components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.h" extension.source_files = "components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.{h,m}", "components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/private/*.{h,m}" extension.dependency "MaterialComponents/#{extension.base_name.split('+')[0]}" + extension.dependency "MaterialComponents/Availability" extension.dependency "MaterialComponents/Elevation" extension.dependency "MaterialComponents/private/Color" extension.dependency "MaterialComponents/schemes/Container" diff --git a/components/ActionSheet/src/MDCActionSheetController.m b/components/ActionSheet/src/MDCActionSheetController.m index a2c005b55dd..daebfae8e08 100644 --- a/components/ActionSheet/src/MDCActionSheetController.m +++ b/components/ActionSheet/src/MDCActionSheetController.m @@ -14,6 +14,7 @@ #import "MDCActionSheetController.h" +#import "MaterialAvailability.h" #import "MaterialMath.h" #import "MaterialShadowElevations.h" #import "MaterialTypography.h" @@ -373,14 +374,14 @@ - (NSString *)message { - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { [super traitCollectionDidChange:previousTraitCollection]; -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { if ([self.traitCollection hasDifferentColorAppearanceComparedToTraitCollection:previousTraitCollection]) { [self.tableView reloadData]; } } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) if (self.traitCollectionDidChangeBlock) { self.traitCollectionDidChangeBlock(self, previousTraitCollection); diff --git a/components/ActionSheet/src/Theming/MDCActionSheetController+MaterialTheming.m b/components/ActionSheet/src/Theming/MDCActionSheetController+MaterialTheming.m index 0321f0f5971..a7bd3432b05 100644 --- a/components/ActionSheet/src/Theming/MDCActionSheetController+MaterialTheming.m +++ b/components/ActionSheet/src/Theming/MDCActionSheetController+MaterialTheming.m @@ -14,6 +14,7 @@ #import "MDCActionSheetController+MaterialTheming.h" +#import "MaterialAvailability.h" #import "MaterialColor.h" #import "MaterialShadowElevations.h" @@ -58,7 +59,7 @@ - (void)applyThemeWithColorScheme:(id)colorScheme { self.actionTintColor = [colorScheme.onSurfaceColor colorWithAlphaComponent:kMediumAlpha]; self.actionTextColor = [colorScheme.onSurfaceColor colorWithAlphaComponent:kHighAlpha]; self.rippleColor = [colorScheme.onSurfaceColor colorWithAlphaComponent:kRippleAlpha]; -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { self.traitCollectionDidChangeBlock = ^(MDCActionSheetController *_Nonnull actionSheet, UITraitCollection *_Nullable previousTraitCollection) { @@ -75,7 +76,7 @@ - (void)applyThemeWithColorScheme:(id)colorScheme { } }; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (void)applyBackgroundColorToActionSheet:(MDCActionSheetController *)actionSheet diff --git a/components/ActionSheet/tests/unit/Theming/MDCActionSheetThemingTest.m b/components/ActionSheet/tests/unit/Theming/MDCActionSheetThemingTest.m index d5d66354b26..1e8870810fc 100644 --- a/components/ActionSheet/tests/unit/Theming/MDCActionSheetThemingTest.m +++ b/components/ActionSheet/tests/unit/Theming/MDCActionSheetThemingTest.m @@ -17,6 +17,7 @@ #import "../../../src/private/MDCActionSheetHeaderView.h" #import "../../../src/private/MDCActionSheetItemTableViewCell.h" #import "MaterialActionSheet+Theming.h" +#import "MaterialAvailability.h" #import "MaterialShadowElevations.h" static const CGFloat kHighAlpha = (CGFloat)0.87; @@ -145,7 +146,7 @@ - (void)testActionSheetThemingTestWithHeaderAndMessage { - (void)assertTraitCollectionBlockAndElevationBlockForActionSheet: (MDCActionSheetController *)actionSheet { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { XCTAssertNotNil(self.actionSheet.mdc_elevationDidChangeBlock); XCTAssertNotNil(self.actionSheet.traitCollectionDidChangeBlock); @@ -156,7 +157,7 @@ - (void)assertTraitCollectionBlockAndElevationBlockForActionSheet: #else XCTAssertNil(self.actionSheet.mdc_elevationDidChangeBlock); XCTAssertNil(self.actionSheet.traitCollectionDidChangeBlock); -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } @end From 28a7fac63f7ee5f1787ab56190c8a579532810d6 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Fri, 14 Feb 2020 12:07:33 -0500 Subject: [PATCH 18/47] [Material][Availability] Migrates activity indicator to MDCAvailability. (#9735) * [Material][Availability] Migrates activity indicator to MDCAvailability. PiperOrigin-RevId: 293702405 * update build file Co-authored-by: Eric Lee --- components/ActivityIndicator/BUILD | 1 + .../tests/snapshot/MDCActivityIndicatorSnapshotTests.m | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/ActivityIndicator/BUILD b/components/ActivityIndicator/BUILD index eae89c9735e..0836224b164 100644 --- a/components/ActivityIndicator/BUILD +++ b/components/ActivityIndicator/BUILD @@ -99,6 +99,7 @@ mdc_snapshot_objc_library( name = "snapshot_test_lib", deps = [ ":ActivityIndicator", + "//components/Availability", ], ) diff --git a/components/ActivityIndicator/tests/snapshot/MDCActivityIndicatorSnapshotTests.m b/components/ActivityIndicator/tests/snapshot/MDCActivityIndicatorSnapshotTests.m index 54d61605268..3cf5a3704d6 100644 --- a/components/ActivityIndicator/tests/snapshot/MDCActivityIndicatorSnapshotTests.m +++ b/components/ActivityIndicator/tests/snapshot/MDCActivityIndicatorSnapshotTests.m @@ -15,6 +15,7 @@ #import "MaterialSnapshot.h" #import "MaterialActivityIndicator.h" +#import "MaterialAvailability.h" @interface MDCActivityIndicatorSnapshotFake : MDCActivityIndicator @property(nonatomic, strong) UITraitCollection *traitCollectionOverride; @@ -160,7 +161,7 @@ - (void)testDeterminateProgress100RTL { } - (void)testProgressViewSupportsDynamicColor { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given MDCActivityIndicatorSnapshotFake *indicator = @@ -187,7 +188,7 @@ - (void)testProgressViewSupportsDynamicColor { UIView *snapshotView = [indicator mdc_addToBackgroundView]; [self snapshotVerifyViewForIOS13:snapshotView]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } @end From 1cc8bb781d6142452f40d8265664077ba7c85710 Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Fri, 14 Feb 2020 12:21:53 -0500 Subject: [PATCH 19/47] [private] Make private/color use availability (#9738) Original CL: cl/293702453 --- MaterialComponents.podspec | 2 ++ components/private/Color/BUILD | 3 +++ .../private/Color/src/UIColor+MaterialDynamic.m | 10 ++++++---- .../Color/tests/unit/MaterialColorTests.m | 17 +++++++++-------- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 816a5e5ca6e..1591e5c3e94 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -1876,6 +1876,8 @@ Pod::Spec.new do |mdc| component.public_header_files = "components/private/#{component.base_name}/src/*.h" component.source_files = "components/private/#{component.base_name}/src/*.{h,m}" + component.dependency "MaterialComponents/Availability" + component.test_spec 'UnitTests' do |unit_tests| unit_tests.source_files = [ "components/private/#{component.base_name}/tests/unit/*.{h,m,swift}", diff --git a/components/private/Color/BUILD b/components/private/Color/BUILD index d60f2295c98..6a143a59fe5 100644 --- a/components/private/Color/BUILD +++ b/components/private/Color/BUILD @@ -23,6 +23,9 @@ licenses(["notice"]) # Apache 2.0 mdc_public_objc_library( name = "Color", + deps = [ + "//components/Availability", + ], ) mdc_unit_test_objc_library( diff --git a/components/private/Color/src/UIColor+MaterialDynamic.m b/components/private/Color/src/UIColor+MaterialDynamic.m index 0ac607987ba..31fd42b74b7 100644 --- a/components/private/Color/src/UIColor+MaterialDynamic.m +++ b/components/private/Color/src/UIColor+MaterialDynamic.m @@ -14,11 +14,13 @@ #import "UIColor+MaterialDynamic.h" +#import "MaterialAvailability.h" + @implementation UIColor (MaterialDynamic) + (UIColor *)colorWithUserInterfaceStyleDarkColor:(UIColor *)darkColor defaultColor:(UIColor *)defaultColor { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { return [UIColor colorWithDynamicProvider:^UIColor *_Nonnull(UITraitCollection *_Nonnull traitCollection) { @@ -33,11 +35,11 @@ + (UIColor *)colorWithUserInterfaceStyleDarkColor:(UIColor *)darkColor } #else return defaultColor; -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (UIColor *)mdc_resolvedColorWithTraitCollection:(UITraitCollection *)traitCollection { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { return [self resolvedColorWithTraitCollection:traitCollection]; } else { @@ -45,7 +47,7 @@ - (UIColor *)mdc_resolvedColorWithTraitCollection:(UITraitCollection *)traitColl } #else return self; -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } @end diff --git a/components/private/Color/tests/unit/MaterialColorTests.m b/components/private/Color/tests/unit/MaterialColorTests.m index 9965554e5a7..1e4b2cc89ed 100644 --- a/components/private/Color/tests/unit/MaterialColorTests.m +++ b/components/private/Color/tests/unit/MaterialColorTests.m @@ -14,6 +14,7 @@ #import +#import "MaterialAvailability.h" #import "MaterialMath.h" #import "UIColor+MaterialBlending.h" #import "UIColor+MaterialDynamic.h" @@ -34,7 +35,7 @@ @interface MaterialColorTests : XCTestCase @implementation MaterialColorTests - (void)testDynamicColorWhenUserInterfaceStyleIsDarkForiOS13 { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given UIColor *darkColor = UIColor.blackColor; @@ -50,11 +51,11 @@ - (void)testDynamicColorWhenUserInterfaceStyleIsDarkForiOS13 { XCTAssertEqualObjects([dynamicColor resolvedColorWithTraitCollection:traitCollection], darkColor); } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (void)testDynamicColorWhenUserInterfaceStyleIsLightForiOS13 { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given UIColor *darkColor = UIColor.blackColor; @@ -70,7 +71,7 @@ - (void)testDynamicColorWhenUserInterfaceStyleIsLightForiOS13 { XCTAssertEqualObjects([dynamicColor resolvedColorWithTraitCollection:traitCollection], lightColor); } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (void)testDynamicColorWhenUserInterfaceStyleIsLightForPreiOS13 { @@ -240,7 +241,7 @@ - (void)testResolvedColorForPreiOS13ResultsInSameColor { - (void)testResolvedColorForiOS13OrLaterReturnsCorrectColor { // Given UIColor *dynamicColor = UIColor.clearColor; -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { dynamicColor = [UIColor colorWithDynamicProvider:^UIColor *_Nonnull(UITraitCollection *_Nonnull traitCollection) { @@ -250,19 +251,19 @@ - (void)testResolvedColorForiOS13OrLaterReturnsCorrectColor { return UIColor.blueColor; }]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) // When UIColor *platformColor = dynamicColor; UIColor *mdcColor = dynamicColor; -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { UITraitCollection *fakeTraitCollection = [UITraitCollection traitCollectionWithUserInterfaceStyle:UIUserInterfaceStyleDark]; platformColor = [dynamicColor resolvedColorWithTraitCollection:fakeTraitCollection]; mdcColor = [dynamicColor mdc_resolvedColorWithTraitCollection:fakeTraitCollection]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) // Then XCTAssertEqualObjects(platformColor, mdcColor); From 1a221fe8b02aa2c1df77ad91a00f544c7eb1756a Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Fri, 14 Feb 2020 12:51:47 -0500 Subject: [PATCH 20/47] [Material][Availability] Migrates Snackbar to MDCAvailability. (#9739) [Material][Availability] Migrates Snackbar to MDCAvailability. --- MaterialComponents.podspec | 1 + components/Snackbar/BUILD | 1 + components/Snackbar/src/MDCSnackbarMessageView.m | 5 +++-- components/Snackbar/src/private/MDCSnackbarOverlayView.m | 5 +++-- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 1591e5c3e94..171b47b746c 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -1405,6 +1405,7 @@ Pod::Spec.new do |mdc| ] component.dependency "MaterialComponents/AnimationTiming" + component.dependency "MaterialComponents/Availability", component.dependency "MaterialComponents/Buttons" component.dependency "MaterialComponents/Elevation" component.dependency "MaterialComponents/OverlayWindow" diff --git a/components/Snackbar/BUILD b/components/Snackbar/BUILD index a7a32debf80..8ce47fd24b9 100644 --- a/components/Snackbar/BUILD +++ b/components/Snackbar/BUILD @@ -38,6 +38,7 @@ mdc_public_objc_library( ], deps = [ "//components/AnimationTiming", + "//components/Availability", "//components/Buttons", "//components/Elevation", "//components/OverlayWindow", diff --git a/components/Snackbar/src/MDCSnackbarMessageView.m b/components/Snackbar/src/MDCSnackbarMessageView.m index d50820f4222..0ba4d394b57 100644 --- a/components/Snackbar/src/MDCSnackbarMessageView.m +++ b/components/Snackbar/src/MDCSnackbarMessageView.m @@ -19,6 +19,7 @@ #import "MDCSnackbarMessageView.h" #import "MaterialAnimationTiming.h" +#import "MaterialAvailability.h" #import "MaterialMath.h" #import "MaterialShadowLayer.h" #import "MaterialTypography.h" @@ -110,10 +111,10 @@ static BOOL UIViewHasFocusedAccessibilityElement(UIView *view) { static const MDCFontTextStyle kMessageTextStyle = MDCFontTextStyleBody1; static const MDCFontTextStyle kButtonTextStyle = MDCFontTextStyleButton; -#if defined(__IPHONE_10_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0) +#if MDC_AVAILABLE_SDK_IOS(10_0) @interface MDCSnackbarMessageView () @end -#endif +#endif // MDC_AVAILABLE_SDK_IOS(10_0) @interface MDCSnackbarMessageView () diff --git a/components/Snackbar/src/private/MDCSnackbarOverlayView.m b/components/Snackbar/src/private/MDCSnackbarOverlayView.m index 5ae157cf096..4cc81d7fdfc 100644 --- a/components/Snackbar/src/private/MDCSnackbarOverlayView.m +++ b/components/Snackbar/src/private/MDCSnackbarOverlayView.m @@ -22,6 +22,7 @@ #import "MDCSnackbarMessageViewInternal.h" #import "MaterialAnimationTiming.h" #import "MaterialApplication.h" +#import "MaterialAvailability.h" #import "MaterialKeyboardWatcher.h" #import "MaterialOverlay.h" @@ -49,10 +50,10 @@ // The maximum height of the Snackbar. static const CGFloat kMaximumHeight = 80; -#if defined(__IPHONE_10_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0) +#if MDC_AVAILABLE_SDK_IOS(10_0) @interface MDCSnackbarOverlayView () @end -#endif +#endif // MDC_AVAILABLE_SDK_IOS(10_0) @interface MDCSnackbarOverlayView () From f168dd2806d5b9a069f08dd715cb8dc895db996e Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Fri, 14 Feb 2020 12:52:23 -0500 Subject: [PATCH 21/47] [Material][Availability] Migrates Ink to MDCAvailability. (#9741) [Material][Availability] Migrates Ink to MDCAvailability. --- MaterialComponents.podspec | 1 + components/Ink/BUILD | 1 + components/Ink/src/private/MDCLegacyInkLayer.m | 6 ++++-- components/Ink/tests/snapshot/MDCInkViewSnapshotTests.m | 9 +++++---- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 171b47b746c..7869f18ce9c 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -986,6 +986,7 @@ Pod::Spec.new do |mdc| "components/#{component.base_name}/src/private/*.{h,m}" ] + component.dependency "MaterialComponents/Availability" component.dependency "MaterialComponents/private/Color" component.dependency "MaterialComponents/private/Math" diff --git a/components/Ink/BUILD b/components/Ink/BUILD index 6f337129830..573b87e170a 100644 --- a/components/Ink/BUILD +++ b/components/Ink/BUILD @@ -33,6 +33,7 @@ mdc_public_objc_library( "QuartzCore", ], deps = [ + "//components/Availability", "//components/private/Math", ], ) diff --git a/components/Ink/src/private/MDCLegacyInkLayer.m b/components/Ink/src/private/MDCLegacyInkLayer.m index 326471ca60f..54bd0947f27 100644 --- a/components/Ink/src/private/MDCLegacyInkLayer.m +++ b/components/Ink/src/private/MDCLegacyInkLayer.m @@ -17,6 +17,8 @@ #import +#import "MaterialAvailability.h" + static inline CGPoint MDCLegacyInkLayerInterpolatePoint(CGPoint start, CGPoint end, CGFloat offsetPercent) { @@ -75,10 +77,10 @@ typedef NS_ENUM(NSInteger, MDCInkRippleState) { kInkRippleCancelled, }; -#if defined(__IPHONE_10_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_10_0) +#if MDC_AVAILABLE_SDK_IOS(10_0) @interface MDCLegacyInkLayerRipple () @end -#endif +#endif // MDC_AVAILABLE_SDK_IOS(10_0) @interface MDCLegacyInkLayerRipple () diff --git a/components/Ink/tests/snapshot/MDCInkViewSnapshotTests.m b/components/Ink/tests/snapshot/MDCInkViewSnapshotTests.m index 5b848f1b840..631fad7b050 100644 --- a/components/Ink/tests/snapshot/MDCInkViewSnapshotTests.m +++ b/components/Ink/tests/snapshot/MDCInkViewSnapshotTests.m @@ -14,6 +14,7 @@ #import "MaterialSnapshot.h" +#import "MaterialAvailability.h" #import "MaterialColor.h" #import "MaterialInk.h" @@ -106,7 +107,7 @@ - (void)testNewUnboundedInkWithinBounds { } - (void)testInkColorRespondsToDynamicColorBeforeInkBegan { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given self.inkView.inkColor = [UIColor colorWithUserInterfaceStyleDarkColor:UIColor.redColor @@ -122,11 +123,11 @@ - (void)testInkColorRespondsToDynamicColorBeforeInkBegan { // Then [self generateSnapshotForIOS13AndVerifyView]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (void)testInkColorRespondsToDynamicColorAfterInkBegan { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given self.inkView.inkColor = [UIColor colorWithUserInterfaceStyleDarkColor:UIColor.redColor @@ -143,7 +144,7 @@ - (void)testInkColorRespondsToDynamicColorAfterInkBegan { // Then [self generateSnapshotForIOS13AndVerifyView]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } @end From ae6d6d9a908c13f0466ad566ba7763925739dd49 Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Fri, 14 Feb 2020 12:53:26 -0500 Subject: [PATCH 22/47] [Material][Availability] Migrates Schemes to MDCAvailability (#9736) Original CL: cl/293702425 --- MaterialComponents.podspec | 2 ++ components/schemes/Color/BUILD | 1 + .../Color/tests/unit/MDCSemanticColorSchemeTests.m | 9 +++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 7869f18ce9c..713b21c277f 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -1778,6 +1778,8 @@ Pod::Spec.new do |mdc| scheme.ios.deployment_target = '9.0' scheme.public_header_files = "components/schemes/#{scheme.base_name}/src/*.h" scheme.source_files = "components/schemes/#{scheme.base_name}/src/*.{h,m}" + + scheme.dependency "MaterialComponents/Availability" scheme.dependency "MaterialComponents/private/Color" scheme.test_spec 'UnitTests' do |unit_tests| diff --git a/components/schemes/Color/BUILD b/components/schemes/Color/BUILD index 5c2ef73d5cf..76eee920208 100644 --- a/components/schemes/Color/BUILD +++ b/components/schemes/Color/BUILD @@ -26,6 +26,7 @@ licenses(["notice"]) # Apache 2.0 mdc_public_objc_library( name = "Color", deps = [ + "//components/Availability", "//components/private/Color", ], ) diff --git a/components/schemes/Color/tests/unit/MDCSemanticColorSchemeTests.m b/components/schemes/Color/tests/unit/MDCSemanticColorSchemeTests.m index 861695a458d..b978f0f833d 100644 --- a/components/schemes/Color/tests/unit/MDCSemanticColorSchemeTests.m +++ b/components/schemes/Color/tests/unit/MDCSemanticColorSchemeTests.m @@ -15,6 +15,7 @@ #import #import "MDCMath.h" +#import "MaterialAvailability.h" #import "MaterialColorScheme.h" static UIColor *ColorFromRGB(uint32_t colorValue) { @@ -93,7 +94,7 @@ - (void)testInitWithMaterialDefaultsDark { } - (void)testInitWithMaterialDefaults201907WhenUserInterfaceStyleIsDarkForiOS13 { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given MDCSemanticColorScheme *colorScheme = @@ -138,11 +139,11 @@ - (void)testInitWithMaterialDefaults201907WhenUserInterfaceStyleIsDarkForiOS13 { ColorFromRGB(0xFFFFFF)); XCTAssertEqual(colorScheme.elevationOverlayEnabledForDarkMode, YES); } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (void)testInitWithMaterialDefaults201907WhenUserInterfaceStyleIsLightForiOS13 { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given MDCSemanticColorScheme *colorScheme = @@ -187,7 +188,7 @@ - (void)testInitWithMaterialDefaults201907WhenUserInterfaceStyleIsLightForiOS13 ColorFromRGB(0x000000)); XCTAssertEqual(colorScheme.elevationOverlayEnabledForDarkMode, YES); } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (void)testInitWithMaterialDefaults201907WhenUserInterfaceStyleIsLightForPreiOS13 { From d962e50cf2564d07a6b823bf02170bdd7fb38f20 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Fri, 14 Feb 2020 13:20:12 -0500 Subject: [PATCH 23/47] [Material][Availability] Migrates Flexible Header to MDCAvailability. (#9744) [Material][Availability] Migrates Flexible Header to MDCAvailability. --- MaterialComponents.podspec | 1 + components/FlexibleHeader/BUILD | 1 + .../src/MDCFlexibleHeaderViewController.m | 11 ++++++----- .../tests/snapshot/MDCFlexibleHeaderSnapshotTests.m | 5 +++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 713b21c277f..473bf54810a 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -918,6 +918,7 @@ Pod::Spec.new do |mdc| ] component.dependency 'MDFTextAccessibility' + component/dependency "MaterialComponents/Availability" component.dependency "MaterialComponents/Elevation" component.dependency "MaterialComponents/ShadowElevations" component.dependency "MaterialComponents/ShadowLayer" diff --git a/components/FlexibleHeader/BUILD b/components/FlexibleHeader/BUILD index ceeb6c9bec7..9d21071c9ce 100644 --- a/components/FlexibleHeader/BUILD +++ b/components/FlexibleHeader/BUILD @@ -35,6 +35,7 @@ mdc_public_objc_library( "UIKit", ], deps = [ + "//components/Availability", "//components/Elevation", "//components/ShadowElevations", "//components/private/Application", diff --git a/components/FlexibleHeader/src/MDCFlexibleHeaderViewController.m b/components/FlexibleHeader/src/MDCFlexibleHeaderViewController.m index 3d690345e94..66dc5dc205e 100644 --- a/components/FlexibleHeader/src/MDCFlexibleHeaderViewController.m +++ b/components/FlexibleHeader/src/MDCFlexibleHeaderViewController.m @@ -14,14 +14,15 @@ #import "MDCFlexibleHeaderViewController.h" -#import "private/MDCFlexibleHeaderHairline.h" -#import "private/MDCFlexibleHeaderView+Private.h" +#import #import "MDCFlexibleHeaderContainerViewController.h" #import "MDCFlexibleHeaderView+ShiftBehavior.h" #import "MDCFlexibleHeaderView.h" #import "MaterialApplication.h" +#import "MaterialAvailability.h" #import "MaterialUIMetrics.h" -#import +#import "private/MDCFlexibleHeaderHairline.h" +#import "private/MDCFlexibleHeaderView+Private.h" @interface UIView () - (UIEdgeInsets)safeAreaInsets; // For pre-iOS 11 SDK targets. @@ -40,11 +41,11 @@ static inline UIStatusBarStyle StatusBarStyleOnBackgroundColor(UIColor *color) { return UIStatusBarStyleLightContent; } -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { return UIStatusBarStyleDarkContent; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) return UIStatusBarStyleDefault; } diff --git a/components/FlexibleHeader/tests/snapshot/MDCFlexibleHeaderSnapshotTests.m b/components/FlexibleHeader/tests/snapshot/MDCFlexibleHeaderSnapshotTests.m index 9c90f8f9c49..04308ef608a 100644 --- a/components/FlexibleHeader/tests/snapshot/MDCFlexibleHeaderSnapshotTests.m +++ b/components/FlexibleHeader/tests/snapshot/MDCFlexibleHeaderSnapshotTests.m @@ -16,6 +16,7 @@ #import +#import "MaterialAvailability.h" #import "MaterialFlexibleHeader.h" #import "MaterialShadowLayer.h" @@ -46,7 +47,7 @@ - (void)setUp { } - (void)testTraitCollectionDidChangeColorForShadow { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given MDCFlexibleHeaderTraitCollectionTestView *flexibleHeader = @@ -77,7 +78,7 @@ - (void)testTraitCollectionDidChangeColorForShadow { [flexibleHeader mdc_addToBackgroundViewWithInsets:UIEdgeInsetsMake(50, 50, 50, 50)]; [self snapshotVerifyViewForIOS13:snapshotView]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (void)testShadowColor { From 94e7b30c5152023c6be08f045c7d51b9f252efa1 Mon Sep 17 00:00:00 2001 From: Randall Li Date: Fri, 14 Feb 2020 13:41:59 -0500 Subject: [PATCH 24/47] Add @jakerockland to CODEOWNERS: NavigationDrawer (#9715) --- CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index 700635bbea4..26c0a24660b 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -29,7 +29,7 @@ /components/List @andrewoverton /components/MaskedTransition/ @jverkoey /components/NavigationBar/ @yarneo @jverkoey -/components/NavigationDrawer/ @yarneo +/components/NavigationDrawer/ @yarneo @jakerockland /components/OverlayWindow/ @yarneo /components/PageControl/ @randallli /components/Palettes/ @jverkoey From 88b5767bdb200438108c46f9eae96a8695ef91f7 Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Fri, 14 Feb 2020 13:43:47 -0500 Subject: [PATCH 25/47] [Dialogs] Migrate dialogs to availability (#9743) Original CL: cl/293702412 --- components/Dialogs/BUILD | 1 + components/Dialogs/src/MDCAlertController.m | 8 ++++---- .../Dialogs/src/private/MDCAlertControllerView+Private.h | 2 +- .../tests/snapshot/MDCAlertControllerActionsTests.m | 4 ++-- .../MDCAlertControllerCustomTraitCollectionTests.m | 9 +++++---- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/components/Dialogs/BUILD b/components/Dialogs/BUILD index 964e7af218f..d4f33024b27 100644 --- a/components/Dialogs/BUILD +++ b/components/Dialogs/BUILD @@ -174,6 +174,7 @@ mdc_snapshot_objc_library( ":Dialogs", ":Theming", ":private", + "//components/Availability", "//components/private/Color", "//components/schemes/Color", "//components/schemes/Container", diff --git a/components/Dialogs/src/MDCAlertController.m b/components/Dialogs/src/MDCAlertController.m index fe53631b802..c143eb6ccd5 100644 --- a/components/Dialogs/src/MDCAlertController.m +++ b/components/Dialogs/src/MDCAlertController.m @@ -14,14 +14,14 @@ #import "MDCAlertController.h" -#import "MaterialButtons.h" +#import #import "MDCAlertControllerView.h" #import "MDCDialogPresentationController.h" #import "MDCDialogTransitionController.h" -#import "UIViewController+MaterialDialogs.h" -#import "MaterialTypography.h" +#import "MaterialButtons.h" #import "MaterialMath.h" -#import +#import "MaterialTypography.h" +#import "UIViewController+MaterialDialogs.h" #import "private/MDCAlertActionManager.h" #import "private/MDCAlertController+Customize.h" diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.h b/components/Dialogs/src/private/MDCAlertControllerView+Private.h index f13a037b16e..f26b97e3e92 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.h +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.h @@ -14,8 +14,8 @@ #import -#import "MaterialButtons.h" #import "MDCAlertActionManager.h" +#import "MaterialButtons.h" @interface MDCAlertControllerView () diff --git a/components/Dialogs/tests/snapshot/MDCAlertControllerActionsTests.m b/components/Dialogs/tests/snapshot/MDCAlertControllerActionsTests.m index 1ca91a7b0d9..96e7067b345 100644 --- a/components/Dialogs/tests/snapshot/MDCAlertControllerActionsTests.m +++ b/components/Dialogs/tests/snapshot/MDCAlertControllerActionsTests.m @@ -14,9 +14,9 @@ #import "MaterialSnapshot.h" -#import "MaterialDialogs.h" -#import "MaterialDialogs+Theming.h" #import "MaterialContainerScheme.h" +#import "MaterialDialogs+Theming.h" +#import "MaterialDialogs.h" static NSString *const kTitleShortLatin = @"Title"; static NSString *const kMessageShortLatin = @"Message"; diff --git a/components/Dialogs/tests/snapshot/MDCAlertControllerCustomTraitCollectionTests.m b/components/Dialogs/tests/snapshot/MDCAlertControllerCustomTraitCollectionTests.m index cb35beec74f..336409d3ddb 100644 --- a/components/Dialogs/tests/snapshot/MDCAlertControllerCustomTraitCollectionTests.m +++ b/components/Dialogs/tests/snapshot/MDCAlertControllerCustomTraitCollectionTests.m @@ -18,6 +18,7 @@ #import #import "../../src/private/MDCDialogShadowedView.h" +#import "MaterialAvailability.h" #import "MaterialColor.h" #import "MaterialDialogs.h" #import "MaterialTypography.h" @@ -388,7 +389,7 @@ - (void)testAdjustsFontForContentSizeDownscalesUIFontMetricsFontsForSizeCategory #pragma mark - Dynamic Color - (void)testDynamicColorSupport { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given UIColor *titleColor = [UIColor colorWithUserInterfaceStyleDarkColor:UIColor.greenColor @@ -410,11 +411,11 @@ - (void)testDynamicColorSupport { mdc_addToBackgroundViewWithInsets:UIEdgeInsetsMake(50, 50, 50, 50)]; [self snapshotVerifyViewForIOS13:snapshotView]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (void)testDynamicColorSupportForTrackingView { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given UIColor *shadowColor = [UIColor colorWithUserInterfaceStyleDarkColor:UIColor.greenColor @@ -435,7 +436,7 @@ - (void)testDynamicColorSupportForTrackingView { [trackingView mdc_addToBackgroundViewWithInsets:UIEdgeInsetsMake(50, 50, 50, 50)]; [self snapshotVerifyViewForIOS13:snapshotView]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } @end From 02efdd188990305ff298fbad25fa48634974b1b4 Mon Sep 17 00:00:00 2001 From: Randall Li Date: Fri, 14 Feb 2020 14:59:36 -0500 Subject: [PATCH 26/47] [Material][Availability] Migrates Bottom Navigation to MDCAvailability. (#9717) [Material][Availability] Migrates Bottom Navigation to MDCAvailability. --- .../snapshot/MDCBottomNavigationBarSnapshotTests.m | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/BottomNavigation/tests/snapshot/MDCBottomNavigationBarSnapshotTests.m b/components/BottomNavigation/tests/snapshot/MDCBottomNavigationBarSnapshotTests.m index 2781fda6739..0f3b18898e6 100644 --- a/components/BottomNavigation/tests/snapshot/MDCBottomNavigationBarSnapshotTests.m +++ b/components/BottomNavigation/tests/snapshot/MDCBottomNavigationBarSnapshotTests.m @@ -17,13 +17,14 @@ #import "../../src/private/MDCBottomNavigationItemView.h" -#import "MDCBottomNavigationBar+MaterialTheming.h" -#import "MaterialBottomNavigation.h" -#import "MaterialInk.h" -#import "MaterialSnapshot.h" #import "supplemental/MDCBottomNavigationSnapshotTestMutableTraitCollection.h" #import "supplemental/MDCBottomNavigationSnapshotTestUtilities.h" #import "supplemental/MDCFakeBottomNavigationBar.h" +#import "MaterialAvailability.h" +#import "MaterialBottomNavigation.h" +#import "MDCBottomNavigationBar+MaterialTheming.h" +#import "MaterialInk.h" +#import "MaterialSnapshot.h" static const CGFloat kWidthWide = 1600; static const CGFloat kWidthNarrow = 240; @@ -414,7 +415,7 @@ - (void)testChangeUnselectedIconWhenSelected { } - (void)testShadowColorRespondsToDynamicColor { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given UIColor *dynamicColor = @@ -440,7 +441,7 @@ - (void)testShadowColorRespondsToDynamicColor { [self.navigationBar mdc_addToBackgroundViewWithInsets:UIEdgeInsetsMake(50, 50, 50, 50)]; [self snapshotVerifyViewForIOS13:snapshotView]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } #pragma mark - Badging From 33fbdfc3be62b4ff78951898b9abe6fc59041db4 Mon Sep 17 00:00:00 2001 From: Randall Li Date: Fri, 14 Feb 2020 15:02:13 -0500 Subject: [PATCH 27/47] [Material][Availability] Migrates Chips to MDCAvailability. (#9713) [Material][Availability] Migrates Chips to MDCAvailability. --- .../MDCChipViewCustomTraitCollectionSnapshotTests.m | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/Chips/tests/snapshot/MDCChipViewCustomTraitCollectionSnapshotTests.m b/components/Chips/tests/snapshot/MDCChipViewCustomTraitCollectionSnapshotTests.m index 3ea2a4910fd..a94f1d82b95 100644 --- a/components/Chips/tests/snapshot/MDCChipViewCustomTraitCollectionSnapshotTests.m +++ b/components/Chips/tests/snapshot/MDCChipViewCustomTraitCollectionSnapshotTests.m @@ -14,8 +14,9 @@ #import "MaterialSnapshot.h" -#import "MaterialChips+Theming.h" +#import "MaterialAvailability.h" #import "MaterialChips.h" +#import "MaterialChips+Theming.h" /** An MDCChipView subclass that allows the user to override the @c traitCollection property. @@ -74,7 +75,7 @@ - (void)generateSnapshotAndVerifyForView:(UIView *)view { } - (void)testDynamicColorSupport { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given UIColor *dynamicShadowColor = @@ -117,7 +118,7 @@ - (void)testDynamicColorSupport { UIView *snapshotView = [self.chip mdc_addToBackgroundView]; [self snapshotVerifyViewForIOS13:snapshotView]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (void)testPreferredFontForAXXXLContentSizeCategory { From 549e52668e3525bc41e728ccf3e158574951bdd1 Mon Sep 17 00:00:00 2001 From: Randall Li Date: Fri, 14 Feb 2020 15:10:37 -0500 Subject: [PATCH 28/47] [Material][Availability] Migrates Tabs to MDCAvailability. (#9716) [Material][Availability] Migrates Tabs to MDCAvailability. --- components/Tabs/BUILD | 1 + .../snapshot/MDCTabBarDynamicColorSnapshotTests.m | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/components/Tabs/BUILD b/components/Tabs/BUILD index 38a15531903..9bc25dea99d 100644 --- a/components/Tabs/BUILD +++ b/components/Tabs/BUILD @@ -180,6 +180,7 @@ mdc_snapshot_objc_library( ":Tabs", ":Theming", ":privateTabBarView", + "//components/Availability", "//components/AppBar", "//components/HeaderStackView", ], diff --git a/components/Tabs/tests/snapshot/MDCTabBarDynamicColorSnapshotTests.m b/components/Tabs/tests/snapshot/MDCTabBarDynamicColorSnapshotTests.m index c79703eea84..dd4d26b801a 100644 --- a/components/Tabs/tests/snapshot/MDCTabBarDynamicColorSnapshotTests.m +++ b/components/Tabs/tests/snapshot/MDCTabBarDynamicColorSnapshotTests.m @@ -14,6 +14,7 @@ #import "MaterialSnapshot.h" +#import "MaterialAvailability.h" #import "MaterialTabs+Theming.h" #import "MaterialTabs.h" @@ -95,7 +96,7 @@ - (void)setUp { self.containerScheme.colorScheme = [[MDCSemanticColorScheme alloc] initWithDefaults:MDCColorSchemeDefaultsMaterial201907]; -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { UIColor *dynamicOnPrimary = [UIColor colorWithDynamicProvider:^(UITraitCollection *traitCollection) { @@ -120,7 +121,7 @@ - (void)setUp { self.item3.badgeColor = dynamicBadgeColor; self.item4.badgeColor = dynamicBadgeColor; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (void)tearDown { @@ -142,7 +143,7 @@ - (void)generateSnapshotAndVerifyForView:(UIView *)view { } - (void)testColorSchemeDefaultsWithLightUserInterfaceStyle { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // When [self.tabBar applyPrimaryThemeWithScheme:self.containerScheme]; @@ -155,11 +156,11 @@ - (void)testColorSchemeDefaultsWithLightUserInterfaceStyle { UIView *snapshotView = [self.tabBar mdc_addToBackgroundView]; [self snapshotVerifyViewForIOS13:snapshotView]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } - (void)testColorSchemeDefaultsWithDarkUserInterfaceStyle { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // When self.tabBar.traitCollectionOverride = @@ -174,7 +175,7 @@ - (void)testColorSchemeDefaultsWithDarkUserInterfaceStyle { UIView *snapshotView = [self.tabBar mdc_addToBackgroundView]; [self snapshotVerifyViewForIOS13:snapshotView]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } @end From c58dc5c0b79dd450eff18c5307bb6427478d91da Mon Sep 17 00:00:00 2001 From: Randall Li Date: Fri, 14 Feb 2020 15:13:15 -0500 Subject: [PATCH 29/47] [Material][Availability] Migrates Action sheet to MDCAvailability. (#9732) [Material][Availability] Migrates Action sheet to MDCAvailability. From b677a3629e180a89f1e6a15256b45790ca794af5 Mon Sep 17 00:00:00 2001 From: Randall Li Date: Fri, 14 Feb 2020 15:15:09 -0500 Subject: [PATCH 30/47] [Material][Availability] Migrates cards to MDCAvailability. (#9728) [Material][Availability] Migrates cards to MDCAvailability. --- components/Cards/BUILD | 1 + .../snapshot/MDCCardCustomTraitCollectionSnapshotTests.m | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/Cards/BUILD b/components/Cards/BUILD index 2664d55d388..d5bf57844fa 100644 --- a/components/Cards/BUILD +++ b/components/Cards/BUILD @@ -113,6 +113,7 @@ mdc_snapshot_objc_library( deps = [ ":Cards", ":Theming", + "//components/Availability", ], ) diff --git a/components/Cards/tests/snapshot/MDCCardCustomTraitCollectionSnapshotTests.m b/components/Cards/tests/snapshot/MDCCardCustomTraitCollectionSnapshotTests.m index 800668ddc8c..1f96ff33fdf 100644 --- a/components/Cards/tests/snapshot/MDCCardCustomTraitCollectionSnapshotTests.m +++ b/components/Cards/tests/snapshot/MDCCardCustomTraitCollectionSnapshotTests.m @@ -14,6 +14,7 @@ #import "MaterialSnapshot.h" +#import "MaterialAvailability.h" #import "MaterialCards+Theming.h" #import "MaterialCards.h" @@ -71,7 +72,7 @@ - (void)generateSnapshotAndVerifyForView:(UIView *)view { } - (void)testShadowColorRespondsToDynamicColor { -#if defined(__IPHONE_13_0) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_13_0) +#if MDC_AVAILABLE_SDK_IOS(13_0) if (@available(iOS 13.0, *)) { // Given UIColor *dynamicColor = @@ -94,7 +95,7 @@ - (void)testShadowColorRespondsToDynamicColor { UIView *snapshotView = [self.card mdc_addToBackgroundView]; [self snapshotVerifyViewForIOS13:snapshotView]; } -#endif +#endif // MDC_AVAILABLE_SDK_IOS(13_0) } @end From 63867a371e35e91e2c69c709ca7359d55ad1ada0 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Fri, 14 Feb 2020 15:15:34 -0500 Subject: [PATCH 31/47] Fix invalid podspec (#9745) --- MaterialComponents.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 473bf54810a..05d67ea6c89 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -918,7 +918,7 @@ Pod::Spec.new do |mdc| ] component.dependency 'MDFTextAccessibility' - component/dependency "MaterialComponents/Availability" + component.dependency "MaterialComponents/Availability" component.dependency "MaterialComponents/Elevation" component.dependency "MaterialComponents/ShadowElevations" component.dependency "MaterialComponents/ShadowLayer" @@ -1407,7 +1407,7 @@ Pod::Spec.new do |mdc| ] component.dependency "MaterialComponents/AnimationTiming" - component.dependency "MaterialComponents/Availability", + component.dependency "MaterialComponents/Availability" component.dependency "MaterialComponents/Buttons" component.dependency "MaterialComponents/Elevation" component.dependency "MaterialComponents/OverlayWindow" From 3b89aecee05c95d49f331ce77427cc5731fbea99 Mon Sep 17 00:00:00 2001 From: Galia Kaufman Date: Fri, 14 Feb 2020 15:21:09 -0500 Subject: [PATCH 32/47] [Dialogs] Fix custom title icon view layout - top inset (#9721) Fix for the top layout inset of a custom title icon view, to allow for full-bleed images. --- .../Dialogs/src/private/MDCAlertControllerView+Private.m | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.m b/components/Dialogs/src/private/MDCAlertControllerView+Private.m index 4dd43d05c64..accb36123f6 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.m +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.m @@ -501,9 +501,8 @@ - (CGRect)titleIconFrameWithTitleSize:(CGSize)titleSize { UIUserInterfaceLayoutDirectionRightToLeft)) { titleIconLeftPadding = CGRectGetMaxX(titleFrame) - titleIconViewSize.width; } - CGRect titleIconFrame = CGRectMake(titleIconLeftPadding, MDCDialogContentInsets.top, - titleIconViewSize.width, titleIconViewSize.height); - return titleIconFrame; + CGFloat top = (self.titleIconImageView != nil) ? MDCDialogContentInsets.top : 0.0f; + return CGRectMake(titleIconLeftPadding, top, titleIconViewSize.width, titleIconViewSize.height); } // @param boundsSize should not include any internal margins or padding From c22493567ef7f25b46bf8d32e710188e2638a0ec Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Fri, 14 Feb 2020 16:27:39 -0500 Subject: [PATCH 33/47] Remove unneeded subspec (#9748) This change removes an empty subspec that was causing pod lib lint to fail. Closes #9747. --- MaterialComponents.podspec | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 05d67ea6c89..c6f3a77e903 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -1550,7 +1550,6 @@ Pod::Spec.new do |mdc| ] unit_tests.resources = "components/#{component.base_name}/tests/unit/resources/*" unit_tests.dependency "MaterialComponents/TextFields+ColorThemer" - unit_tests.dependency "MaterialComponents/TextFields+TypographyThemer" unit_tests.dependency "MaterialComponents/Themes" end end @@ -1704,7 +1703,6 @@ Pod::Spec.new do |mdc| ] extension.dependency "MaterialComponents/#{extension.base_name.split('+')[0]}" extension.dependency "MaterialComponents/#{extension.base_name.split('+')[0]}+ColorThemer" - extension.dependency "MaterialComponents/#{extension.base_name.split('+')[0]}+TypographyThemer" extension.dependency "MaterialComponents/schemes/Container" extension.test_spec 'UnitTests' do |unit_tests| @@ -1716,19 +1714,6 @@ Pod::Spec.new do |mdc| end end - mdc.subspec "TextFields+TypographyThemer" do |extension| - extension.ios.deployment_target = '9.0' - extension.public_header_files = [ - "components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.h" - ] - extension.source_files = [ - "components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/*.{h,m}" - ] - - extension.dependency "MaterialComponents/#{extension.base_name.split('+')[0]}" - extension.dependency "MaterialComponents/schemes/Typography" - end - # Themes mdc.subspec "Themes" do |component| From 60a531ca2ad9604c7559be0241aabec874cb87a4 Mon Sep 17 00:00:00 2001 From: Galia Kaufman Date: Fri, 14 Feb 2020 18:46:00 -0500 Subject: [PATCH 34/47] [Dialogs] Update adjustable insets comments (#9694) Minor fixes to description of the private properties (b/148802180). --- .../private/MDCAlertControllerView+Private.h | 46 +++++++++---------- .../private/MDCAlertControllerView+Private.m | 2 +- 2 files changed, 23 insertions(+), 25 deletions(-) diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.h b/components/Dialogs/src/private/MDCAlertControllerView+Private.h index f26b97e3e92..732d307869a 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.h +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.h @@ -56,66 +56,64 @@ @property(nonatomic, assign) BOOL adjustsFontForContentSizeCategoryWhenScaledFontIsUnavailable; /** - If YES, a new layout calculation that is customizable by the insets in this header file is used - to layout the dialog. If NO, we fall back to the legaccy layout calculation, ignoring all - customized inset values. + Whether adjustable insets mode is enabled for the dialog view. If set to @c + YES, a new layout calculation that is customizable by the insets in this header + file is used to layout the dialog. If set to @c NO, we fall back to the legacy + layout calculation, ignoring all customized inset values. Default value is @c NO. */ @property(nonatomic, assign) BOOL enableAdjustableInsets; /** - The margins around the title icon or the title icon view against the dialog - edges (top, leading, trailing) and the title (bottom). Note that the actual - bottom space is the smallest between titleImageInsets.bottom and - titleInsets.top. + The edge insets around the title icon or title icon view against the dialog + edges (top, leading, trailing) and the title (bottom). Note that + `titleIconInsets.bottom` takes precedence over `titleInsets.top`. Default value is UIEdgeInsets(top: 24, leading: 24, bottom: 20, trailing: 24). */ @property(nonatomic, assign) UIEdgeInsets titleIconInsets; /** - The margins around the title against the dialog frame and its neighbor elements. - If a title icon is presented, the minimum titleInsets.top and titleIconInsets.bottom is used. - If a message is presented, the minimum titleInsets.bottom and contentInsets.top is used. - If there is no message, titleInsets.bottom is used. + The edge insets around the title against the dialog edges or its neighbor + elements. If either the title icon or title icon view is present, then + `titleIconInsets.bottom` takes precedence over `titleInsets.top`. If there is + no message, `titleInsets.bottom` is ignored. + Default value is UIEdgeInsets(top: 24, leading: 24, bottom: 20, trailing: 24). */ @property(nonatomic, assign) UIEdgeInsets titleInsets; /** - The margins around the message, the content view or the accessory view against the dialog edges - and its neighbor elements, the title and the actions. - If a title is presented, the minimum of titleInsets.bottom and contentInsets.top is used. - The actual space between the content and the actions additive. It's is contentInsets.minimum PLUS - actionsInsets.top. - - Custom implementations of the accessory view will be given this frame to present their content in. + The edge insets around the content view (which includes the message and/or the + accessory view) against the dialog edges or its neighbor elements, the title + and the actions. Default value is UIEdgeInsets(top: 24, leading: 24, bottom: 28, trailing: 24). */ @property(nonatomic, assign) UIEdgeInsets contentInsets; /** - The margins around the actions against the dialog edges and its neighbot, the title or message. - Unlike other neigboring elements, icons top margin is additive, adding the actionsInsets.top to the - bottom of its top neigbor - either the title or the message. That is order to afford engou margin - space in case the content scrolls. + The edge insets around the actions against the dialog edges and its neighbor, + which could be any of the other elements: the message, accessory view, title, + title icon or title icon view. Default value is UIEdgeInsets(top: 8, leading: 8, bottom: 8, trailing: 8). */ @property(nonatomic, assign) UIEdgeInsets actionsInsets; /** - The space between action buttons in horizontal layout, if more than one button is presented. + The horizontal space between the action buttons when the buttons are + horizontally aligned, and if more than one button is presented. Default value is 8. */ @property(nonatomic, assign) CGFloat actionsHorizontalMargin; /** - The space between the action buttons in vertical layout, if more than one button is presented. + The vertical space between the action buttons when the buttons are vertically + aligned, and if more than one button is presented. Default value is 12. */ diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.m b/components/Dialogs/src/private/MDCAlertControllerView+Private.m index accb36123f6..45113239f47 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.m +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.m @@ -432,7 +432,7 @@ - (CGSize)actionButtonsSizeInVerticalLayout { } - (BOOL)hasTitleIcon { - return (0.0f < self.titleIconImageView.image.size.height); + return self.titleIconImageView.image.size.height > 0.f; } - (BOOL)hasTitle { From 735d2d28183cf977eb9508ac913a234f8e4d5bc3 Mon Sep 17 00:00:00 2001 From: Galia Kaufman Date: Fri, 14 Feb 2020 20:20:48 -0500 Subject: [PATCH 35/47] [Dialogs] Update adjustable insets values (#9695) Update adjustable insets values, so they can be used for adjustable insets that match current fixed insets (b/148802180). --- .../Dialogs/src/private/MDCAlertControllerView+Private.h | 4 ++-- .../Dialogs/src/private/MDCAlertControllerView+Private.m | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.h b/components/Dialogs/src/private/MDCAlertControllerView+Private.h index 732d307869a..892134749c9 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.h +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.h @@ -81,7 +81,7 @@ no message, `titleInsets.bottom` is ignored. - Default value is UIEdgeInsets(top: 24, leading: 24, bottom: 20, trailing: 24). + Default value is UIEdgeInsets(top: 24, leading: 24, bottom: 24, trailing: 24). */ @property(nonatomic, assign) UIEdgeInsets titleInsets; @@ -90,7 +90,7 @@ accessory view) against the dialog edges or its neighbor elements, the title and the actions. - Default value is UIEdgeInsets(top: 24, leading: 24, bottom: 28, trailing: 24). + Default value is UIEdgeInsets(top: 24, leading: 24, bottom: 24, trailing: 24). */ @property(nonatomic, assign) UIEdgeInsets contentInsets; diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.m b/components/Dialogs/src/private/MDCAlertControllerView+Private.m index 45113239f47..71444883f5a 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.m +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.m @@ -63,8 +63,8 @@ - (instancetype)initWithFrame:(CGRect)frame { self.enableAdjustableInsets = NO; self.titleIconInsets = UIEdgeInsetsMake(24.f, 24.f, 20.f, 24.f); - self.titleInsets = UIEdgeInsetsMake(24.f, 24.f, 20.f, 24.f); - self.contentInsets = UIEdgeInsetsMake(24.f, 24.f, 28.f, 24.f); + self.titleInsets = UIEdgeInsetsMake(24.f, 24.f, 24.f, 24.f); + self.contentInsets = UIEdgeInsetsMake(24.f, 24.f, 24.f, 24.f); self.actionsInsets = UIEdgeInsetsMake(8.f, 8.f, 8.f, 8.f); self.actionsHorizontalMargin = 8.f; self.actionsVerticalMargin = 12.f; From 6011e001f6cfc28ea28591d098a14b9cff4ca78f Mon Sep 17 00:00:00 2001 From: Galia Kaufman Date: Sat, 15 Feb 2020 11:29:27 -0500 Subject: [PATCH 36/47] [Dialogs] Refactor title frame calculations to accommodate adjustable insets (#9709) Compute adjustable insets for the title frame. Both adjustable and fixed insets mode are supported. Adjustable insets are hidden behind a feature flag (b/148802180). --- .../private/MDCAlertControllerView+Private.h | 4 +- .../private/MDCAlertControllerView+Private.m | 91 ++++++++++++++----- 2 files changed, 69 insertions(+), 26 deletions(-) diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.h b/components/Dialogs/src/private/MDCAlertControllerView+Private.h index 892134749c9..74b04888b4a 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.h +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.h @@ -70,7 +70,7 @@ edges (top, leading, trailing) and the title (bottom). Note that `titleIconInsets.bottom` takes precedence over `titleInsets.top`. - Default value is UIEdgeInsets(top: 24, leading: 24, bottom: 20, trailing: 24). + Default value is UIEdgeInsets(top: 24, leading: 24, bottom: 12, trailing: 24). */ @property(nonatomic, assign) UIEdgeInsets titleIconInsets; @@ -81,7 +81,7 @@ no message, `titleInsets.bottom` is ignored. - Default value is UIEdgeInsets(top: 24, leading: 24, bottom: 24, trailing: 24). + Default value is UIEdgeInsets(top: 24, leading: 24, bottom: 20, trailing: 24). */ @property(nonatomic, assign) UIEdgeInsets titleInsets; diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.m b/components/Dialogs/src/private/MDCAlertControllerView+Private.m index 71444883f5a..609b10b9c29 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.m +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.m @@ -62,8 +62,8 @@ - (instancetype)initWithFrame:(CGRect)frame { self.clipsToBounds = YES; self.enableAdjustableInsets = NO; - self.titleIconInsets = UIEdgeInsetsMake(24.f, 24.f, 20.f, 24.f); - self.titleInsets = UIEdgeInsetsMake(24.f, 24.f, 24.f, 24.f); + self.titleIconInsets = UIEdgeInsetsMake(24.f, 24.f, 12.f, 24.f); + self.titleInsets = UIEdgeInsetsMake(24.f, 24.f, 20.f, 24.f); self.contentInsets = UIEdgeInsetsMake(24.f, 24.f, 24.f, 24.f); self.actionsInsets = UIEdgeInsetsMake(8.f, 8.f, 8.f, 8.f); self.actionsHorizontalMargin = 8.f; @@ -443,13 +443,36 @@ - (BOOL)hasMessage { return self.message.length > 0; } +- (BOOL)hasAccessoryView { + CGSize accessoryViewSize = [self.accessoryView systemLayoutSizeFittingSize:CGRectInfinite.size]; + return accessoryViewSize.height > 0.f; +} + +- (CGFloat)titleIconInsetBottom { + return [self hasTitleIcon] && [self hasTitle] ? self.titleIconInsets.bottom : 0.0f; +} + +- (CGFloat)titleInsetTop { + return [self hasTitleIcon] ? self.titleIconInsets.top : self.titleInsets.top; +} + +- (CGFloat)titleInsetBottom { + if (![self hasMessage] && ![self hasAccessoryView]) { + return 0.0f; + } else if ([self hasTitle] || [self hasTitleIcon]) { + return self.titleInsets.bottom; + } else { + return 0.0f; + } +} + - (CGFloat)contentInternalVerticalPadding { return (([self hasTitle] || [self hasTitleIcon]) && [self hasMessage]) ? MDCDialogContentVerticalPadding : 0.0f; } -- (CGFloat)contentTitleIconVerticalPadding { +- (CGFloat)fixedInsetsContentTitleIconVerticalPadding { return ([self hasTitle] && [self hasTitleIcon]) ? MDCDialogTitleIconVerticalPadding : 0.0f; } @@ -471,14 +494,18 @@ - (CGSize)titleIconViewSize { return titleIconViewSize; } -- (CGFloat)titleTop { - return MDCDialogContentInsets.top + [self contentTitleIconVerticalPadding] + - [self titleIconViewSize].height; -} - - (CGRect)titleFrameWithTitleSize:(CGSize)titleSize { - return CGRectMake(MDCDialogContentInsets.left, [self titleTop], titleSize.width, - titleSize.height); + CGFloat titleTop = 0.0f; + CGFloat leftInset = 0.0f; + if (self.enableAdjustableInsets) { + leftInset = self.titleInsets.left; + titleTop = [self titleIconViewSize].height + [self titleInsetTop] + [self titleIconInsetBottom]; + } else { + leftInset = MDCDialogContentInsets.left; + titleTop = MDCDialogContentInsets.top + [self fixedInsetsContentTitleIconVerticalPadding] + + [self titleIconViewSize].height; + } + return CGRectMake(leftInset, titleTop, titleSize.width, titleSize.height); } - (CGRect)messageFrameWithSize:(CGSize)messageSize { @@ -547,26 +574,42 @@ - (CGSize)calculateContentSizeThatFitsWidth:(CGFloat)boundingWidth { return contentSize; } -// @param boundingWidth should not include any internal margins or padding +/** + Calculate the size of the title frame, which includes an optional title, optional title icon and + optional icon view. + + @param boundingWidth should not include any internal margins or padding +*/ - (CGSize)calculateTitleViewSizeThatFitsWidth:(CGFloat)boundingWidth { + CGFloat leftInset = + self.enableAdjustableInsets + ? MAX(MAX(self.titleInsets.left, self.titleIconInsets.left), self.contentInsets.left) + : MDCDialogContentInsets.left; + CGFloat rightInset = + self.enableAdjustableInsets + ? MAX(MAX(self.titleInsets.right, self.titleIconInsets.right), self.contentInsets.right) + : MDCDialogContentInsets.right; + CGSize boundsSize = CGRectInfinite.size; - boundsSize.width = boundingWidth - MDCDialogContentInsets.left - MDCDialogContentInsets.right; + boundsSize.width = boundingWidth - leftInset - rightInset; CGSize titleSize = [self.titleLabel sizeThatFits:boundsSize]; CGSize messageSize = [self.messageLabel sizeThatFits:boundsSize]; CGSize accessoryViewSize = [self.accessoryView systemLayoutSizeFittingSize:boundsSize]; - CGFloat contentWidth = MAX(MAX(titleSize.width, messageSize.width), accessoryViewSize.width) + - MDCDialogContentInsets.left + MDCDialogContentInsets.right; - - CGFloat contentHeight = MDCDialogContentInsets.top + [self titleIconViewSize].height + - [self contentTitleIconVerticalPadding] + titleSize.height + - [self contentInternalVerticalPadding]; - - CGSize contentSize; - contentSize.width = (CGFloat)ceil(contentWidth); - contentSize.height = (CGFloat)ceil(contentHeight); - - return contentSize; + CGFloat titleWidth = MAX(MAX(titleSize.width, messageSize.width), accessoryViewSize.width) + + leftInset + rightInset; + CGFloat totalElementsHeight = [self titleIconViewSize].height + titleSize.height; + + CGFloat titleHeight = 0.f; + if (self.enableAdjustableInsets) { + titleHeight = totalElementsHeight + [self titleInsetTop] + [self titleIconInsetBottom] + + [self titleInsetBottom]; + } else { + titleHeight = totalElementsHeight + MDCDialogContentInsets.top + + [self fixedInsetsContentTitleIconVerticalPadding] + + [self contentInternalVerticalPadding]; + } + return CGSizeMake((CGFloat)ceil(titleWidth), (CGFloat)ceil(titleHeight)); } // @param boundingWidth should not include any internal margins or padding From 05e38ef7387ff7bb455978031339ecda3ae19893 Mon Sep 17 00:00:00 2001 From: Galia Kaufman Date: Sat, 15 Feb 2020 12:06:58 -0500 Subject: [PATCH 37/47] [Dialogs] Refactor content frame calculations to accommodate adjustable insets (#9710) Refactor content frame calculations to enable both fixed and adjustable insets layout. Use enableAdjustableInsets to toggle between adjustable and fixed insets (b/148802180). --- .../private/MDCAlertControllerView+Private.m | 77 +++++++++++++------ 1 file changed, 53 insertions(+), 24 deletions(-) diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.m b/components/Dialogs/src/private/MDCAlertControllerView+Private.m index 609b10b9c29..04a21d7540b 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.m +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.m @@ -466,7 +466,19 @@ - (CGFloat)titleInsetBottom { } } +- (CGFloat)accessoryVerticalInset { + return [self hasMessage] && [self hasAccessoryView] ? self.accessoryViewVerticalInset : 0.f; +} + - (CGFloat)contentInternalVerticalPadding { + if (self.enableAdjustableInsets) { + return [self titleInsetBottom]; + } else { + return [self fixedInsetsContentInternalVerticalPadding]; + } +} + +- (CGFloat)fixedInsetsContentInternalVerticalPadding { return (([self hasTitle] || [self hasTitleIcon]) && [self hasMessage]) ? MDCDialogContentVerticalPadding : 0.0f; @@ -476,7 +488,7 @@ - (CGFloat)fixedInsetsContentTitleIconVerticalPadding { return ([self hasTitle] && [self hasTitleIcon]) ? MDCDialogTitleIconVerticalPadding : 0.0f; } -- (CGFloat)contentAccessoryVerticalPaddingWithFittingSize:(CGSize)boundsSize { +- (CGFloat)fixedInsetsContentAccessoryVerticalPaddingWithFittingSize:(CGSize)boundsSize { CGSize accessoryViewSize = [self.accessoryView systemLayoutSizeFittingSize:boundsSize]; return (([self hasTitle] || [self hasTitleIcon] || [self hasMessage]) && (0.0 < accessoryViewSize.height)) @@ -509,16 +521,17 @@ - (CGRect)titleFrameWithTitleSize:(CGSize)titleSize { } - (CGRect)messageFrameWithSize:(CGSize)messageSize { - CGRect messageFrame = - CGRectMake(MDCDialogContentInsets.left, 0, messageSize.width, messageSize.height); - return messageFrame; + CGFloat leftInset = + self.enableAdjustableInsets ? self.contentInsets.left : MDCDialogContentInsets.left; + return CGRectMake(leftInset, 0, messageSize.width, messageSize.height); } - (CGRect)titleIconFrameWithTitleSize:(CGSize)titleSize { CGSize titleIconViewSize = [self titleIconViewSize]; CGRect titleFrame = [self titleFrameWithTitleSize:titleSize]; // match the titleIcon alignment to the title alignment - CGFloat titleIconLeftPadding = MDCDialogContentInsets.left; + CGFloat titleIconLeftPadding = + self.enableAdjustableInsets ? self.titleInsets.left : MDCDialogContentInsets.left; if (self.titleAlignment == NSTextAlignmentCenter) { titleIconLeftPadding = CGRectGetMinX(titleFrame) + (CGRectGetWidth(titleFrame) - titleIconViewSize.width) / 2.0f; @@ -552,26 +565,34 @@ - (CGSize)calculatePreferredContentSizeForBounds:(CGSize)boundsSize { // @param boundingWidth should not include any internal margins or padding - (CGSize)calculateContentSizeThatFitsWidth:(CGFloat)boundingWidth { + CGFloat leftInset = + self.enableAdjustableInsets + ? MAX(MAX(self.titleInsets.left, self.titleIconInsets.left), self.contentInsets.left) + : MDCDialogContentInsets.left; + CGFloat rightInset = + self.enableAdjustableInsets + ? MAX(MAX(self.titleInsets.right, self.titleIconInsets.right), self.contentInsets.right) + : MDCDialogContentInsets.right; + CGSize boundsSize = CGRectInfinite.size; - boundsSize.width = boundingWidth - MDCDialogContentInsets.left - MDCDialogContentInsets.right; + boundsSize.width = boundingWidth - leftInset - rightInset; CGSize titleSize = [self.titleLabel sizeThatFits:boundsSize]; CGSize messageSize = [self.messageLabel sizeThatFits:boundsSize]; CGSize accessoryViewSize = [self.accessoryView systemLayoutSizeFittingSize:boundsSize]; CGFloat contentWidth = MAX(MAX(titleSize.width, messageSize.width), accessoryViewSize.width) + - MDCDialogContentInsets.left + MDCDialogContentInsets.right; - - CGFloat contentAccessoryVerticalPadding = - [self contentAccessoryVerticalPaddingWithFittingSize:boundsSize]; - CGFloat contentHeight = messageSize.height + contentAccessoryVerticalPadding + - accessoryViewSize.height + MDCDialogContentInsets.bottom; - - CGSize contentSize; - contentSize.width = (CGFloat)ceil(contentWidth); - contentSize.height = (CGFloat)ceil(contentHeight); + leftInset + rightInset; + CGFloat totalElementsHeight = messageSize.height + accessoryViewSize.height; - return contentSize; + CGFloat contentHeight; + if (self.enableAdjustableInsets) { + contentHeight = totalElementsHeight + [self accessoryVerticalInset] + self.contentInsets.bottom; + } else { + contentHeight = totalElementsHeight + MDCDialogContentInsets.bottom + + [self fixedInsetsContentAccessoryVerticalPaddingWithFittingSize:boundsSize]; + } + return CGSizeMake((CGFloat)ceil(contentWidth), (CGFloat)ceil(contentHeight)); } /** @@ -683,7 +704,10 @@ - (void)layoutSubviews { self.contentScrollView.contentSize = contentRect.size; // Place Content in contentScrollView - boundsSize.width = boundsSize.width - MDCDialogContentInsets.left - MDCDialogContentInsets.right; + CGFloat horizontalContentInsets = + self.enableAdjustableInsets ? self.contentInsets.left + self.contentInsets.right + : MDCDialogContentInsets.left + MDCDialogContentInsets.right; + boundsSize.width = boundsSize.width - horizontalContentInsets; CGSize titleSize = [self.titleLabel sizeThatFits:boundsSize]; titleSize.width = boundsSize.width; @@ -696,15 +720,20 @@ - (void)layoutSubviews { verticalFittingPriority:UILayoutPriorityFittingSizeLevel]; accessoryViewSize.width = boundsSize.width; - boundsSize.width = boundsSize.width + MDCDialogContentInsets.left + MDCDialogContentInsets.right; + boundsSize.width = boundsSize.width + horizontalContentInsets; + + CGFloat accessoryVerticalInset = + self.enableAdjustableInsets + ? [self accessoryVerticalInset] + : [self fixedInsetsContentAccessoryVerticalPaddingWithFittingSize:boundsSize]; + CGFloat leftInset = + self.enableAdjustableInsets ? self.contentInsets.left : MDCDialogContentInsets.left; - CGFloat contentAccessoryVerticalPadding = - [self contentAccessoryVerticalPaddingWithFittingSize:boundsSize]; CGRect titleFrame = [self titleFrameWithTitleSize:titleSize]; CGRect messageFrame = [self messageFrameWithSize:messageSize]; - CGRect accessoryViewFrame = CGRectMake( - MDCDialogContentInsets.left, CGRectGetMaxY(messageFrame) + contentAccessoryVerticalPadding, - accessoryViewSize.width, accessoryViewSize.height); + CGRect accessoryViewFrame = + CGRectMake(leftInset, CGRectGetMaxY(messageFrame) + accessoryVerticalInset, + accessoryViewSize.width, accessoryViewSize.height); CGRect titleIconImageViewRect = [self titleIconFrameWithTitleSize:titleSize]; if (self.titleIconImageView != nil) { From a40a4eb171994b72de473b974131350bed870b1b Mon Sep 17 00:00:00 2001 From: "copybara-service[bot]" <56741989+copybara-service[bot]@users.noreply.github.com> Date: Sun, 16 Feb 2020 17:24:44 -0500 Subject: [PATCH 38/47] [Dialogs] Refactor action frame calculations to accommodate adjustable insets (5 seconds ago) (#9656) Co-authored-by: Galia Kaufman , Iryna Berezan Enable adjustable insets for Dialogs actions. Both fixed and adjustable layout are supported. The adjustable layout is hidden behind a feature flag (b/148802180). --- .../private/MDCAlertControllerView+Private.m | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.m b/components/Dialogs/src/private/MDCAlertControllerView+Private.m index 04a21d7540b..70c318d5d68 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.m +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.m @@ -393,10 +393,11 @@ - (void)setEnableRippleBehavior:(BOOL)enableRippleBehavior { - (CGSize)actionButtonsSizeInHorizontalLayout { CGSize size = CGSizeZero; + UIEdgeInsets insets = self.enableAdjustableInsets ? self.actionsInsets : MDCDialogActionsInsets; NSArray *buttons = self.actionManager.buttonsInActionOrder; if (0 < buttons.count) { CGFloat maxButtonHeight = MDCDialogActionButtonMinimumHeight; - size.width = MDCDialogActionsInsets.left + MDCDialogActionsInsets.right; + size.width = insets.left + insets.right; for (UIButton *button in buttons) { CGSize buttonSize = [button sizeThatFits:size]; size.width += buttonSize.width; @@ -405,7 +406,7 @@ - (CGSize)actionButtonsSizeInHorizontalLayout { size.width += MDCDialogActionsHorizontalPadding; } } - size.height = MDCDialogActionsInsets.top + maxButtonHeight + MDCDialogActionsInsets.bottom; + size.height = insets.top + maxButtonHeight + insets.bottom; } return size; @@ -415,8 +416,9 @@ - (CGSize)actionButtonsSizeInVerticalLayout { CGSize size = CGSizeZero; NSArray *buttons = self.actionManager.buttonsInActionOrder; if (0 < buttons.count) { - size.height = MDCDialogActionsInsets.top + MDCDialogActionsInsets.bottom; - size.width = MDCDialogActionsInsets.left + MDCDialogActionsInsets.right; + UIEdgeInsets insets = self.enableAdjustableInsets ? self.actionsInsets : MDCDialogActionsInsets; + size.height = insets.top + insets.bottom; + size.width = insets.left + insets.right; for (UIButton *button in buttons) { CGSize buttonSize = [button sizeThatFits:size]; buttonSize.height = MAX(buttonSize.height, MDCDialogActionButtonMinimumHeight); @@ -756,14 +758,16 @@ - (void)layoutSubviews { actionsFrame.size.height = actionSize.height; } self.actionsScrollView.contentSize = actionsFrame.size; + UIEdgeInsets actionsInsets = + self.enableAdjustableInsets ? self.actionsInsets : MDCDialogActionsInsets; // Place buttons in actionsScrollView if (self.isVerticalActionsLayout) { CGPoint buttonCenter; buttonCenter.x = self.actionsScrollView.contentSize.width / 2.0f; - buttonCenter.y = self.actionsScrollView.contentSize.height - MDCDialogActionsInsets.bottom; - CGFloat maxButtonWidth = self.actionsScrollView.contentSize.width - - (MDCDialogActionsInsets.left + MDCDialogActionsInsets.right); + buttonCenter.y = self.actionsScrollView.contentSize.height - actionsInsets.bottom; + CGFloat maxButtonWidth = + self.actionsScrollView.contentSize.width - (actionsInsets.left + actionsInsets.right); for (UIButton *button in buttons) { CGRect buttonRect = button.bounds; @@ -783,8 +787,8 @@ - (void)layoutSubviews { } } else { CGPoint buttonOrigin = CGPointZero; - buttonOrigin.x = self.actionsScrollView.contentSize.width - MDCDialogActionsInsets.right; - buttonOrigin.y = MDCDialogActionsInsets.top; + buttonOrigin.x = self.actionsScrollView.contentSize.width - actionsInsets.right; + buttonOrigin.y = actionsInsets.top; for (UIButton *button in buttons) { CGRect buttonRect = button.frame; From b3ba7e6d2c9deeb7c155f2242cad3c10c15f3e39 Mon Sep 17 00:00:00 2001 From: "copybara-service[bot]" <56741989+copybara-service[bot]@users.noreply.github.com> Date: Sun, 16 Feb 2020 17:37:22 -0500 Subject: [PATCH 39/47] [Dialogs] Refactor title-icon, title-icon-view frames calculations to accommodate adjustable insets (#9657) Co-authored-by: Galia Kaufman , Iryna Berezan Use titleIconInsets to customize the insets around the title-icon or title-icon-view (b/148802180), --- .../private/MDCAlertControllerView+Private.m | 40 ++++++++++--------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.m b/components/Dialogs/src/private/MDCAlertControllerView+Private.m index 70c318d5d68..58552c6e8a7 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.m +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.m @@ -433,7 +433,11 @@ - (CGSize)actionButtonsSizeInVerticalLayout { return size; } -- (BOOL)hasTitleIcon { +- (BOOL)hasTitleIconOrImage { + return self.titleIconImageView.image.size.height > 0.f || self.titleIconView != nil; +} + +- (BOOL)fixedLayoutHasTitleIcon { return self.titleIconImageView.image.size.height > 0.f; } @@ -451,17 +455,17 @@ - (BOOL)hasAccessoryView { } - (CGFloat)titleIconInsetBottom { - return [self hasTitleIcon] && [self hasTitle] ? self.titleIconInsets.bottom : 0.0f; + return [self hasTitleIconOrImage] && [self hasTitle] ? self.titleIconInsets.bottom : 0.0f; } - (CGFloat)titleInsetTop { - return [self hasTitleIcon] ? self.titleIconInsets.top : self.titleInsets.top; + return [self hasTitleIconOrImage] ? self.titleIconInsets.top : self.titleInsets.top; } - (CGFloat)titleInsetBottom { if (![self hasMessage] && ![self hasAccessoryView]) { return 0.0f; - } else if ([self hasTitle] || [self hasTitleIcon]) { + } else if ([self hasTitle] || [self hasTitleIconOrImage]) { return self.titleInsets.bottom; } else { return 0.0f; @@ -469,30 +473,27 @@ - (CGFloat)titleInsetBottom { } - (CGFloat)accessoryVerticalInset { - return [self hasMessage] && [self hasAccessoryView] ? self.accessoryViewVerticalInset : 0.f; + return ([self hasMessage] && [self hasAccessoryView]) ? self.accessoryViewVerticalInset : 0.f; } - (CGFloat)contentInternalVerticalPadding { if (self.enableAdjustableInsets) { return [self titleInsetBottom]; } else { - return [self fixedInsetsContentInternalVerticalPadding]; + return (([self hasTitle] || [self fixedLayoutHasTitleIcon]) && [self hasMessage]) + ? MDCDialogContentVerticalPadding + : 0.0f; } } -- (CGFloat)fixedInsetsContentInternalVerticalPadding { - return (([self hasTitle] || [self hasTitleIcon]) && [self hasMessage]) - ? MDCDialogContentVerticalPadding - : 0.0f; -} - - (CGFloat)fixedInsetsContentTitleIconVerticalPadding { - return ([self hasTitle] && [self hasTitleIcon]) ? MDCDialogTitleIconVerticalPadding : 0.0f; + return ([self hasTitle] && [self fixedLayoutHasTitleIcon]) ? MDCDialogTitleIconVerticalPadding + : 0.0f; } - (CGFloat)fixedInsetsContentAccessoryVerticalPaddingWithFittingSize:(CGSize)boundsSize { CGSize accessoryViewSize = [self.accessoryView systemLayoutSizeFittingSize:boundsSize]; - return (([self hasTitle] || [self hasTitleIcon] || [self hasMessage]) && + return (([self hasTitle] || [self fixedLayoutHasTitleIcon] || [self hasMessage]) && (0.0 < accessoryViewSize.height)) ? MDCDialogContentVerticalPadding : 0.0f; @@ -531,20 +532,21 @@ - (CGRect)messageFrameWithSize:(CGSize)messageSize { - (CGRect)titleIconFrameWithTitleSize:(CGSize)titleSize { CGSize titleIconViewSize = [self titleIconViewSize]; CGRect titleFrame = [self titleFrameWithTitleSize:titleSize]; + UIEdgeInsets insets = self.enableAdjustableInsets ? self.titleIconInsets : MDCDialogContentInsets; + // match the titleIcon alignment to the title alignment - CGFloat titleIconLeftPadding = + CGFloat leftInset = self.enableAdjustableInsets ? self.titleInsets.left : MDCDialogContentInsets.left; if (self.titleAlignment == NSTextAlignmentCenter) { - titleIconLeftPadding = + leftInset = CGRectGetMinX(titleFrame) + (CGRectGetWidth(titleFrame) - titleIconViewSize.width) / 2.0f; } else if (self.titleAlignment == NSTextAlignmentRight || (self.titleAlignment == NSTextAlignmentNatural && [self mdf_effectiveUserInterfaceLayoutDirection] == UIUserInterfaceLayoutDirectionRightToLeft)) { - titleIconLeftPadding = CGRectGetMaxX(titleFrame) - titleIconViewSize.width; + leftInset = CGRectGetMaxX(titleFrame) - titleIconViewSize.width; } - CGFloat top = (self.titleIconImageView != nil) ? MDCDialogContentInsets.top : 0.0f; - return CGRectMake(titleIconLeftPadding, top, titleIconViewSize.width, titleIconViewSize.height); + return CGRectMake(leftInset, insets.top, titleIconViewSize.width, titleIconViewSize.height); } // @param boundsSize should not include any internal margins or padding From e2bff768df18fc24f91857447ddb8992071e778f Mon Sep 17 00:00:00 2001 From: "copybara-service[bot]" <56741989+copybara-service[bot]@users.noreply.github.com> Date: Sun, 16 Feb 2020 23:42:53 -0500 Subject: [PATCH 40/47] [Dialogs] Add snapshot tests for additional dialog configurations. (#9646) Co-authored-by: Galia Kaufman [Dialogs] Add snapshot tests for various configurations of elements within Dialogs (b/148802180). --- .../MDCAlertControllerConfigurationsTests.m | 378 ++++++++++++++++++ 1 file changed, 378 insertions(+) create mode 100644 components/Dialogs/tests/snapshot/MDCAlertControllerConfigurationsTests.m diff --git a/components/Dialogs/tests/snapshot/MDCAlertControllerConfigurationsTests.m b/components/Dialogs/tests/snapshot/MDCAlertControllerConfigurationsTests.m new file mode 100644 index 00000000000..375c2783e0f --- /dev/null +++ b/components/Dialogs/tests/snapshot/MDCAlertControllerConfigurationsTests.m @@ -0,0 +1,378 @@ +// Copyright 2020-present the Material Components for iOS authors. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#import "MaterialSnapshot.h" + +#import "MDCAlertControllerView+Private.h" +#import "MaterialContainerScheme.h" +#import "MaterialDialogs+Theming.h" +#import "MaterialDialogs.h" + +static NSString *const kTitleShortLatin = @"Title"; +static NSString *const kMessageShortLatin = @"A short message."; +static NSString *const kMessageLongLatin = + @"Lorem ipsum dolor sit amet, consul docendi indoctum id quo, ad unum suavitate incorrupte " + "sea. An his meis consul cotidieque, eam recteque mnesarchum et, mundi volumus cu cum. Quo " + "falli dicunt an. Praesent molestiae vim ut."; + +@interface MDCAlertControllerConfigurationsTests : MDCSnapshotTestCase +@property(nonatomic, strong) MDCAlertController *alertController; +@property(nonatomic, strong) MDCContainerScheme *containerScheme2019; +@property(nonatomic, strong) UIImage *titleIcon; +@property(nonatomic, strong) UIImage *titleImage; +@property(nonatomic, strong) UIView *accessoryView; +@end + +@implementation MDCAlertControllerConfigurationsTests + +- (void)setUp { + [super setUp]; + + // Uncomment below to recreate all the goldens (or add the following line to the specific + // test you wish to recreate the golden for). + // self.recordMode = YES; + + self.alertController = [MDCAlertController alertControllerWithTitle:nil message:nil]; + [self addOutlinedActionWithTitle:@"OK"]; + + self.alertController.view.bounds = CGRectMake(0.f, 0.f, 300.f, 300.f); + + // Uncomment to test with the adjustableInsets flag enabled: + // MDCAlertControllerView *alertView = (MDCAlertControllerView *)self.alertController.view; + // alertView.enableAdjustableInsets = YES; + + self.titleIcon = [[UIImage mdc_testImageOfSize:CGSizeMake(24.f, 24.f)] + imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + self.titleImage = [[UIImage mdc_testImageOfSize:CGSizeMake(180.f, 120.f)] + imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + + self.accessoryView = [[UIView alloc] initWithFrame:CGRectMake(0.f, 0.f, 150.f, 150.f)]; + [self.accessoryView setBackgroundColor:[[UIColor purpleColor] colorWithAlphaComponent:0.5f]]; + + self.containerScheme2019 = [[MDCContainerScheme alloc] init]; + self.containerScheme2019.colorScheme = + [[MDCSemanticColorScheme alloc] initWithDefaults:MDCColorSchemeDefaultsMaterial201907]; + self.containerScheme2019.typographyScheme = + [[MDCTypographyScheme alloc] initWithDefaults:MDCTypographySchemeDefaultsMaterial201902]; +} + +- (void)tearDown { + self.alertController = nil; + self.containerScheme2019 = nil; + + [super tearDown]; +} + +- (void)sizeAlertToFitContent { + CGSize preferredContentSize = self.alertController.preferredContentSize; + self.alertController.view.bounds = + CGRectMake(0.f, 0.f, preferredContentSize.width, preferredContentSize.height); +} + +- (void)addOutlinedActionWithTitle:(NSString *)actionTitle { + [self.alertController addAction:[MDCAlertAction actionWithTitle:actionTitle + emphasis:MDCActionEmphasisMedium + handler:nil]]; +} + +- (void)generateSizedSnapshotAndVerifyForView:(UIView *)view { + [self sizeAlertToFitContent]; + [self generateSnapshotAndVerifyForView:view]; +} + +- (void)generateSnapshotAndVerifyForView:(UIView *)view { + [view layoutIfNeeded]; + + UIView *snapshotView = [view mdc_addToBackgroundView]; + [self snapshotVerifyView:snapshotView]; +} + +- (void)changeToRTL:(MDCAlertController *)alertController { + [self changeViewToRTL:alertController.view]; +} + +#pragma mark - Tests + +// title + actions +- (void)testAlertHasTitle { + // Given + [self addOutlinedActionWithTitle:@"Cancel"]; + self.alertController.title = kTitleShortLatin; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title-icon + actions +- (void)testAlertHasTitleIcon { + // Given + self.alertController.titleIcon = self.titleIcon; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title-image + actions +- (void)testAlertHasTitleImage { + // Given + [self addOutlinedActionWithTitle:@"Cancel"]; + self.alertController.titleIcon = self.titleImage; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// message + actions +- (void)testAlertHasMessage { + // Given + self.alertController.message = kMessageLongLatin; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// accessory-view + actions +- (void)testAlertHasAccessoryView { + // Given + [self addOutlinedActionWithTitle:@"Cancel"]; + self.alertController.accessoryView = self.accessoryView; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title-icon + message + actions +- (void)testAlertHasTitleIconAndMessage { + // Given + [self addOutlinedActionWithTitle:@"Cancel"]; + self.alertController.titleIcon = self.titleIcon; + self.alertController.message = kMessageShortLatin; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title-image + message + actions +- (void)testAlertHasTitleImageAndMessage { + // Given + [self addOutlinedActionWithTitle:@"Cancel"]; + self.alertController.titleIcon = self.titleImage; + self.alertController.message = kMessageLongLatin; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title-icon + accessory-view + actions +- (void)testAlertHasTitleIconAndAccessoryView { + // Given + self.alertController.titleIcon = self.titleIcon; + self.alertController.accessoryView = self.accessoryView; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title-image + accessory-view + actions +- (void)testAlertHasTitleImageAndAccessoryView { + // Given + [self addOutlinedActionWithTitle:@"Cancel"]; + self.alertController.titleIcon = self.titleImage; + self.alertController.accessoryView = self.accessoryView; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// message + accessory-view + actions +- (void)testAlertHasMessageAndAccessoryView { + // When + self.alertController.message = kMessageLongLatin; + self.alertController.accessoryView = self.accessoryView; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title + accessory-view + actions +- (void)testAlertHasTitleAndAccessoryView { + // When + [self addOutlinedActionWithTitle:@"Cancel"]; + self.alertController.title = kTitleShortLatin; + self.alertController.accessoryView = self.accessoryView; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title + title-icon + accessory-view + actions +- (void)testAlertHasTitleAndTitleIconAndAccessoryView { + // Given + self.alertController.titleIcon = self.titleIcon; + self.alertController.title = kTitleShortLatin; + self.alertController.accessoryView = self.accessoryView; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title + title-image + accessory-view + actions +- (void)testAlertHasTitleAndTitleImageAndAccessoryView { + // Given + [self addOutlinedActionWithTitle:@"Cancel"]; + self.alertController.titleIcon = self.titleImage; + self.alertController.title = kTitleShortLatin; + self.alertController.message = kMessageShortLatin; + self.alertController.accessoryView = self.accessoryView; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title + title-icon + message + accessory-view + actions +- (void)testAlertHasTitleAndTitleIconAndMessageAndAccessoryView { + // Given + [self addOutlinedActionWithTitle:@"Cancel"]; + self.alertController.titleIcon = self.titleIcon; + self.alertController.title = kTitleShortLatin; + self.alertController.message = kMessageLongLatin; + self.alertController.accessoryView = self.accessoryView; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title + title-image + message + accessory-view + actions +- (void)testAlertHasTitleAndTitleImageAndMessageAndAccessoryView { + // Given + self.alertController.titleIcon = self.titleImage; + self.alertController.title = kTitleShortLatin; + self.alertController.message = kMessageLongLatin; + self.alertController.accessoryView = self.accessoryView; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title-image + vertical actions +- (void)testAlertHasTitleImageAndVerticalButtons { + // Given + [self addOutlinedActionWithTitle:@"Verticallly Aligned Buttons"]; + self.alertController.titleIcon = self.titleImage; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + // Avoid sizing of snapshot view - to allow butttons to auto-align vertically. + [self generateSnapshotAndVerifyForView:self.alertController.view]; +} + +// title-icon + message + accessory-view + vertical actions +- (void)testAlertHasTitleIconAndMessageAndAccessoryViewAndVerticalButtons { + // Given + [self addOutlinedActionWithTitle:@"Buttons?"]; + [self addOutlinedActionWithTitle:@"Vertical"]; + [self addOutlinedActionWithTitle:@"Four"]; + self.alertController.titleIcon = self.titleIcon; + self.alertController.message = kMessageShortLatin; + self.alertController.accessoryView = self.accessoryView; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + + // Then + // Ensure enough vertical space for all buttons before layout, then size to fit content. + self.alertController.view.bounds = CGRectMake(0.f, 0.f, 300.f, 500.f); + [self.alertController.view layoutIfNeeded]; + [self sizeAlertToFitContent]; + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// accessory-view + actions in RTL +- (void)testAlertHasAccessoryViewInRTL { + // Given + self.alertController.accessoryView = self.accessoryView; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + [self changeToRTL:self.alertController]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +// title + title-icon + message + accessory-view + actions in RTL +- (void)testAlertHasTitleAndTitleIconAndMessageAndAccessoryViewInRTL { + // Given + [self addOutlinedActionWithTitle:@"Cancel"]; + self.alertController.titleIcon = self.titleIcon; + self.alertController.title = kTitleShortLatin; + self.alertController.message = kMessageLongLatin; + self.alertController.accessoryView = self.accessoryView; + + // When + [self.alertController applyThemeWithScheme:self.containerScheme2019]; + [self changeToRTL:self.alertController]; + + // Then + [self generateSizedSnapshotAndVerifyForView:self.alertController.view]; +} + +@end From ff34c2e55c67229cabbfb0b88746930dd12bd852 Mon Sep 17 00:00:00 2001 From: Yarden Eitan Date: Mon, 17 Feb 2020 13:28:47 +0200 Subject: [PATCH 41/47] Automatic changelog preparation for release. --- .gitattributes | 28 +++++++++++-- CHANGELOG.md | 105 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 130 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index 1116206b84a..f56e2dfb895 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,25 @@ -# Do not merge this version into `stable`. -snapshot_test_goldens/**/*.png filter=lfs diff=lfs merge=lfs -text -.gitattributes merge=gitattributes +# DO NOT CHANGE THIS FILE +# DO NOT EDIT THE LINE BELOW. +/.gitattributes merge=gitattributes +# DO NOT EDIT THE LINE ABOVE. +# +# You can of course edit this file, but make sure you understand what you are +# doing. This file defines a custom filter driver that prevents snapshot test +# images from being merged into `stable`. Snapshot test images are only +# valuable in `develop` because they are only intended to help developers +# identify changes in the appearance of the library. +# +# Before you change this file, please carefully consider whether such a change +# is actually necessary. When you do change this file, it should almost always +# be done in a dedicated commit directly on the `stable` branch and not part +# of a release. If you see this file being changed as part of a release, +# block the release and work with the releaser to ensure that the change needs +# to be propagated from the `develop` branch to the `stable` branch. In nearly +# all cases, it should not be propagated from `develop` to `stable`. +# +# If you are a releaser and see this file change and you're not sure why, you +# might have accidentally skipped [setting the correct +# driver in your cloned +# repository](https://github.com/material-components/material-components-ios/blob/develop/contributing/releasing.md#configure-the-merge-strategy-for-gitattributes). +# If that's the case, please either revert the accidental change manually or +# restart the release with a fresh clone and the correct driver. diff --git a/CHANGELOG.md b/CHANGELOG.md index a775615d381..6e1a12f6624 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,108 @@ +# #develop# + +Replace this text with a summarized description of this release's contents. +## Breaking changes + +Replace this explanations for how to resolve the breaking changes. +## New deprecations + +Replace this text with links to deprecation guides. +## New features + +Replace this text with example code for each new feature. +## API changes + +## Component changes + +### ActionSheet + +* [Migrates Action sheet to MDCAvailability. (#9733)](https://github.com/material-components/material-components-ios/commit/652077c779b06fc6b44e9bbae237f47e083c053c) (Bryan Oltman) + +### ActivityIndicator + +* [Migrates activity indicator to MDCAvailability. (#9735)](https://github.com/material-components/material-components-ios/commit/28a7fac63f7ee5f1787ab56190c8a579532810d6) (Bryan Oltman) + +### BottomNavigation + +* [Migrates Bottom Navigation to MDCAvailability. (#9717)](https://github.com/material-components/material-components-ios/commit/02efdd188990305ff298fbad25fa48634974b1b4) (Randall Li) + +### Buttons + +* [Fix tvOS target bug. (#9705)](https://github.com/material-components/material-components-ios/commit/95518f48d4fe6c10e13cbdcfcc3a1c863697298d) (Randall Li) +* [MDCButton. (#9667)](https://github.com/material-components/material-components-ios/commit/1d8d647f1f534de4366c8722992b67858d7ba444) (copybara-service[bot]) + +### Cards + +* [Migrates cards to MDCAvailability. (#9728)](https://github.com/material-components/material-components-ios/commit/b677a3629e180a89f1e6a15256b45790ca794af5) (Randall Li) + +### Chips + +* [Migrates Chips to MDCAvailability. (#9713)](https://github.com/material-components/material-components-ios/commit/33fbdfc3be62b4ff78951898b9abe6fc59041db4) (Randall Li) + +### Dialogs + +* [Add snapshot tests for additional dialog configurations. (#9646)](https://github.com/material-components/material-components-ios/commit/e2bff768df18fc24f91857447ddb8992071e778f) (copybara-service[bot]) +* [Adding accessory view vertical inset to private header (#9692)](https://github.com/material-components/material-components-ios/commit/ecddca8d58d8e02fb350d31277693dbaff56f952) (Galia Kaufman) +* [Adding an adjustable insets feature flag. Flag default is NO. Clients must enable flag if they want to customize the inset. This flag has no effect yet in this CL. Adjustable layout logic will be introduced in followup CLs. (#9648)](https://github.com/material-components/material-components-ios/commit/0c8647cfca40fc04aa9da1ff7dde30efbe6456dc) (copybara-service[bot]) +* [Delete Dialogs OWNERS file (#9697)](https://github.com/material-components/material-components-ios/commit/5884725f8746bfaecbc02ed509cb70eac42c5428) (Randall Li) +* [Fix custom title icon view layout - top inset (#9721)](https://github.com/material-components/material-components-ios/commit/3b89aecee05c95d49f331ce77427cc5731fbea99) (Galia Kaufman) +* [Migrate dialogs to availability (#9743)](https://github.com/material-components/material-components-ios/commit/88b5767bdb200438108c46f9eae96a8695ef91f7) (Andrew Overton) +* [Refactor action frame calculations to accommodate adjustable insets (5 seconds ago) (#9656)](https://github.com/material-components/material-components-ios/commit/a40a4eb171994b72de473b974131350bed870b1b) (copybara-service[bot]) +* [Refactor content frame calculations to accommodate adjustable insets (#9710)](https://github.com/material-components/material-components-ios/commit/05e38ef7387ff7bb455978031339ecda3ae19893) (Galia Kaufman) +* [Refactor title frame calculations to accommodate adjustable insets (#9709)](https://github.com/material-components/material-components-ios/commit/6011e001f6cfc28ea28591d098a14b9cff4ca78f) (Galia Kaufman) +* [Refactor title-icon, title-icon-view frames calculations to accommodate adjustable insets (#9657)](https://github.com/material-components/material-components-ios/commit/b3ba7e6d2c9deeb7c155f2242cad3c10c15f3e39) (copybara-service[bot]) +* [Update adjustable insets comments (#9694)](https://github.com/material-components/material-components-ios/commit/60a531ca2ad9604c7559be0241aabec874cb87a4) (Galia Kaufman) +* [Update adjustable insets values (#9695)](https://github.com/material-components/material-components-ios/commit/735d2d28183cf977eb9508ac913a234f8e4d5bc3) (Galia Kaufman) + +### FlexibleHeader + +* [Added property for minimumHeaderViewHeight (#9649)](https://github.com/material-components/material-components-ios/commit/8e782d43a2d0a8033f0c65809c9dd09624ff3dbd) (copybara-service[bot]) +* [Migrates Flexible Header to MDCAvailability. (#9744)](https://github.com/material-components/material-components-ios/commit/d962e50cf2564d07a6b823bf02170bdd7fb38f20) (Bryan Oltman) + +### Ink + +* [Migrates Ink to MDCAvailability. (#9741)](https://github.com/material-components/material-components-ios/commit/f168dd2806d5b9a069f08dd715cb8dc895db996e) (Bryan Oltman) + +### NavigationDrawer + +* [Delete NavigationDrawer OWNERS file (#9696)](https://github.com/material-components/material-components-ios/commit/43706fa2f9c919421867e442656b24c6dd762da1) (Randall Li) + +### Slider + +* [Migrates Slider to MDCAvailability. (#9704)](https://github.com/material-components/material-components-ios/commit/d03c34293fb3935e2d24f306e5add2f81741ea21) (Randall Li) + +### Snackbar + +* [Migrates Snackbar to MDCAvailability. (#9739)](https://github.com/material-components/material-components-ios/commit/1a221fe8b02aa2c1df77ad91a00f544c7eb1756a) (Bryan Oltman) + +### Tabs + +* [Migrates Tabs to MDCAvailability. (#9716)](https://github.com/material-components/material-components-ios/commit/549e52668e3525bc41e728ccf3e158574951bdd1) (Randall Li) + +### TextFields + +* [Delete deprecated MDCTextFieldTypographyThemer (#9689)](https://github.com/material-components/material-components-ios/commit/86b4fbcb2c2074b9e60dfb7987a3a1dc92c37937) (Bryan Oltman) + +### private/Color + +* [Make private/color use availability (#9738)](https://github.com/material-components/material-components-ios/commit/1cc8bb781d6142452f40d8265664077ba7c85710) (Andrew Overton) + +### private/TextControlsPrivate + +* [Migrates Text Controls to MDCAvailability (#9720)](https://github.com/material-components/material-components-ios/commit/d89fa3fb11b97727265254afac91c2f9be6afb21) (Andrew Overton) +* [Move static const assignment to MDCTextControl.m (#9701)](https://github.com/material-components/material-components-ios/commit/2d8d6a082fbf046df5b108b03e4566fb1fe91ea8) (Andrew Overton) + +### schemes/Color + +* [Migrates Schemes to MDCAvailability (#9736)](https://github.com/material-components/material-components-ios/commit/ae6d6d9a908c13f0466ad566ba7763925739dd49) (Andrew Overton) + +## Multi-component changes + +* [Changes from text-area-feature-branch with additional podspec and BUILD file changes (#9711)](https://github.com/material-components/material-components-ios/commit/e6ef298bdff1f25005f013777f9e534cb4b6a6d4) (Andrew Overton) +* [Delete deprecated MDCOutlinedButtonThemer (#9688)](https://github.com/material-components/material-components-ios/commit/1118f14124858fe9a258b0971393e33b3966d2bf) (Bryan Oltman) + +--- + # 104.0.1 In this patch release we fixed the syntax of the TV_OS macro. From 832c01268e55334059b54e6e334bdfa0e065ec7f Mon Sep 17 00:00:00 2001 From: Yarden Eitan Date: Mon, 17 Feb 2020 14:27:49 +0200 Subject: [PATCH 42/47] Hand-modified CHANGELOG.md API diff. --- CHANGELOG.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e1a12f6624..ee46cdeb2fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,15 @@ -# #develop# +# 105.0.0 + +In this major release we removed the deprecated themers: MDCTextFieldTypographyThemer, MDCOutlinedButtonThemer, and added a new MDCBaseTextArea class under TextControls. -Replace this text with a summarized description of this release's contents. ## Breaking changes -Replace this explanations for how to resolve the breaking changes. -## New deprecations +Deleted MDCTextFieldTypographyThemer and MDCOutlinedButtonThemer classes. Please use the theming extensions. +Learn more at https://github.com/material-components/material-components-ios/blob/develop/docs/theming.md#migration-guide-themers-to-theming-extensions -Replace this text with links to deprecation guides. ## New features -Replace this text with example code for each new feature. -## API changes +A new BaseTextArea component that leverages UITextView to provide multi-line text input have been created at components/TextControls/src/BaseTextAreas/. ## Component changes @@ -30,6 +29,7 @@ Replace this text with example code for each new feature. * [Fix tvOS target bug. (#9705)](https://github.com/material-components/material-components-ios/commit/95518f48d4fe6c10e13cbdcfcc3a1c863697298d) (Randall Li) * [MDCButton. (#9667)](https://github.com/material-components/material-components-ios/commit/1d8d647f1f534de4366c8722992b67858d7ba444) (copybara-service[bot]) +* [Delete deprecated MDCOutlinedButtonThemer (#9688)](https://github.com/material-components/material-components-ios/commit/1118f14124858fe9a258b0971393e33b3966d2bf) (Bryan Oltman) ### Cards @@ -91,16 +91,12 @@ Replace this text with example code for each new feature. * [Migrates Text Controls to MDCAvailability (#9720)](https://github.com/material-components/material-components-ios/commit/d89fa3fb11b97727265254afac91c2f9be6afb21) (Andrew Overton) * [Move static const assignment to MDCTextControl.m (#9701)](https://github.com/material-components/material-components-ios/commit/2d8d6a082fbf046df5b108b03e4566fb1fe91ea8) (Andrew Overton) +* [Changes from text-area-feature-branch with additional podspec and BUILD file changes (#9711)](https://github.com/material-components/material-components-ios/commit/e6ef298bdff1f25005f013777f9e534cb4b6a6d4) (Andrew Overton) ### schemes/Color * [Migrates Schemes to MDCAvailability (#9736)](https://github.com/material-components/material-components-ios/commit/ae6d6d9a908c13f0466ad566ba7763925739dd49) (Andrew Overton) -## Multi-component changes - -* [Changes from text-area-feature-branch with additional podspec and BUILD file changes (#9711)](https://github.com/material-components/material-components-ios/commit/e6ef298bdff1f25005f013777f9e534cb4b6a6d4) (Andrew Overton) -* [Delete deprecated MDCOutlinedButtonThemer (#9688)](https://github.com/material-components/material-components-ios/commit/1118f14124858fe9a258b0971393e33b3966d2bf) (Bryan Oltman) - --- # 104.0.1 From 4ccfaf69af0e03ebe0d753318a48cf2e1b39dcdd Mon Sep 17 00:00:00 2001 From: Yarden Eitan Date: Mon, 17 Feb 2020 14:28:14 +0200 Subject: [PATCH 43/47] Bumped version number to 105.0.0. --- MaterialComponents.podspec | 2 +- MaterialComponentsBeta.podspec | 2 +- MaterialComponentsEarlGreyTests.podspec | 2 +- MaterialComponentsExamples.podspec | 2 +- MaterialComponentsSnapshotTests.podspec | 2 +- VERSION | 2 +- catalog/MDCCatalog/Info.plist | 4 ++-- catalog/MDCDragons/Info.plist | 4 ++-- catalog/MaterialCatalog/MaterialCatalog.podspec | 2 +- components/LibraryInfo/src/MDCLibraryInfo.m | 2 +- components/LibraryInfo/tests/unit/LibraryInfoTests.m | 2 +- demos/supplemental/RemoteImageServiceForMDCDemos.podspec | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index c6f3a77e903..0d9569629d7 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -2,7 +2,7 @@ load 'scripts/generated/icons.rb' Pod::Spec.new do |mdc| mdc.name = "MaterialComponents" - mdc.version = "104.0.1" + mdc.version = "105.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" diff --git a/MaterialComponentsBeta.podspec b/MaterialComponentsBeta.podspec index 18d7ab51cea..2d4cdd21655 100644 --- a/MaterialComponentsBeta.podspec +++ b/MaterialComponentsBeta.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |mdc| mdc.name = "MaterialComponentsBeta" - mdc.version = "104.0.1" + mdc.version = "105.0.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" diff --git a/MaterialComponentsEarlGreyTests.podspec b/MaterialComponentsEarlGreyTests.podspec index 2cdedd16dab..c17edb661f0 100644 --- a/MaterialComponentsEarlGreyTests.podspec +++ b/MaterialComponentsEarlGreyTests.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MaterialComponentsEarlGreyTests" - s.version = "104.0.1" + s.version = "105.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." diff --git a/MaterialComponentsExamples.podspec b/MaterialComponentsExamples.podspec index 7d67b4bc050..0664b2a6ac9 100644 --- a/MaterialComponentsExamples.podspec +++ b/MaterialComponentsExamples.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MaterialComponentsExamples" - s.version = "104.0.1" + s.version = "105.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." diff --git a/MaterialComponentsSnapshotTests.podspec b/MaterialComponentsSnapshotTests.podspec index c7770aa9282..6b572b7c494 100644 --- a/MaterialComponentsSnapshotTests.podspec +++ b/MaterialComponentsSnapshotTests.podspec @@ -53,7 +53,7 @@ end Pod::Spec.new do |s| s.name = "MaterialComponentsSnapshotTests" - s.version = "104.0.1" + s.version = "105.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" diff --git a/VERSION b/VERSION index 5fa45906ac2..1c31b783e57 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -104.0.1 +105.0.0 diff --git a/catalog/MDCCatalog/Info.plist b/catalog/MDCCatalog/Info.plist index 25974291108..61271f7f025 100644 --- a/catalog/MDCCatalog/Info.plist +++ b/catalog/MDCCatalog/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 104.0.1 + 105.0.0 CFBundleSignature ???? CFBundleVersion - 104.0.1 + 105.0.0 LSRequiresIPhoneOS UIAppFonts diff --git a/catalog/MDCDragons/Info.plist b/catalog/MDCDragons/Info.plist index 159c2023639..55bfc0a0970 100644 --- a/catalog/MDCDragons/Info.plist +++ b/catalog/MDCDragons/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 104.0.1 + 105.0.0 CFBundleVersion - 104.0.1 + 105.0.0 LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/catalog/MaterialCatalog/MaterialCatalog.podspec b/catalog/MaterialCatalog/MaterialCatalog.podspec index 804ed57c42a..8c6842fc57e 100644 --- a/catalog/MaterialCatalog/MaterialCatalog.podspec +++ b/catalog/MaterialCatalog/MaterialCatalog.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MaterialCatalog" - s.version = "104.0.1" + s.version = "105.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" diff --git a/components/LibraryInfo/src/MDCLibraryInfo.m b/components/LibraryInfo/src/MDCLibraryInfo.m index 8bd002ffd5d..eeb1a1eefe0 100644 --- a/components/LibraryInfo/src/MDCLibraryInfo.m +++ b/components/LibraryInfo/src/MDCLibraryInfo.m @@ -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 = @"104.0.1"; +static NSString const *MDCLibraryInfoVersionString = @"105.0.0"; @implementation MDCLibraryInfo diff --git a/components/LibraryInfo/tests/unit/LibraryInfoTests.m b/components/LibraryInfo/tests/unit/LibraryInfoTests.m index d92d80eadd7..eca7a16d7e6 100644 --- a/components/LibraryInfo/tests/unit/LibraryInfoTests.m +++ b/components/LibraryInfo/tests/unit/LibraryInfoTests.m @@ -26,7 +26,7 @@ - (void)testVersionFormat { // Given // This regex pattern does the following: - // Accept: "104.0.1", etc. + // Accept: "105.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 diff --git a/demos/supplemental/RemoteImageServiceForMDCDemos.podspec b/demos/supplemental/RemoteImageServiceForMDCDemos.podspec index 8463c6194ad..3111065a642 100644 --- a/demos/supplemental/RemoteImageServiceForMDCDemos.podspec +++ b/demos/supplemental/RemoteImageServiceForMDCDemos.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "RemoteImageServiceForMDCDemos" - s.version = "104.0.1" + s.version = "105.0.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" From 73ed3e1416ed352516e561c7f314751e4a37513c Mon Sep 17 00:00:00 2001 From: Yarden Eitan Date: Tue, 18 Feb 2020 14:41:46 +0200 Subject: [PATCH 44/47] update changelog --- CHANGELOG.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee46cdeb2fb..e6c503f527d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,16 +41,16 @@ A new BaseTextArea component that leverages UITextView to provide multi-line tex ### Dialogs -* [Add snapshot tests for additional dialog configurations. (#9646)](https://github.com/material-components/material-components-ios/commit/e2bff768df18fc24f91857447ddb8992071e778f) (copybara-service[bot]) +* [Add snapshot tests for additional dialog configurations. (#9646)](https://github.com/material-components/material-components-ios/commit/e2bff768df18fc24f91857447ddb8992071e778f) (Galia Kaufman) * [Adding accessory view vertical inset to private header (#9692)](https://github.com/material-components/material-components-ios/commit/ecddca8d58d8e02fb350d31277693dbaff56f952) (Galia Kaufman) -* [Adding an adjustable insets feature flag. Flag default is NO. Clients must enable flag if they want to customize the inset. This flag has no effect yet in this CL. Adjustable layout logic will be introduced in followup CLs. (#9648)](https://github.com/material-components/material-components-ios/commit/0c8647cfca40fc04aa9da1ff7dde30efbe6456dc) (copybara-service[bot]) +* [Adding an adjustable insets feature flag. Flag default is NO. Clients must enable flag if they want to customize the inset. This flag has no effect yet in this CL. Adjustable layout logic will be introduced in followup CLs. (#9648)](https://github.com/material-components/material-components-ios/commit/0c8647cfca40fc04aa9da1ff7dde30efbe6456dc) (Galia Kaufman) * [Delete Dialogs OWNERS file (#9697)](https://github.com/material-components/material-components-ios/commit/5884725f8746bfaecbc02ed509cb70eac42c5428) (Randall Li) -* [Fix custom title icon view layout - top inset (#9721)](https://github.com/material-components/material-components-ios/commit/3b89aecee05c95d49f331ce77427cc5731fbea99) (Galia Kaufman) +* [Fix custom title icon view layout - top inset (#9721)](https://github.com/material-components/material-components-ios/commit/3b89aecee05c95d49f331ce77427cc5731fbea99) (Iryna Berezan) * [Migrate dialogs to availability (#9743)](https://github.com/material-components/material-components-ios/commit/88b5767bdb200438108c46f9eae96a8695ef91f7) (Andrew Overton) -* [Refactor action frame calculations to accommodate adjustable insets (5 seconds ago) (#9656)](https://github.com/material-components/material-components-ios/commit/a40a4eb171994b72de473b974131350bed870b1b) (copybara-service[bot]) +* [Refactor action frame calculations to accommodate adjustable insets (5 seconds ago) (#9656)](https://github.com/material-components/material-components-ios/commit/a40a4eb171994b72de473b974131350bed870b1b) (Galia Kaufman) * [Refactor content frame calculations to accommodate adjustable insets (#9710)](https://github.com/material-components/material-components-ios/commit/05e38ef7387ff7bb455978031339ecda3ae19893) (Galia Kaufman) * [Refactor title frame calculations to accommodate adjustable insets (#9709)](https://github.com/material-components/material-components-ios/commit/6011e001f6cfc28ea28591d098a14b9cff4ca78f) (Galia Kaufman) -* [Refactor title-icon, title-icon-view frames calculations to accommodate adjustable insets (#9657)](https://github.com/material-components/material-components-ios/commit/b3ba7e6d2c9deeb7c155f2242cad3c10c15f3e39) (copybara-service[bot]) +* [Refactor title-icon, title-icon-view frames calculations to accommodate adjustable insets (#9657)](https://github.com/material-components/material-components-ios/commit/b3ba7e6d2c9deeb7c155f2242cad3c10c15f3e39) (Galia Kaufman) * [Update adjustable insets comments (#9694)](https://github.com/material-components/material-components-ios/commit/60a531ca2ad9604c7559be0241aabec874cb87a4) (Galia Kaufman) * [Update adjustable insets values (#9695)](https://github.com/material-components/material-components-ios/commit/735d2d28183cf977eb9508ac913a234f8e4d5bc3) (Galia Kaufman) From 8381b3d55e8d922ef7afad105acdfb1a463ab2c3 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Tue, 18 Feb 2020 21:05:41 -0500 Subject: [PATCH 45/47] [Dialogs] Add reference images for MDCAlertControllerConfigurationsTests (#9757) Adds the missing reference images required for the tests introduced by 31c2f23 to pass. --- .../testAlertHasAccessoryViewInRTL_11_2@2x.png | 3 +++ .../testAlertHasAccessoryView_11_2@2x.png | 3 +++ .../testAlertHasMessageAndAccessoryView_11_2@2x.png | 3 +++ .../testAlertHasMessage_11_2@2x.png | 3 +++ .../testAlertHasTitleAndAccessoryView_11_2@2x.png | 3 +++ .../testAlertHasTitleAndTitleIconAndAccessoryView_11_2@2x.png | 3 +++ ...itleAndTitleIconAndMessageAndAccessoryViewInRTL_11_2@2x.png | 3 +++ ...tHasTitleAndTitleIconAndMessageAndAccessoryView_11_2@2x.png | 3 +++ .../testAlertHasTitleAndTitleImageAndAccessoryView_11_2@2x.png | 3 +++ ...HasTitleAndTitleImageAndMessageAndAccessoryView_11_2@2x.png | 3 +++ .../testAlertHasTitleIconAndAccessoryView_11_2@2x.png | 3 +++ ...conAndMessageAndAccessoryViewAndVerticalButtons_11_2@2x.png | 3 +++ .../testAlertHasTitleIconAndMessage_11_2@2x.png | 3 +++ .../testAlertHasTitleIcon_11_2@2x.png | 3 +++ .../testAlertHasTitleImageAndAccessoryView_11_2@2x.png | 3 +++ .../testAlertHasTitleImageAndMessage_11_2@2x.png | 3 +++ .../testAlertHasTitleImageAndVerticalButtons_11_2@2x.png | 3 +++ .../testAlertHasTitleImage_11_2@2x.png | 3 +++ .../testAlertHasTitle_11_2@2x.png | 3 +++ 19 files changed, 57 insertions(+) create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasAccessoryViewInRTL_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasAccessoryView_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasMessageAndAccessoryView_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasMessage_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndAccessoryView_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndAccessoryView_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndMessageAndAccessoryViewInRTL_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndMessageAndAccessoryView_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleImageAndAccessoryView_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleImageAndMessageAndAccessoryView_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIconAndAccessoryView_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIconAndMessageAndAccessoryViewAndVerticalButtons_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIconAndMessage_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIcon_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImageAndAccessoryView_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImageAndMessage_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImageAndVerticalButtons_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImage_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitle_11_2@2x.png diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasAccessoryViewInRTL_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasAccessoryViewInRTL_11_2@2x.png new file mode 100644 index 00000000000..276adea09ef --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasAccessoryViewInRTL_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74087874bbd37a26dab513509a56b2a15d9271d03e671d6faf4ee4cdac062bd4 +size 9869 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasAccessoryView_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasAccessoryView_11_2@2x.png new file mode 100644 index 00000000000..40c6d621d9c --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasAccessoryView_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3d43645bc3688f699f473d8d248ce07954568642ad6e0ef5da1208658aa72b7b +size 12137 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasMessageAndAccessoryView_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasMessageAndAccessoryView_11_2@2x.png new file mode 100644 index 00000000000..20f64ac0590 --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasMessageAndAccessoryView_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:73301dd235c8103e86c2bd486b047d78480bb403a21132955818b26282a08476 +size 53016 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasMessage_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasMessage_11_2@2x.png new file mode 100644 index 00000000000..6da7edf28b3 --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasMessage_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:480e0299f8ee23859fa72481a5ecdc2e14e6735f83a1e84cc8f079ef67d530fd +size 42740 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndAccessoryView_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndAccessoryView_11_2@2x.png new file mode 100644 index 00000000000..e1f580e3799 --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndAccessoryView_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22acb043b2b358eafec29ed421595a3b001a36b2b8fa446e617e13a0fd157155 +size 14671 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndAccessoryView_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndAccessoryView_11_2@2x.png new file mode 100644 index 00000000000..b865c6f966c --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndAccessoryView_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6ef5386468c116c0a5501eef158385915e7a35300508e365481638b2362d4a24 +size 14060 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndMessageAndAccessoryViewInRTL_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndMessageAndAccessoryViewInRTL_11_2@2x.png new file mode 100644 index 00000000000..b9ae9e53ede --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndMessageAndAccessoryViewInRTL_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe0ff1a31af181857a691c2cf30627febaa79d15b505ede775deed466d62e8e1 +size 61244 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndMessageAndAccessoryView_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndMessageAndAccessoryView_11_2@2x.png new file mode 100644 index 00000000000..512c49824e2 --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndMessageAndAccessoryView_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4bf88508384434691a63064053b375f646e7f21adcc8c13bd355e6be44a14d30 +size 61217 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleImageAndAccessoryView_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleImageAndAccessoryView_11_2@2x.png new file mode 100644 index 00000000000..1d9f6224e2c --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleImageAndAccessoryView_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dfe8651ee85bf7bd14c7620dd21fa452a3d3b7f05852f5b99ef9e860a03bc4f0 +size 22620 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleImageAndMessageAndAccessoryView_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleImageAndMessageAndAccessoryView_11_2@2x.png new file mode 100644 index 00000000000..be0c15a6e1b --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleImageAndMessageAndAccessoryView_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1bd8f20609d6ddc91afe691bbfec15f95afcfebdc62d12732ca75fb96b8747f +size 66128 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIconAndAccessoryView_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIconAndAccessoryView_11_2@2x.png new file mode 100644 index 00000000000..f1c214de2a8 --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIconAndAccessoryView_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3746b8bd0e7704a7de54733e149a2dc7d5daf8e515cf02c60924210eedc613d1 +size 11822 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIconAndMessageAndAccessoryViewAndVerticalButtons_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIconAndMessageAndAccessoryViewAndVerticalButtons_11_2@2x.png new file mode 100644 index 00000000000..4e777bc2746 --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIconAndMessageAndAccessoryViewAndVerticalButtons_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c62145770913af2262fd72f5d767b200d758fe1ed653cd893dfd6036b4acf24 +size 33189 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIconAndMessage_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIconAndMessage_11_2@2x.png new file mode 100644 index 00000000000..d09e9c57bc4 --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIconAndMessage_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:064f09c6231c877ff3505f7bf0eafafd707d12cf5bd1a527c5b929c338768e16 +size 8110 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIcon_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIcon_11_2@2x.png new file mode 100644 index 00000000000..1481487d16a --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIcon_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b960191432fa6348e957ce11ce572a81ef935c0318ba364539b717bbd21c8321 +size 3931 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImageAndAccessoryView_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImageAndAccessoryView_11_2@2x.png new file mode 100644 index 00000000000..9af1d4eb3fc --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImageAndAccessoryView_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d74c99d925a9fc8c152f67f360f88c32c5d4acd38845ad5cb13a2f1fca8cbd26 +size 17697 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImageAndMessage_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImageAndMessage_11_2@2x.png new file mode 100644 index 00000000000..108e98c17d5 --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImageAndMessage_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:10c0a2b90e700d5f49722569c297c3133a8db47646149753519d5923715c4a25 +size 47888 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImageAndVerticalButtons_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImageAndVerticalButtons_11_2@2x.png new file mode 100644 index 00000000000..f3834048cc0 --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImageAndVerticalButtons_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e695c3f5d5a167f6e56d0c6263953ecabd03a79e6b244b9c2fb9cf3b3dace787 +size 20995 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImage_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImage_11_2@2x.png new file mode 100644 index 00000000000..737d18cca24 --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleImage_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ded96de31c90c5dcfd137c96e17c8f71df0d0535b5a5a0a57e5e18512593df8a +size 6329 diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitle_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitle_11_2@2x.png new file mode 100644 index 00000000000..61826fee54d --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitle_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6befe26e713145625c33a707bc1c1798f69d97a9f91a74bffb59ceff66581bc6 +size 8138 From 63b5aa07752b9d31de2563d12b8828afb4c5ff09 Mon Sep 17 00:00:00 2001 From: Yarden Eitan Date: Wed, 19 Feb 2020 11:19:52 +0200 Subject: [PATCH 46/47] updated changelog --- CHANGELOG.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6c503f527d..0e5aae85ff6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,12 @@ # 105.0.0 -In this major release we removed the deprecated themers: MDCTextFieldTypographyThemer, MDCOutlinedButtonThemer, and added a new MDCBaseTextArea class under TextControls. +In this major release we removed the deprecated themers: MDCTextFieldTypographyThemer, MDCOutlinedButtonThemer. ## Breaking changes Deleted MDCTextFieldTypographyThemer and MDCOutlinedButtonThemer classes. Please use the theming extensions. Learn more at https://github.com/material-components/material-components-ios/blob/develop/docs/theming.md#migration-guide-themers-to-theming-extensions -## New features - -A new BaseTextArea component that leverages UITextView to provide multi-line text input have been created at components/TextControls/src/BaseTextAreas/. - ## Component changes ### ActionSheet From 1811b2db15a6e668d4628f3ba4b9fe0419769cbc Mon Sep 17 00:00:00 2001 From: Yarden Eitan Date: Wed, 19 Feb 2020 12:28:04 +0200 Subject: [PATCH 47/47] snapshots --- ...leAndTitleIconAndAccessoryView_11_2@2x.png | Bin 130 -> 14060 bytes ...estAlertHasTitleIconAndMessage_11_2@2x.png | Bin 129 -> 8110 bytes .../testAlertHasTitleIcon_11_2@2x.png | Bin 129 -> 3931 bytes .../testAlertHasTitleImage_11_2@2x.png | Bin 129 -> 6329 bytes 4 files changed, 0 insertions(+), 0 deletions(-) diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndAccessoryView_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleAndTitleIconAndAccessoryView_11_2@2x.png index b865c6f966c11afd3a6568156a5d9c1f44eb8669..d1f3f1ff7066684af74e3a390b1f52437e46c673 100644 GIT binary patch literal 14060 zcmeHuc{J2}{P)aI24$%%g(!9D%2F!(7?Y)yZVNJ&P#Ga4>tIY7649cxSW;JV#gIM5 zh@0tVtuWR>t}V-0XNFAu5pT!Af+(v10H5_d9KYf#o*JkAfG%K1a^`!C=z6p&$6s z)4Qg?qP)AQ)miX}06*X#+!6dzU44X}Z~Z-P@i84d`W!ViIU58Y@9Bvhp5@bg`L{1A zKeE1eL_|ft^u&Fish77@-BhzS`bL=UdAmi-LEbiUac9{rSC`HCgD=L-K2N%^mzOCe z0S#`ff&%73<8Z#COi9*Xll8;1$@DQ^Xi&FXfLmY!_gk#yda~@thz;O>ODb{T3N>Pu zn|5mbMfCcM7wTc@3nHyHBm0#E_BWfZN1nX<4EeUHIV?&;U_TlcX^#7kZ#0Gl{QKUJ zkm3Ol&8I7Y6S>?x04=CZ{dCD1Uq;G&XN0Iz-drGUB2@5ZCIM7$~@Wdv8=F-N@I zeE)Q;u-9;7%As2@1X3xYY6J1}#ywePkwa<)PnH*iSJpNmvdAsc8imvJqZFkGXkXqY z;-Abcb$eW;KGvPYh=$g*HXR9lSnQL2r}y)>b#O=m@gXuU*LIGX0c|`;$dC$AT;X@* z!gaH0Ou?_KTD+1_D%_K3xE>;T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)%m$sOfEZ8P7aoq)er5q&;2-qUEYX36*k~Yb}Z>Y+vm@Z@0T$A z8)LY5?(xid3*M$e7xR^umtOy9o1D=h5aw^*rYA~ceLlgXSv^N9f@**Qrp7Es3s*>2 zp6PjO9lf>|V>$S~K(bw(+p0aU;m24xw$(H-r@)$dX`rvA(aYT!F^E+GPig$A1O#jW zYu{gAycN^`$#^Y_pz7rpt!Ln0xub`+p4+U#F-7;862JPwddUKdRgM};VG&mIa{vJm z{X87K>_pRc$u^n~qxaq{;~EO}?UT=?x02KHEzPCaqYIG&)g{W9i=Mehtr-<I`jb7WICxd02sX2u# zCsM4TXu`0V@9* zO%yY~z(GUewmTm-2)J*Q`8321Wj^R<`0ak4RRQgzf-@@4K!rS;zkDQ#G0+Xj{qIOr2b&?44f8Skh{rK@??sbM_iHzv% za1_4q>#LH_<97wNG|s+r8K@aheuRiWQY^_YA~M5yT@j;K!VFcYi_JFcuN649wR}}! zvgvSY_BpS1B{{j?{4Z745eW(~g&AwLEjO;KrFbLtCcjG!#DX17>~Ua#S@(HzqlB)vr%BO>`9pY7^Lc|NgOn z>@p{Q9}*tz)=2Oesr*CUO`QRT$0H7w#%g;b918oE6ukYDQ=mab$0z_8mqsFlfO-nv5GdUE)bOF$`r`)ptHyUuBNCRyq-HX)+3|%4w;Vie) znD{Uqhupk*-VNnHZU-m-2O2NK+H$gj5rU&BOnk~ZhKf4uFPWsf!4Zv9km|ZHyMif(Ls9JhFZm%c8~uBc`vQC literal 129 zcmWN?!4bkB5CFhGRnUNe1K}Xuz`+SKDj6YpSiSCNulkvNyk%SKn7dMszHU#R+y8dv zjmAsOqmsHnj9%ny$vD4je`g)Z8w(T=nXS`~F|)3T6BpE2z!1A!AUT8Nax{^w4d_D! MFJ}K%8345S0mA1eHvj+t diff --git a/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleIcon_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCAlertControllerConfigurationsTests/testAlertHasTitleI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