From 3b3d288ea42ddcc53b61127283770f145b9def38 Mon Sep 17 00:00:00 2001 From: Cody Weaver Date: Thu, 16 Jan 2020 14:20:09 -0800 Subject: [PATCH 01/10] [TextFields] Add theming extension for underline controller (#9437) In #9109 we removed the color themer for the underline controller. This change closes #9371 which will allow clients to theme their underline controller text fields via a theming extension. This change will theme both color and typography. *Note* [Material](material.io) recommends using a [filled or outlined text field](https://material.io/components/text-fields/). | Resting | Active | | --- | --- | |![Simulator Screen Shot - iPhone 8 Plus - 2020-01-16 at 13 13 28](https://user-images.githubusercontent.com/7131294/72563237-1811ed80-3862-11ea-8788-816c927f03e4.png)|![Simulator Screen Shot - iPhone 8 Plus - 2020-01-16 at 13 13 26](https://user-images.githubusercontent.com/7131294/72563252-1cd6a180-3862-11ea-97c9-6d7c82f6878d.png)| Closes #9371 Closes #9242 --- .../TextFieldControllerStylesExample.m | 7 +- ...FieldControllerStylesExampleSupplemental.h | 4 ++ ...InputControllerUnderline+MaterialTheming.h | 33 +++++++++ ...InputControllerUnderline+MaterialTheming.m | 70 +++++++++++++++++++ .../src/Theming/MaterialTextFields+Theming.h | 1 + ...rollerUnderline_MaterialThemingTests.swift | 65 +++++++++++++++++ 6 files changed, 179 insertions(+), 1 deletion(-) create mode 100644 components/TextFields/src/Theming/MDCTextInputControllerUnderline+MaterialTheming.h create mode 100644 components/TextFields/src/Theming/MDCTextInputControllerUnderline+MaterialTheming.m create mode 100644 components/TextFields/tests/unit/Theming/MDCTextFieldControllerUnderline_MaterialThemingTests.swift diff --git a/components/TextFields/examples/TextFieldControllerStylesExample.m b/components/TextFields/examples/TextFieldControllerStylesExample.m index 8f1754e9d2b..e2d737ca6bd 100644 --- a/components/TextFields/examples/TextFieldControllerStylesExample.m +++ b/components/TextFields/examples/TextFieldControllerStylesExample.m @@ -14,6 +14,7 @@ #import +#import "MaterialTextFields+Theming.h" #import "MaterialTextFields.h" #import "supplemental/TextFieldControllerStylesExampleSupplemental.h" @@ -35,7 +36,10 @@ @implementation TextFieldControllerStylesExample - (void)viewDidLoad { [super viewDidLoad]; - self.view.backgroundColor = [UIColor colorWithWhite:(CGFloat)0.97 alpha:1]; + if (self.containerScheme == nil) { + self.containerScheme = [[MDCContainerScheme alloc] init]; + } + self.view.backgroundColor = self.containerScheme.colorScheme.backgroundColor; self.title = @"Material Text Fields"; [self setupExampleViews]; @@ -156,6 +160,7 @@ - (void)setupTextFields { self.textFieldControllerUnderline.characterCountMax = characterCountMax; [self.textFieldControllerUnderline mdc_setAdjustsFontForContentSizeCategory:YES]; + [self.textFieldControllerUnderline applyThemeWithScheme:self.containerScheme]; [NSLayoutConstraint constraintWithItem:textFieldUnderline attribute:NSLayoutAttributeTop diff --git a/components/TextFields/examples/supplemental/TextFieldControllerStylesExampleSupplemental.h b/components/TextFields/examples/supplemental/TextFieldControllerStylesExampleSupplemental.h index 567d57267b9..0b8dcc67ecd 100644 --- a/components/TextFields/examples/supplemental/TextFieldControllerStylesExampleSupplemental.h +++ b/components/TextFields/examples/supplemental/TextFieldControllerStylesExampleSupplemental.h @@ -14,10 +14,14 @@ #import +#import "MaterialContainerScheme.h" + @interface TextFieldControllerStylesExample : UIViewController @property(nonatomic, strong) UIScrollView *scrollView; +@property(nonatomic, strong) id containerScheme; + @end @interface TextFieldControllerStylesExample (Supplemental) diff --git a/components/TextFields/src/Theming/MDCTextInputControllerUnderline+MaterialTheming.h b/components/TextFields/src/Theming/MDCTextInputControllerUnderline+MaterialTheming.h new file mode 100644 index 00000000000..7d25f6cae1e --- /dev/null +++ b/components/TextFields/src/Theming/MDCTextInputControllerUnderline+MaterialTheming.h @@ -0,0 +1,33 @@ +// 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 "MaterialContainerScheme.h" +#import "MaterialTextFields.h" + +/** + This category is used to style MDCTextInputControllerUnderline instances to a specific Material + style which can be found within the [Material + Guidelines](https://material.io/design/components/text-fields.html). + */ +@interface MDCTextInputControllerUnderline (MaterialTheming) + +/** + Applies the Material theme to this instance. + + @param scheme A container scheme instance containing any desired customizations to the theming + system. + */ +- (void)applyThemeWithScheme:(nonnull id)scheme; + +@end diff --git a/components/TextFields/src/Theming/MDCTextInputControllerUnderline+MaterialTheming.m b/components/TextFields/src/Theming/MDCTextInputControllerUnderline+MaterialTheming.m new file mode 100644 index 00000000000..698eba612cb --- /dev/null +++ b/components/TextFields/src/Theming/MDCTextInputControllerUnderline+MaterialTheming.m @@ -0,0 +1,70 @@ +// 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 "MDCTextInputControllerUnderline+MaterialTheming.h" + +@implementation MDCTextInputControllerUnderline (MaterialTheming) + +- (void)applyThemeWithScheme:(id)scheme { + // Color + [self applyColorThemeWithColorScheme:scheme.colorScheme]; + + // Typography + [self applyTypographyThemeWithScheme:scheme.typographyScheme]; +} + +- (void)applyColorThemeWithColorScheme:(id)colorScheme { + UIColor *onSurface87Opacity = [colorScheme.onSurfaceColor colorWithAlphaComponent:(CGFloat)0.87]; + UIColor *onSurface60Opacity = [colorScheme.onSurfaceColor colorWithAlphaComponent:(CGFloat)0.60]; + UIColor *primary87Opacity = [colorScheme.primaryColor colorWithAlphaComponent:(CGFloat)0.87]; + + self.activeColor = colorScheme.primaryColor; + self.errorColor = colorScheme.errorColor; + self.normalColor = onSurface87Opacity; + self.inlinePlaceholderColor = onSurface60Opacity; + self.trailingUnderlineLabelTextColor = onSurface60Opacity; + self.leadingUnderlineLabelTextColor = onSurface60Opacity; + + if ([self conformsToProtocol:@protocol(MDCTextInputControllerFloatingPlaceholder)]) { + id textInputControllerFloatingPlaceholder = + (id)self; + + if ([textInputControllerFloatingPlaceholder + respondsToSelector:@selector(setFloatingPlaceholderNormalColor:)]) { + textInputControllerFloatingPlaceholder.floatingPlaceholderNormalColor = onSurface60Opacity; + textInputControllerFloatingPlaceholder.floatingPlaceholderActiveColor = primary87Opacity; + } + } +} + +- (void)applyTypographyThemeWithScheme:(id)typographyScheme { + self.inlinePlaceholderFont = typographyScheme.subtitle1; + self.leadingUnderlineLabelFont = typographyScheme.caption; + self.trailingUnderlineLabelFont = typographyScheme.caption; + + if ([self conformsToProtocol:@protocol(MDCTextInputControllerFloatingPlaceholder)]) { + id floatingPlaceholderController = + (id)self; + + // if caption.pointSize <= 0 there is no meaningful ratio so we fallback to default. + if (typographyScheme.caption.pointSize <= 0) { + floatingPlaceholderController.floatingPlaceholderScale = nil; + } else { + double ratio = typographyScheme.caption.pointSize / typographyScheme.subtitle1.pointSize; + floatingPlaceholderController.floatingPlaceholderScale = [NSNumber numberWithDouble:ratio]; + } + } +} + +@end diff --git a/components/TextFields/src/Theming/MaterialTextFields+Theming.h b/components/TextFields/src/Theming/MaterialTextFields+Theming.h index 50672f03496..2996184607d 100644 --- a/components/TextFields/src/Theming/MaterialTextFields+Theming.h +++ b/components/TextFields/src/Theming/MaterialTextFields+Theming.h @@ -14,3 +14,4 @@ #import "MDCTextInputControllerFilled+MaterialTheming.h" #import "MDCTextInputControllerOutlined+MaterialTheming.h" +#import "MDCTextInputControllerUnderline+MaterialTheming.h" diff --git a/components/TextFields/tests/unit/Theming/MDCTextFieldControllerUnderline_MaterialThemingTests.swift b/components/TextFields/tests/unit/Theming/MDCTextFieldControllerUnderline_MaterialThemingTests.swift new file mode 100644 index 00000000000..92c2ca7500b --- /dev/null +++ b/components/TextFields/tests/unit/Theming/MDCTextFieldControllerUnderline_MaterialThemingTests.swift @@ -0,0 +1,65 @@ +// 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 MaterialComponents.MaterialTextFields +import MaterialComponents.MaterialColorScheme +import MaterialComponents.MaterialContainerScheme +import MaterialComponents.MaterialTypographyScheme +import MaterialComponents.MaterialTextFields_Theming +import XCTest + +class MDCTextFieldControllerUnderline_MaterialThemingTests: XCTestCase { + func testWithDefaultContainerSchemeStylesAppropriately() { + // Given + let textFieldFilled = MDCTextField() + let textFieldControllerUnderline = MDCTextInputControllerUnderline(textInput: textFieldFilled) + let scheme = MDCContainerScheme() + let onSurface60Opacity = scheme.colorScheme.onSurfaceColor.withAlphaComponent(0.6) + let typographyScheme = scheme.typographyScheme + let floatingPlaceholderController: MDCTextInputControllerFloatingPlaceholder = + textFieldControllerUnderline + + // When + textFieldControllerUnderline.applyTheme(withScheme: scheme) + + // Then + // Color + XCTAssertEqual(textFieldControllerUnderline.activeColor, scheme.colorScheme.primaryColor) + XCTAssertEqual(textFieldControllerUnderline.errorColor, scheme.colorScheme.errorColor) + XCTAssertEqual( + textFieldControllerUnderline.normalColor, + scheme.colorScheme.onSurfaceColor.withAlphaComponent(0.87) + ) + XCTAssertEqual(textFieldControllerUnderline.inlinePlaceholderColor, onSurface60Opacity) + XCTAssertEqual(textFieldControllerUnderline.trailingUnderlineLabelTextColor, onSurface60Opacity) + XCTAssertEqual(textFieldControllerUnderline.leadingUnderlineLabelTextColor, onSurface60Opacity) + XCTAssertEqual(floatingPlaceholderController.floatingPlaceholderNormalColor, onSurface60Opacity) + XCTAssertEqual(floatingPlaceholderController.floatingPlaceholderActiveColor, + scheme.colorScheme.primaryColor.withAlphaComponent(0.87) + ) + // Typography + XCTAssertEqual(textFieldControllerUnderline.inlinePlaceholderFont, typographyScheme.subtitle1) + XCTAssertEqual(textFieldControllerUnderline.leadingUnderlineLabelFont, typographyScheme.caption) + XCTAssertEqual( + textFieldControllerUnderline.trailingUnderlineLabelFont, + typographyScheme.caption + ) + if typographyScheme.caption.pointSize <= 0 { + XCTAssertNil(floatingPlaceholderController.floatingPlaceholderScale) + } else { + let ratio = Double(typographyScheme.caption.pointSize / typographyScheme.subtitle1.pointSize) + XCTAssertEqual(floatingPlaceholderController.floatingPlaceholderScale, NSNumber(value: ratio)) + } + } +} From 083cf8c12f8efe1d9351ddb56f513a5fed5cd289 Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Fri, 17 Jan 2020 15:21:08 -0500 Subject: [PATCH 02/10] [TextControls] Restructure Cocoapods and Blaze targets (#9430) ## UPDATED PR DESCRIPTION: **NOTE: [cl/290296411](http://cl/290296411) must be patched into whatever release includes this PR.** There were requests to break it up further. With the latest changes, it will look like this in the future: //components/TextControls:Shared # shared public types //components/TextControls:BaseTextFields //components/TextControls:FilledTextFields //components/TextControls:FilledTextFieldsTheming //components/TextControls:OutlinedTextFields //components/TextControls:OutlinedTextFieldsTheming //components/TextControls:BaseTextAreas //components/TextControls:FilledTextAreas //components/TextControls:FilledTextAreasTheming //components/TextControls:OutlinedTextAreas //components/TextControls:OutlinedTextAreasTheming //components/TextControls:FilledInputChipView //components/TextControls:FilledInputChipViewTheming //components/TextControls:OutlinedInputChipView //components/TextControls:OutlinedInputChipViewTheming //components/private/TextControlsPrivate: Shared # shared private types //components/private/TextControlsPrivate:OutlinedStyle //components/private/TextControlsPrivate:FilledStyle This would make it easier to sunset/retire a specific style of a specific text control type, for example. ## ORIGINAL PR DESCRIPTION: This PR is an attempt to satisfy the recent requests to break up the Cocoapods subspecs and Bazel targets for TextControls. ~**NOTE: [cl/289710430](http://cl/289710430) must be patched into whatever release includes this PR.**~ **ANOTHER NOTE: This PR will break any third party people who depend on TextControls via Cocoapods and have not pinned to a specific version of our library.** This PR takes the following Cocoapods subspecs: TextControls TextControls+Theming And breaks them up into these ones: TextControls TextControls+TextFields TextControls+TextFieldsTheming private/TextControlsPrivate Similarly, it takes the following bazel targets: //components/TextControls //components/TextControls:Theming And breaks them up into these ones: //components/TextControls //components/TextControls:TextFields //components/TextControls:TextFieldsTheming //components/private/TextControlsPrivate Where before a third party client would have had the following in their Podfile: `pod 'MaterialComponents/TextControls'` They would now have: `pod 'MaterialComponents/TextControls+TextFields'` When I started this work I originally planned to have there be top level components for each of the TextControls that all depended on a shared private component. However, I quickly remembered that all the text controls shared some public types too. At some point I decided it make make sense to make use of extensions. In order to satisfy pod lib lint I had to add some dummy source files and dummy test files. The dummy test files could potentially have some stuff in there if we want to validate the enums they refer to somehow... Closes #9405. --- MaterialComponents.podspec | 156 +++++++++++++++--- catalog/Podfile | 7 +- components/TextControls/BUILD | 102 ++++++++---- components/TextControls/README.md | 13 +- components/TextControls/docs/theming.md | 13 +- ...xtControlTextFieldsStoryboardExample.swift | 4 +- .../MDCTextControlConfiguratorExample.m | 5 +- .../{ => BaseTextFields}/MDCBaseTextField.h | 3 +- .../{ => BaseTextFields}/MDCBaseTextField.m | 9 +- .../MaterialTextControls+BaseTextFields.h} | 9 - .../private/MDCBaseTextFieldLayout.h | 4 +- .../private/MDCBaseTextFieldLayout.m | 0 .../{ => Enums}/MDCTextControlLabelBehavior.h | 0 .../src/{ => Enums}/MDCTextControlState.h | 0 .../MaterialTextControls+Enums.h} | 3 - .../MDCFilledTextField.h | 2 +- .../MDCFilledTextField.m | 8 +- .../MaterialTextControls+FilledTextFields.h | 15 ++ .../MDCFilledTextField+MaterialTheming.h | 2 +- .../MDCFilledTextField+MaterialTheming.m | 0 ...rialTextControls+FilledTextFieldsTheming.h | 15 ++ .../MDCOutlinedTextField.h | 2 +- .../MDCOutlinedTextField.m | 7 +- .../MaterialTextControls+OutlinedTextFields.h | 15 ++ .../MDCOutlinedTextField+MaterialTheming.h | 2 +- .../MDCOutlinedTextField+MaterialTheming.m | 0 ...lTextControls+OutlinedTextFieldsTheming.h} | 1 - .../snapshot/MDCBaseTextFieldSnapshotTests.m | 4 +- .../MDCFilledTextFieldSnapshotTests.m | 4 +- .../MDCOutlinedTextFieldSnapshotTests.m | 4 +- ...MDCBaseTextFieldTestsSnapshotTestHelpers.h | 3 +- ...MDCBaseTextFieldTestsSnapshotTestHelpers.m | 2 + .../MDCTextControlSnapshotTestHelpers.h | 2 +- .../MDCTextControlSnapshotTestHelpers.m | 2 - .../MDCBaseTextFieldLayoutTests.m | 7 +- .../MDCBaseTextFieldTests.m | 5 +- .../MDCFilledTextFieldTests.m | 2 +- .../MDCFilledTextFieldThemingTests.m | 3 +- .../MDCOutlinedTextFieldTests.m | 2 +- .../MDCOutlinedTextFieldThemingTests.m | 3 +- components/private/TextControlsPrivate/BUILD | 88 ++++++++++ .../src/BaseStyle}/MDCTextControlStyleBase.h | 0 .../src/BaseStyle}/MDCTextControlStyleBase.m | 0 ...tControlVerticalPositioningReferenceBase.h | 0 ...tControlVerticalPositioningReferenceBase.m | 0 .../MaterialTextControlsPrivate+BaseStyle.h | 16 ++ .../FilledStyle}/MDCTextControlStyleFilled.h | 2 - .../FilledStyle}/MDCTextControlStyleFilled.m | 0 ...ontrolVerticalPositioningReferenceFilled.h | 0 ...ontrolVerticalPositioningReferenceFilled.m | 0 .../MaterialTextControlsPrivate+FilledStyle.h | 16 ++ .../MDCTextControlStyleOutlined.h | 0 .../MDCTextControlStyleOutlined.m | 0 ...trolVerticalPositioningReferenceOutlined.h | 0 ...trolVerticalPositioningReferenceOutlined.m | 0 ...aterialTextControlsPrivate+OutlinedStyle.h | 16 ++ .../src/Shared}/MDCTextControl.h | 0 ...MDCTextControlAssistiveLabelDrawPriority.h | 0 .../MDCTextControlAssistiveLabelView.h | 0 .../MDCTextControlAssistiveLabelView.m | 0 .../MDCTextControlAssistiveLabelViewLayout.h | 0 .../MDCTextControlAssistiveLabelViewLayout.m | 0 .../Shared}/MDCTextControlColorViewModel.h | 0 .../Shared}/MDCTextControlColorViewModel.m | 0 .../Shared}/MDCTextControlLabelAnimation.h | 0 .../Shared}/MDCTextControlLabelAnimation.m | 0 .../src/Shared}/MDCTextControlLabelState.h | 0 ...CTextControlVerticalPositioningReference.h | 0 .../MaterialTextControlsPrivate+Shared.h | 20 +++ .../UIBezierPath+MDCTextControlStyle.h | 0 .../UIBezierPath+MDCTextControlStyle.m | 0 71 files changed, 464 insertions(+), 134 deletions(-) rename components/TextControls/src/{ => BaseTextFields}/MDCBaseTextField.h (98%) rename components/TextControls/src/{ => BaseTextFields}/MDCBaseTextField.m (98%) rename components/TextControls/src/{private/MDCBaseTextField+MDCTextControl.h => BaseTextFields/MaterialTextControls+BaseTextFields.h} (69%) rename components/TextControls/src/{ => BaseTextFields}/private/MDCBaseTextFieldLayout.h (95%) rename components/TextControls/src/{ => BaseTextFields}/private/MDCBaseTextFieldLayout.m (100%) rename components/TextControls/src/{ => Enums}/MDCTextControlLabelBehavior.h (100%) rename components/TextControls/src/{ => Enums}/MDCTextControlState.h (100%) rename components/TextControls/src/{MaterialTextControls.h => Enums/MaterialTextControls+Enums.h} (88%) rename components/TextControls/src/{ => FilledTextFields}/MDCFilledTextField.h (97%) rename components/TextControls/src/{ => FilledTextFields}/MDCFilledTextField.m (93%) create mode 100644 components/TextControls/src/FilledTextFields/MaterialTextControls+FilledTextFields.h rename components/TextControls/src/{Theming => FilledTextFieldsTheming}/MDCFilledTextField+MaterialTheming.h (96%) rename components/TextControls/src/{Theming => FilledTextFieldsTheming}/MDCFilledTextField+MaterialTheming.m (100%) create mode 100644 components/TextControls/src/FilledTextFieldsTheming/MaterialTextControls+FilledTextFieldsTheming.h rename components/TextControls/src/{ => OutlinedTextFields}/MDCOutlinedTextField.h (96%) rename components/TextControls/src/{ => OutlinedTextFields}/MDCOutlinedTextField.m (93%) create mode 100644 components/TextControls/src/OutlinedTextFields/MaterialTextControls+OutlinedTextFields.h rename components/TextControls/src/{Theming => OutlinedTextFieldsTheming}/MDCOutlinedTextField+MaterialTheming.h (96%) rename components/TextControls/src/{Theming => OutlinedTextFieldsTheming}/MDCOutlinedTextField+MaterialTheming.m (100%) rename components/TextControls/src/{Theming/MaterialTextControls+Theming.h => OutlinedTextFieldsTheming/MaterialTextControls+OutlinedTextFieldsTheming.h} (93%) rename components/TextControls/tests/unit/{ => BaseTextFields}/MDCBaseTextFieldLayoutTests.m (95%) rename components/TextControls/tests/unit/{ => BaseTextFields}/MDCBaseTextFieldTests.m (99%) rename components/TextControls/tests/unit/{ => FilledTextFields}/MDCFilledTextFieldTests.m (98%) rename components/TextControls/tests/unit/{Theming => FilledTextFieldsTheming}/MDCFilledTextFieldThemingTests.m (99%) rename components/TextControls/tests/unit/{ => OutlinedTextFields}/MDCOutlinedTextFieldTests.m (97%) rename components/TextControls/tests/unit/{Theming => OutlinedTextFieldsTheming}/MDCOutlinedTextFieldThemingTests.m (99%) create mode 100644 components/private/TextControlsPrivate/BUILD rename components/{TextControls/src/private => private/TextControlsPrivate/src/BaseStyle}/MDCTextControlStyleBase.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/BaseStyle}/MDCTextControlStyleBase.m (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/BaseStyle}/MDCTextControlVerticalPositioningReferenceBase.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/BaseStyle}/MDCTextControlVerticalPositioningReferenceBase.m (100%) create mode 100644 components/private/TextControlsPrivate/src/BaseStyle/MaterialTextControlsPrivate+BaseStyle.h rename components/{TextControls/src/private => private/TextControlsPrivate/src/FilledStyle}/MDCTextControlStyleFilled.h (96%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/FilledStyle}/MDCTextControlStyleFilled.m (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/FilledStyle}/MDCTextControlVerticalPositioningReferenceFilled.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/FilledStyle}/MDCTextControlVerticalPositioningReferenceFilled.m (100%) create mode 100644 components/private/TextControlsPrivate/src/FilledStyle/MaterialTextControlsPrivate+FilledStyle.h rename components/{TextControls/src/private => private/TextControlsPrivate/src/OutlinedStyle}/MDCTextControlStyleOutlined.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/OutlinedStyle}/MDCTextControlStyleOutlined.m (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/OutlinedStyle}/MDCTextControlVerticalPositioningReferenceOutlined.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/OutlinedStyle}/MDCTextControlVerticalPositioningReferenceOutlined.m (100%) create mode 100644 components/private/TextControlsPrivate/src/OutlinedStyle/MaterialTextControlsPrivate+OutlinedStyle.h rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/MDCTextControl.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/MDCTextControlAssistiveLabelDrawPriority.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/MDCTextControlAssistiveLabelView.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/MDCTextControlAssistiveLabelView.m (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/MDCTextControlAssistiveLabelViewLayout.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/MDCTextControlAssistiveLabelViewLayout.m (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/MDCTextControlColorViewModel.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/MDCTextControlColorViewModel.m (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/MDCTextControlLabelAnimation.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/MDCTextControlLabelAnimation.m (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/MDCTextControlLabelState.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/MDCTextControlVerticalPositioningReference.h (100%) create mode 100644 components/private/TextControlsPrivate/src/Shared/MaterialTextControlsPrivate+Shared.h rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/UIBezierPath+MDCTextControlStyle.h (100%) rename components/{TextControls/src/private => private/TextControlsPrivate/src/Shared}/UIBezierPath+MDCTextControlStyle.m (100%) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 2efbbd70e36..c322a2f9427 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -1536,47 +1536,117 @@ Pod::Spec.new do |mdc| end end - mdc.subspec "TextControls" do |component| + # TextControls+Enums + + mdc.subspec "TextControls+Enums" do |component| component.ios.deployment_target = '9.0' - component.public_header_files = "components/#{component.base_name}/src/*.h" - component.source_files = [ - "components/#{component.base_name}/src/*.{h,m}", - "components/#{component.base_name}/src/private/*.{h,m}" + 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+BaseTextFields + + mdc.subspec "TextControls+BaseTextFields" 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/AnimationTiming" - component.dependency "MaterialComponents/private/Math" + 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}/tests/unit/*.{h,m,swift}", - "components/#{component.base_name}/tests/unit/supplemental/*.{h,m,swift}" + "components/#{component.base_name.split('+')[0]}/tests/unit/#{component.base_name.split('+')[1]}/*.{h,m,swift}" ] - unit_tests.resources = "components/#{component.base_name.split('+')[0]}/tests/unit/#{component.base_name.split('+')[1]}/resources/*" + unit_tests.dependency "MaterialComponents/schemes/Container" end end - mdc.subspec "TextControls+Theming" 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}", - "components/#{extension.base_name.split('+')[0]}/src/#{extension.base_name.split('+')[1]}/private/*.{h,m}" + # TextControls+FilledTextFields + + mdc.subspec "TextControls+FilledTextFields" 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}" ] - extension.dependency "MaterialComponents/#{extension.base_name.split('+')[0]}" - extension.dependency "MaterialComponents/schemes/Color" - extension.dependency "MaterialComponents/schemes/Container" - extension.dependency "MaterialComponents/schemes/Typography" - extension.test_spec 'UnitTests' do |unit_tests| + component.dependency "MaterialComponents/TextControls+BaseTextFields" + component.dependency "MaterialComponents/private/TextControlsPrivate+FilledStyle" + + component.test_spec 'UnitTests' do |unit_tests| unit_tests.source_files = [ - "components/#{extension.base_name.split('+')[0]}/tests/unit/#{extension.base_name.split('+')[1]}/*.{h,m,swift}" + "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+FilledTextFieldsTheming + + mdc.subspec "TextControls+FilledTextFieldsTheming" 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/TextControls+FilledTextFields" + component.dependency "MaterialComponents/schemes/Container" + + 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}" + ] + end + end + + # TextControls+OutlinedTextFields + + mdc.subspec "TextControls+OutlinedTextFields" 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/TextControls+BaseTextFields" + component.dependency "MaterialComponents/private/TextControlsPrivate+OutlinedStyle" + + 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+OutlinedTextFieldsTheming + + mdc.subspec "TextControls+OutlinedTextFieldsTheming" 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/TextControls+OutlinedTextFields" + component.dependency "MaterialComponents/schemes/Container" + + 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}" + ] + end + end + mdc.subspec "TextFields+ColorThemer" do |extension| extension.ios.deployment_target = '9.0' extension.public_header_files = [ @@ -1803,7 +1873,6 @@ Pod::Spec.new do |mdc| component.ios.deployment_target = '9.0' component.public_header_files = "components/private/#{component.base_name}/src/*.h" component.source_files = "components/private/#{component.base_name}/src/*.{h,m}" - component.test_spec 'UnitTests' do |unit_tests| unit_tests.source_files = [ "components/private/#{component.base_name}/tests/unit/*.{h,m,swift}", @@ -1830,6 +1899,47 @@ Pod::Spec.new do |mdc| end end + private_spec.subspec "TextControlsPrivate+Shared" do |component| + component.ios.deployment_target = '9.0' + 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/TextControls+Enums" + component.dependency "MaterialComponents/AnimationTiming" + component.dependency "MaterialComponents/private/Math" + end + + private_spec.subspec "TextControlsPrivate+BaseStyle" do |component| + component.ios.deployment_target = '9.0' + 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/AnimationTiming" + component.dependency "MaterialComponents/private/Math" + end + + private_spec.subspec "TextControlsPrivate+FilledStyle" do |component| + component.ios.deployment_target = '9.0' + 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/AnimationTiming" + component.dependency "MaterialComponents/private/Math" + end + + private_spec.subspec "TextControlsPrivate+OutlinedStyle" do |component| + component.ios.deployment_target = '9.0' + 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/AnimationTiming" + component.dependency "MaterialComponents/private/Math" + end + private_spec.subspec "ThumbTrack" do |component| component.ios.deployment_target = '9.0' component.public_header_files = "components/private/#{component.base_name}/src/*.h" diff --git a/catalog/Podfile b/catalog/Podfile index f4aff73257a..d4b3865f589 100644 --- a/catalog/Podfile +++ b/catalog/Podfile @@ -70,9 +70,12 @@ target "MDCCatalog" do 'Tabs/UnitTests', 'Tabs+Theming/UnitTests', 'TextFields/UnitTests', - 'TextControls/UnitTests', - 'TextControls+Theming/UnitTests', 'TextFields+Theming/UnitTests', + 'TextControls+BaseTextFields/UnitTests', + 'TextControls+FilledTextFields/UnitTests', + 'TextControls+FilledTextFieldsTheming/UnitTests', + 'TextControls+OutlinedTextFields/UnitTests', + 'TextControls+OutlinedTextFieldsTheming/UnitTests', 'Themes/UnitTests', 'Typography/UnitTests', ] diff --git a/components/TextControls/BUILD b/components/TextControls/BUILD index 157f44e73e4..dfca752d158 100644 --- a/components/TextControls/BUILD +++ b/components/TextControls/BUILD @@ -1,4 +1,4 @@ -# Copyright 2017-present The Material Components for iOS Authors. All Rights Reserved. +# 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. @@ -27,36 +27,67 @@ load( licenses(["notice"]) -mdc_objc_library( - name = "private", - hdrs = native.glob(["src/private/*.h"]), - includes = ["src/private"], - visibility = [":test_targets"], -) - package_group( - name = "test_targets", + name = "TextControlsPackageGroup", packages = [ "//components/TextControls/...", ], ) -mdc_public_objc_library( - name = "TextControls", - sdk_frameworks = [ - "QuartzCore", +mdc_extension_objc_library( + name = "Enums", + visibility = [ + ":TextControlsPackageGroup", + "//components/private/TextControlsPrivate:TextControlsPrivatePackageGroup", ], +) + +mdc_extension_objc_library( + name = "BaseTextFields", deps = [ - "//components/AnimationTiming", - "//components/private/Math", + "//components/private/TextControlsPrivate:BaseStyle", + "//components/private/TextControlsPrivate:Shared", "@material_internationalization_ios//:MDFInternationalization", ], ) +mdc_objc_library( + name = "BaseTextFieldsPrivate", + hdrs = native.glob(["src/BaseTextFields/private/*.h"]), + includes = ["src/BaseTextFields/private"], + visibility = [ + ":TextControlsPackageGroup", + ], +) + +mdc_extension_objc_library( + name = "FilledTextFields", + deps = [ + ":BaseTextFields", + "//components/private/TextControlsPrivate:FilledStyle", + ], +) + +mdc_extension_objc_library( + name = "FilledTextFieldsTheming", + deps = [ + ":FilledTextFields", + "//components/schemes/Container", + ], +) + +mdc_extension_objc_library( + name = "OutlinedTextFields", + deps = [ + ":BaseTextFields", + "//components/private/TextControlsPrivate:OutlinedStyle", + ], +) + mdc_extension_objc_library( - name = "Theming", + name = "OutlinedTextFieldsTheming", deps = [ - ":TextControls", + ":OutlinedTextFields", "//components/schemes/Container", ], ) @@ -64,8 +95,11 @@ mdc_extension_objc_library( mdc_examples_objc_library( name = "ObjcExamples", deps = [ - ":TextControls", - ":Theming", + ":BaseTextFields", + ":FilledTextFields", + ":FilledTextFieldsTheming", + ":OutlinedTextFields", + ":OutlinedTextFieldsTheming", "//components/Buttons", "//components/Buttons:Theming", "//components/schemes/Container", @@ -75,20 +109,26 @@ mdc_examples_objc_library( mdc_examples_swift_library( name = "SwiftExamples", deps = [ - ":TextControls", - ":Theming", + ":BaseTextFields", + ":FilledTextFields", + ":FilledTextFieldsTheming", + ":OutlinedTextFields", + ":OutlinedTextFieldsTheming", ], ) mdc_unit_test_objc_library( name = "unit_test_sources", extra_srcs = glob([ - "tests/unit/Theming/*.m", + "tests/unit/*/*.m", ]), deps = [ - ":TextControls", - ":Theming", - ":private", + ":BaseTextFields", + ":BaseTextFieldsPrivate", + ":FilledTextFields", + ":FilledTextFieldsTheming", + ":OutlinedTextFields", + ":OutlinedTextFieldsTheming", ], ) @@ -98,9 +138,15 @@ mdc_snapshot_objc_library( "CoreGraphics", ], deps = [ - ":TextControls", - ":Theming", - ":private", + ":BaseTextFields", + ":Enums", + ":FilledTextFields", + ":FilledTextFieldsTheming", + ":OutlinedTextFields", + ":OutlinedTextFieldsTheming", + "//components/private/TextControlsPrivate:FilledStyle", + "//components/private/TextControlsPrivate:OutlinedStyle", + "//components/private/TextControlsPrivate:Shared", ], ) diff --git a/components/TextControls/README.md b/components/TextControls/README.md index 4138bc3097a..31f6c2490e5 100644 --- a/components/TextControls/README.md +++ b/components/TextControls/README.md @@ -93,15 +93,14 @@ The largest difference between MDCTextControl text fields and UITextFields from ### Theming -You can theme a text field to match the Material Design style by using a theming extension. The content below assumes you have read the article on [Theming](../../docs/theming.md). +You can theme a text field to match the Material Design style by importing a theming extension. The content below assumes you have read the article on [Theming](../../docs/theming.md). -First, import the theming extension for TextControls and create a text field. +First, import the text field theming extension and create a text field. #### Swift ```swift -import MaterialComponents.MaterialTextControls -import MaterialComponents.MaterialTextControls_Theming +import MaterialComponents.MaterialTextControls_OutlinedTextFieldsTheming let textField = MDCOutlinedTextField() ``` @@ -109,14 +108,13 @@ let textField = MDCOutlinedTextField() #### Objective-C ```objc -#import -#import +#import MDCFilledTextField *filledTextField = [[MDCFilledTextField alloc] init]; ``` -Then pass a container scheme to one of the theming methods on a theming extension. +Then pass a container scheme to one of the theming methods on the theming extension. #### Swift @@ -125,7 +123,6 @@ filledTextField.applyTheme(withScheme: containerScheme) ``` #### Objective-C - ```objc [self.filledTextField applyThemeWithScheme:self.containerScheme]; ``` diff --git a/components/TextControls/docs/theming.md b/components/TextControls/docs/theming.md index 6cc7356878e..56702e1f5d5 100644 --- a/components/TextControls/docs/theming.md +++ b/components/TextControls/docs/theming.md @@ -1,14 +1,13 @@ ### Theming -You can theme a text field to match the Material Design style by using a theming extension. The content below assumes you have read the article on [Theming](../../../docs/theming.md). +You can theme a text field to match the Material Design style by importing a theming extension. The content below assumes you have read the article on [Theming](../../../docs/theming.md). -First, import the theming extension for TextControls and create a text field. +First, import the text field theming extension and create a text field. #### Swift ```swift -import MaterialComponents.MaterialTextControls -import MaterialComponents.MaterialTextControls_Theming +import MaterialComponents.MaterialTextControls_OutlinedTextFieldsTheming let textField = MDCOutlinedTextField() ``` @@ -16,14 +15,13 @@ let textField = MDCOutlinedTextField() #### Objective-C ```objc -#import -#import +#import MDCFilledTextField *filledTextField = [[MDCFilledTextField alloc] init]; ``` -Then pass a container scheme to one of the theming methods on a theming extension. +Then pass a container scheme to one of the theming methods on the theming extension. #### Swift @@ -32,7 +30,6 @@ filledTextField.applyTheme(withScheme: containerScheme) ``` #### Objective-C - ```objc [self.filledTextField applyThemeWithScheme:self.containerScheme]; ``` diff --git a/components/TextControls/examples/MDCTextControlTextFieldsStoryboardExample.swift b/components/TextControls/examples/MDCTextControlTextFieldsStoryboardExample.swift index 165c0f3b1c1..e701de306a8 100644 --- a/components/TextControls/examples/MDCTextControlTextFieldsStoryboardExample.swift +++ b/components/TextControls/examples/MDCTextControlTextFieldsStoryboardExample.swift @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -import MaterialComponents.MaterialTextControls -import MaterialComponents.MaterialTextControls_Theming +import MaterialComponents.MaterialTextControls_FilledTextFieldsTheming +import MaterialComponents.MaterialTextControls_OutlinedTextFieldsTheming import UIKit diff --git a/components/TextControls/examples/supplemental/MDCTextControlConfiguratorExample.m b/components/TextControls/examples/supplemental/MDCTextControlConfiguratorExample.m index edf6392893c..9a27550c69d 100644 --- a/components/TextControls/examples/supplemental/MDCTextControlConfiguratorExample.m +++ b/components/TextControls/examples/supplemental/MDCTextControlConfiguratorExample.m @@ -16,8 +16,9 @@ #import "MaterialButtons.h" #import "MaterialContainerScheme.h" -#import "MaterialTextControls+Theming.h" -#import "MaterialTextControls.h" +#import "MaterialTextControls+FilledTextFieldsTheming.h" +#import "MaterialTextControls+OutlinedTextFieldsTheming.h" +#import "MaterialTextControlsPrivate+Shared.h" #import "MDCTextControlConfiguratorExample.h" #import "MDCTraitEnvironmentChangeDelegate.h" diff --git a/components/TextControls/src/MDCBaseTextField.h b/components/TextControls/src/BaseTextFields/MDCBaseTextField.h similarity index 98% rename from components/TextControls/src/MDCBaseTextField.h rename to components/TextControls/src/BaseTextFields/MDCBaseTextField.h index bab9d7eed74..c4f1e2892c1 100644 --- a/components/TextControls/src/MDCBaseTextField.h +++ b/components/TextControls/src/BaseTextFields/MDCBaseTextField.h @@ -14,8 +14,7 @@ #import -#import "MDCTextControlLabelBehavior.h" -#import "MDCTextControlState.h" +#import "MaterialTextControls+Enums.h" /** A UITextField subclass that will potentially provide the foundation for Material TextFields in the diff --git a/components/TextControls/src/MDCBaseTextField.m b/components/TextControls/src/BaseTextFields/MDCBaseTextField.m similarity index 98% rename from components/TextControls/src/MDCBaseTextField.m rename to components/TextControls/src/BaseTextFields/MDCBaseTextField.m index 3d631ce894c..0b037cbf31b 100644 --- a/components/TextControls/src/MDCBaseTextField.m +++ b/components/TextControls/src/BaseTextFields/MDCBaseTextField.m @@ -18,15 +18,10 @@ #import -#import "MDCTextControlState.h" #import "MaterialMath.h" +#import "MaterialTextControlsPrivate+BaseStyle.h" +#import "MaterialTextControlsPrivate+Shared.h" #import "private/MDCBaseTextFieldLayout.h" -#import "private/MDCTextControlAssistiveLabelView.h" -#import "private/MDCTextControlColorViewModel.h" -#import "private/MDCTextControlLabelAnimation.h" -#import "private/MDCTextControlLabelState.h" -#import "private/MDCTextControlStyleBase.h" -#import "private/MDCTextControlVerticalPositioningReferenceBase.h" @interface MDCBaseTextField () diff --git a/components/TextControls/src/private/MDCBaseTextField+MDCTextControl.h b/components/TextControls/src/BaseTextFields/MaterialTextControls+BaseTextFields.h similarity index 69% rename from components/TextControls/src/private/MDCBaseTextField+MDCTextControl.h rename to components/TextControls/src/BaseTextFields/MaterialTextControls+BaseTextFields.h index 00d69c0727d..a73c4fc3e58 100644 --- a/components/TextControls/src/private/MDCBaseTextField+MDCTextControl.h +++ b/components/TextControls/src/BaseTextFields/MaterialTextControls+BaseTextFields.h @@ -12,13 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import #import "MDCBaseTextField.h" -#import "MDCTextControl.h" - -/** - This category is imported from MDCBaseTextField subclasses and categories, as well as categories of - MDCBaseTextField subclasses, to make MDCTextControl conformance visible. - */ -@interface MDCBaseTextField (Private) -@end diff --git a/components/TextControls/src/private/MDCBaseTextFieldLayout.h b/components/TextControls/src/BaseTextFields/private/MDCBaseTextFieldLayout.h similarity index 95% rename from components/TextControls/src/private/MDCBaseTextFieldLayout.h rename to components/TextControls/src/BaseTextFields/private/MDCBaseTextFieldLayout.h index 0fb7ee3da8c..eba82927dc8 100644 --- a/components/TextControls/src/private/MDCBaseTextFieldLayout.h +++ b/components/TextControls/src/BaseTextFields/private/MDCBaseTextFieldLayout.h @@ -15,9 +15,7 @@ #import #import -#import "MDCTextControlAssistiveLabelDrawPriority.h" -#import "MDCTextControlAssistiveLabelViewLayout.h" -#import "MDCTextControlVerticalPositioningReference.h" +#import "MaterialTextControlsPrivate+Shared.h" @interface MDCBaseTextFieldLayout : NSObject diff --git a/components/TextControls/src/private/MDCBaseTextFieldLayout.m b/components/TextControls/src/BaseTextFields/private/MDCBaseTextFieldLayout.m similarity index 100% rename from components/TextControls/src/private/MDCBaseTextFieldLayout.m rename to components/TextControls/src/BaseTextFields/private/MDCBaseTextFieldLayout.m diff --git a/components/TextControls/src/MDCTextControlLabelBehavior.h b/components/TextControls/src/Enums/MDCTextControlLabelBehavior.h similarity index 100% rename from components/TextControls/src/MDCTextControlLabelBehavior.h rename to components/TextControls/src/Enums/MDCTextControlLabelBehavior.h diff --git a/components/TextControls/src/MDCTextControlState.h b/components/TextControls/src/Enums/MDCTextControlState.h similarity index 100% rename from components/TextControls/src/MDCTextControlState.h rename to components/TextControls/src/Enums/MDCTextControlState.h diff --git a/components/TextControls/src/MaterialTextControls.h b/components/TextControls/src/Enums/MaterialTextControls+Enums.h similarity index 88% rename from components/TextControls/src/MaterialTextControls.h rename to components/TextControls/src/Enums/MaterialTextControls+Enums.h index be6b864d4cc..41c51b288a1 100644 --- a/components/TextControls/src/MaterialTextControls.h +++ b/components/TextControls/src/Enums/MaterialTextControls+Enums.h @@ -12,8 +12,5 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "MDCBaseTextField.h" -#import "MDCFilledTextField.h" -#import "MDCOutlinedTextField.h" #import "MDCTextControlLabelBehavior.h" #import "MDCTextControlState.h" diff --git a/components/TextControls/src/MDCFilledTextField.h b/components/TextControls/src/FilledTextFields/MDCFilledTextField.h similarity index 97% rename from components/TextControls/src/MDCFilledTextField.h rename to components/TextControls/src/FilledTextFields/MDCFilledTextField.h index 7e66990a00f..6ee6240b589 100644 --- a/components/TextControls/src/MDCFilledTextField.h +++ b/components/TextControls/src/FilledTextFields/MDCFilledTextField.h @@ -14,7 +14,7 @@ #import -#import "MDCBaseTextField.h" +#import "MaterialTextControls+BaseTextFields.h" /** An implementation of a Material filled text field. diff --git a/components/TextControls/src/MDCFilledTextField.m b/components/TextControls/src/FilledTextFields/MDCFilledTextField.m similarity index 93% rename from components/TextControls/src/MDCFilledTextField.m rename to components/TextControls/src/FilledTextFields/MDCFilledTextField.m index 07b5dc87646..1d768f6545c 100644 --- a/components/TextControls/src/MDCFilledTextField.m +++ b/components/TextControls/src/FilledTextFields/MDCFilledTextField.m @@ -16,9 +16,11 @@ #import -#import "private/MDCBaseTextField+MDCTextControl.h" -#import "private/MDCTextControl.h" -#import "private/MDCTextControlStyleFilled.h" +#import "MaterialTextControlsPrivate+FilledStyle.h" +#import "MaterialTextControlsPrivate+Shared.h" + +@interface MDCFilledTextField (Private) +@end @interface MDCFilledTextField () @end diff --git a/components/TextControls/src/FilledTextFields/MaterialTextControls+FilledTextFields.h b/components/TextControls/src/FilledTextFields/MaterialTextControls+FilledTextFields.h new file mode 100644 index 00000000000..86348e4ec39 --- /dev/null +++ b/components/TextControls/src/FilledTextFields/MaterialTextControls+FilledTextFields.h @@ -0,0 +1,15 @@ +// 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 "MDCFilledTextField.h" diff --git a/components/TextControls/src/Theming/MDCFilledTextField+MaterialTheming.h b/components/TextControls/src/FilledTextFieldsTheming/MDCFilledTextField+MaterialTheming.h similarity index 96% rename from components/TextControls/src/Theming/MDCFilledTextField+MaterialTheming.h rename to components/TextControls/src/FilledTextFieldsTheming/MDCFilledTextField+MaterialTheming.h index 29e893c3edc..9f7296caf5b 100644 --- a/components/TextControls/src/Theming/MDCFilledTextField+MaterialTheming.h +++ b/components/TextControls/src/FilledTextFieldsTheming/MDCFilledTextField+MaterialTheming.h @@ -14,8 +14,8 @@ #import -#import "MDCFilledTextField.h" #import "MaterialContainerScheme.h" +#import "MaterialTextControls+FilledTextFields.h" /** This category is used to style MDCFilledTextField instances with an MDCContainerScheme. diff --git a/components/TextControls/src/Theming/MDCFilledTextField+MaterialTheming.m b/components/TextControls/src/FilledTextFieldsTheming/MDCFilledTextField+MaterialTheming.m similarity index 100% rename from components/TextControls/src/Theming/MDCFilledTextField+MaterialTheming.m rename to components/TextControls/src/FilledTextFieldsTheming/MDCFilledTextField+MaterialTheming.m diff --git a/components/TextControls/src/FilledTextFieldsTheming/MaterialTextControls+FilledTextFieldsTheming.h b/components/TextControls/src/FilledTextFieldsTheming/MaterialTextControls+FilledTextFieldsTheming.h new file mode 100644 index 00000000000..e026413461c --- /dev/null +++ b/components/TextControls/src/FilledTextFieldsTheming/MaterialTextControls+FilledTextFieldsTheming.h @@ -0,0 +1,15 @@ +// 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 "MDCFilledTextField+MaterialTheming.h" diff --git a/components/TextControls/src/MDCOutlinedTextField.h b/components/TextControls/src/OutlinedTextFields/MDCOutlinedTextField.h similarity index 96% rename from components/TextControls/src/MDCOutlinedTextField.h rename to components/TextControls/src/OutlinedTextFields/MDCOutlinedTextField.h index 06f1986da6c..0208c21bbd8 100644 --- a/components/TextControls/src/MDCOutlinedTextField.h +++ b/components/TextControls/src/OutlinedTextFields/MDCOutlinedTextField.h @@ -14,7 +14,7 @@ #import -#import "MDCBaseTextField.h" +#import "MaterialTextControls+BaseTextFields.h" /** An implementation of a Material outlined text field. diff --git a/components/TextControls/src/MDCOutlinedTextField.m b/components/TextControls/src/OutlinedTextFields/MDCOutlinedTextField.m similarity index 93% rename from components/TextControls/src/MDCOutlinedTextField.m rename to components/TextControls/src/OutlinedTextFields/MDCOutlinedTextField.m index 9cd099f8061..87dd7838159 100644 --- a/components/TextControls/src/MDCOutlinedTextField.m +++ b/components/TextControls/src/OutlinedTextFields/MDCOutlinedTextField.m @@ -16,9 +16,10 @@ #import -#import "private/MDCBaseTextField+MDCTextControl.h" -#import "private/MDCTextControl.h" -#import "private/MDCTextControlStyleOutlined.h" +#import "MaterialTextControlsPrivate+OutlinedStyle.h" + +@interface MDCOutlinedTextField (Private) +@end @interface MDCOutlinedTextField () @end diff --git a/components/TextControls/src/OutlinedTextFields/MaterialTextControls+OutlinedTextFields.h b/components/TextControls/src/OutlinedTextFields/MaterialTextControls+OutlinedTextFields.h new file mode 100644 index 00000000000..4262b671954 --- /dev/null +++ b/components/TextControls/src/OutlinedTextFields/MaterialTextControls+OutlinedTextFields.h @@ -0,0 +1,15 @@ +// 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 "MDCOutlinedTextField.h" diff --git a/components/TextControls/src/Theming/MDCOutlinedTextField+MaterialTheming.h b/components/TextControls/src/OutlinedTextFieldsTheming/MDCOutlinedTextField+MaterialTheming.h similarity index 96% rename from components/TextControls/src/Theming/MDCOutlinedTextField+MaterialTheming.h rename to components/TextControls/src/OutlinedTextFieldsTheming/MDCOutlinedTextField+MaterialTheming.h index e1cc6d3e8d5..73de86a8af0 100644 --- a/components/TextControls/src/Theming/MDCOutlinedTextField+MaterialTheming.h +++ b/components/TextControls/src/OutlinedTextFieldsTheming/MDCOutlinedTextField+MaterialTheming.h @@ -14,8 +14,8 @@ #import -#import "MDCOutlinedTextField.h" #import "MaterialContainerScheme.h" +#import "MaterialTextControls+OutlinedTextFields.h" /** This category is used to style MDCOutlinedTextField instances with an MDCContainerScheme. diff --git a/components/TextControls/src/Theming/MDCOutlinedTextField+MaterialTheming.m b/components/TextControls/src/OutlinedTextFieldsTheming/MDCOutlinedTextField+MaterialTheming.m similarity index 100% rename from components/TextControls/src/Theming/MDCOutlinedTextField+MaterialTheming.m rename to components/TextControls/src/OutlinedTextFieldsTheming/MDCOutlinedTextField+MaterialTheming.m diff --git a/components/TextControls/src/Theming/MaterialTextControls+Theming.h b/components/TextControls/src/OutlinedTextFieldsTheming/MaterialTextControls+OutlinedTextFieldsTheming.h similarity index 93% rename from components/TextControls/src/Theming/MaterialTextControls+Theming.h rename to components/TextControls/src/OutlinedTextFieldsTheming/MaterialTextControls+OutlinedTextFieldsTheming.h index f76d6fa3910..c9adebf0520 100644 --- a/components/TextControls/src/Theming/MaterialTextControls+Theming.h +++ b/components/TextControls/src/OutlinedTextFieldsTheming/MaterialTextControls+OutlinedTextFieldsTheming.h @@ -12,5 +12,4 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "MDCFilledTextField+MaterialTheming.h" #import "MDCOutlinedTextField+MaterialTheming.h" diff --git a/components/TextControls/tests/snapshot/MDCBaseTextFieldSnapshotTests.m b/components/TextControls/tests/snapshot/MDCBaseTextFieldSnapshotTests.m index e800bad8325..95eb8229419 100644 --- a/components/TextControls/tests/snapshot/MDCBaseTextFieldSnapshotTests.m +++ b/components/TextControls/tests/snapshot/MDCBaseTextFieldSnapshotTests.m @@ -16,8 +16,8 @@ #import -#import "../../src/private/MDCTextControl.h" -#import "MaterialTextControls.h" +#import "MaterialTextControls+FilledTextFieldsTheming.h" +#import "MaterialTextControls+OutlinedTextFieldsTheming.h" #import "supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h" #import "supplemental/MDCTextControlSnapshotTestHelpers.h" diff --git a/components/TextControls/tests/snapshot/MDCFilledTextFieldSnapshotTests.m b/components/TextControls/tests/snapshot/MDCFilledTextFieldSnapshotTests.m index c4f7646bcf8..c93b3b5c6cf 100644 --- a/components/TextControls/tests/snapshot/MDCFilledTextFieldSnapshotTests.m +++ b/components/TextControls/tests/snapshot/MDCFilledTextFieldSnapshotTests.m @@ -16,8 +16,8 @@ #import -#import "../../src/private/MDCTextControl.h" -#import "MaterialTextControls.h" +#import "MaterialTextControls+FilledTextFieldsTheming.h" +#import "MaterialTextControls+OutlinedTextFieldsTheming.h" #import "supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h" #import "supplemental/MDCTextControlSnapshotTestHelpers.h" diff --git a/components/TextControls/tests/snapshot/MDCOutlinedTextFieldSnapshotTests.m b/components/TextControls/tests/snapshot/MDCOutlinedTextFieldSnapshotTests.m index efd26aa0075..8bfe7d8be4e 100644 --- a/components/TextControls/tests/snapshot/MDCOutlinedTextFieldSnapshotTests.m +++ b/components/TextControls/tests/snapshot/MDCOutlinedTextFieldSnapshotTests.m @@ -16,8 +16,8 @@ #import -#import "../../src/private/MDCTextControl.h" -#import "MaterialTextControls.h" +#import "MaterialTextControls+FilledTextFieldsTheming.h" +#import "MaterialTextControls+OutlinedTextFieldsTheming.h" #import "supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h" #import "supplemental/MDCTextControlSnapshotTestHelpers.h" diff --git a/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h b/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h index dd2de50db03..682ffed520c 100644 --- a/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h +++ b/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h @@ -16,7 +16,8 @@ #import -#import "MaterialTextControls.h" +#import "MaterialTextControls+FilledTextFieldsTheming.h" +#import "MaterialTextControls+OutlinedTextFieldsTheming.h" @interface MDCBaseTextFieldTestsSnapshotTestHelpers : NSObject diff --git a/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.m b/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.m index 2008442c0c6..f884689b74a 100644 --- a/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.m +++ b/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.m @@ -18,6 +18,8 @@ #import "MDCBaseTextFieldTestsSnapshotTestHelpers.h" #import "MDCTextControlSnapshotTestHelpers.h" +#import "MaterialTextControls+FilledTextFieldsTheming.h" +#import "MaterialTextControls+OutlinedTextFieldsTheming.h" @interface MDCBaseTextField (AnimationDuration) @property(nonatomic, assign) NSTimeInterval animationDuration; diff --git a/components/TextControls/tests/snapshot/supplemental/MDCTextControlSnapshotTestHelpers.h b/components/TextControls/tests/snapshot/supplemental/MDCTextControlSnapshotTestHelpers.h index 3616124d25e..69aa72ad992 100644 --- a/components/TextControls/tests/snapshot/supplemental/MDCTextControlSnapshotTestHelpers.h +++ b/components/TextControls/tests/snapshot/supplemental/MDCTextControlSnapshotTestHelpers.h @@ -16,7 +16,7 @@ #import -#import "../../../src/private/MDCTextControl.h" +#import "MaterialTextControlsPrivate+Shared.h" @interface MDCTextControlSnapshotTestHelpers : NSObject diff --git a/components/TextControls/tests/snapshot/supplemental/MDCTextControlSnapshotTestHelpers.m b/components/TextControls/tests/snapshot/supplemental/MDCTextControlSnapshotTestHelpers.m index 145940fc55a..79f72e8aeca 100644 --- a/components/TextControls/tests/snapshot/supplemental/MDCTextControlSnapshotTestHelpers.m +++ b/components/TextControls/tests/snapshot/supplemental/MDCTextControlSnapshotTestHelpers.m @@ -16,8 +16,6 @@ #import -#import "MaterialTextControls.h" - #import "MDCTextControlSnapshotTestHelpers.h" #import "MDCBaseTextFieldTestsSnapshotTestHelpers.h" diff --git a/components/TextControls/tests/unit/MDCBaseTextFieldLayoutTests.m b/components/TextControls/tests/unit/BaseTextFields/MDCBaseTextFieldLayoutTests.m similarity index 95% rename from components/TextControls/tests/unit/MDCBaseTextFieldLayoutTests.m rename to components/TextControls/tests/unit/BaseTextFields/MDCBaseTextFieldLayoutTests.m index ba6d7c9ea07..cb3b9f3e078 100644 --- a/components/TextControls/tests/unit/MDCBaseTextFieldLayoutTests.m +++ b/components/TextControls/tests/unit/BaseTextFields/MDCBaseTextFieldLayoutTests.m @@ -14,11 +14,8 @@ #import -#import "MaterialTextControls.h" - -#import "../../src/private/MDCBaseTextFieldLayout.h" -#import "../../src/private/MDCTextControlAssistiveLabelView.h" -#import "../../src/private/MDCTextControlVerticalPositioningReferenceBase.h" +#import "../../../src/BaseTextFields/private/MDCBaseTextFieldLayout.h" +#import "MaterialTextControlsPrivate+BaseStyle.h" @interface MDCBaseTextFieldLayout (Testing) - (CGFloat)textHeightWithFont:(UIFont *)font; diff --git a/components/TextControls/tests/unit/MDCBaseTextFieldTests.m b/components/TextControls/tests/unit/BaseTextFields/MDCBaseTextFieldTests.m similarity index 99% rename from components/TextControls/tests/unit/MDCBaseTextFieldTests.m rename to components/TextControls/tests/unit/BaseTextFields/MDCBaseTextFieldTests.m index b9341cc4fbc..62ef74656d7 100644 --- a/components/TextControls/tests/unit/MDCBaseTextFieldTests.m +++ b/components/TextControls/tests/unit/BaseTextFields/MDCBaseTextFieldTests.m @@ -14,9 +14,8 @@ #import -#import "MaterialTextControls.h" - -#import "../../src/private/MDCTextControlLabelState.h" +#import "MaterialTextControls+BaseTextFields.h" +#import "MaterialTextControlsPrivate+BaseStyle.h" @interface MDCBaseTextField (Private) @property(nonatomic, assign) UIUserInterfaceLayoutDirection layoutDirection; diff --git a/components/TextControls/tests/unit/MDCFilledTextFieldTests.m b/components/TextControls/tests/unit/FilledTextFields/MDCFilledTextFieldTests.m similarity index 98% rename from components/TextControls/tests/unit/MDCFilledTextFieldTests.m rename to components/TextControls/tests/unit/FilledTextFields/MDCFilledTextFieldTests.m index 6a0f89e61a1..39575124979 100644 --- a/components/TextControls/tests/unit/MDCFilledTextFieldTests.m +++ b/components/TextControls/tests/unit/FilledTextFields/MDCFilledTextFieldTests.m @@ -14,7 +14,7 @@ #import -#import "MaterialTextControls.h" +#import "MaterialTextControls+FilledTextFields.h" @interface MDCFilledTextFieldTests : XCTestCase @end diff --git a/components/TextControls/tests/unit/Theming/MDCFilledTextFieldThemingTests.m b/components/TextControls/tests/unit/FilledTextFieldsTheming/MDCFilledTextFieldThemingTests.m similarity index 99% rename from components/TextControls/tests/unit/Theming/MDCFilledTextFieldThemingTests.m rename to components/TextControls/tests/unit/FilledTextFieldsTheming/MDCFilledTextFieldThemingTests.m index afe5e6ceded..e7e7dafa36d 100644 --- a/components/TextControls/tests/unit/Theming/MDCFilledTextFieldThemingTests.m +++ b/components/TextControls/tests/unit/FilledTextFieldsTheming/MDCFilledTextFieldThemingTests.m @@ -15,8 +15,7 @@ #import #import "MaterialContainerScheme.h" -#import "MaterialTextControls+Theming.h" -#import "MaterialTextControls.h" +#import "MaterialTextControls+FilledTextFieldsTheming.h" static const CGFloat kDisabledOpacity = (CGFloat)0.60; diff --git a/components/TextControls/tests/unit/MDCOutlinedTextFieldTests.m b/components/TextControls/tests/unit/OutlinedTextFields/MDCOutlinedTextFieldTests.m similarity index 97% rename from components/TextControls/tests/unit/MDCOutlinedTextFieldTests.m rename to components/TextControls/tests/unit/OutlinedTextFields/MDCOutlinedTextFieldTests.m index 0b210ded5bc..1680274024e 100644 --- a/components/TextControls/tests/unit/MDCOutlinedTextFieldTests.m +++ b/components/TextControls/tests/unit/OutlinedTextFields/MDCOutlinedTextFieldTests.m @@ -14,7 +14,7 @@ #import -#import "MaterialTextControls.h" +#import "MaterialTextControls+OutlinedTextFields.h" @interface MDCOutlinedTextFieldTests : XCTestCase @end diff --git a/components/TextControls/tests/unit/Theming/MDCOutlinedTextFieldThemingTests.m b/components/TextControls/tests/unit/OutlinedTextFieldsTheming/MDCOutlinedTextFieldThemingTests.m similarity index 99% rename from components/TextControls/tests/unit/Theming/MDCOutlinedTextFieldThemingTests.m rename to components/TextControls/tests/unit/OutlinedTextFieldsTheming/MDCOutlinedTextFieldThemingTests.m index 68e4139635e..4cfc743b354 100644 --- a/components/TextControls/tests/unit/Theming/MDCOutlinedTextFieldThemingTests.m +++ b/components/TextControls/tests/unit/OutlinedTextFieldsTheming/MDCOutlinedTextFieldThemingTests.m @@ -15,8 +15,7 @@ #import #import "MaterialContainerScheme.h" -#import "MaterialTextControls+Theming.h" -#import "MaterialTextControls.h" +#import "MaterialTextControls+OutlinedTextFieldsTheming.h" static const CGFloat kDisabledOpacity = (CGFloat)0.60; diff --git a/components/private/TextControlsPrivate/BUILD b/components/private/TextControlsPrivate/BUILD new file mode 100644 index 00000000000..5d016651e0e --- /dev/null +++ b/components/private/TextControlsPrivate/BUILD @@ -0,0 +1,88 @@ +# 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. + +load( + "//:material_components_ios.bzl", + "mdc_extension_objc_library", +) + +licenses(["notice"]) # Apache 2.0 + +package_group( + name = "TextControlsPrivatePackageGroup", + packages = [ + "//components/private/TextControlsPrivate/...", + ], +) + +mdc_extension_objc_library( + name = "Shared", + sdk_frameworks = [ + "QuartzCore", + ], + visibility = [ + "//components/TextControls:TextControlsPackageGroup", + ], + deps = [ + "//components/AnimationTiming", + "//components/TextControls:Enums", + "//components/private/Math", + "@material_internationalization_ios//:MDFInternationalization", + ], +) + +mdc_extension_objc_library( + name = "BaseStyle", + sdk_frameworks = [ + "QuartzCore", + ], + visibility = [ + "//components/TextControls:TextControlsPackageGroup", + ], + deps = [ + ":Shared", + "//components/AnimationTiming", + "//components/private/Math", + ], +) + +mdc_extension_objc_library( + name = "FilledStyle", + sdk_frameworks = [ + "QuartzCore", + ], + visibility = [ + "//components/TextControls:TextControlsPackageGroup", + ], + deps = [ + ":Shared", + "//components/AnimationTiming", + "//components/private/Math", + ], +) + +mdc_extension_objc_library( + name = "OutlinedStyle", + sdk_frameworks = [ + "QuartzCore", + ], + visibility = [ + "//components/TextControls:TextControlsPackageGroup", + ], + deps = [ + ":Shared", + "//components/AnimationTiming", + "//components/private/Math", + ], +) diff --git a/components/TextControls/src/private/MDCTextControlStyleBase.h b/components/private/TextControlsPrivate/src/BaseStyle/MDCTextControlStyleBase.h similarity index 100% rename from components/TextControls/src/private/MDCTextControlStyleBase.h rename to components/private/TextControlsPrivate/src/BaseStyle/MDCTextControlStyleBase.h diff --git a/components/TextControls/src/private/MDCTextControlStyleBase.m b/components/private/TextControlsPrivate/src/BaseStyle/MDCTextControlStyleBase.m similarity index 100% rename from components/TextControls/src/private/MDCTextControlStyleBase.m rename to components/private/TextControlsPrivate/src/BaseStyle/MDCTextControlStyleBase.m diff --git a/components/TextControls/src/private/MDCTextControlVerticalPositioningReferenceBase.h b/components/private/TextControlsPrivate/src/BaseStyle/MDCTextControlVerticalPositioningReferenceBase.h similarity index 100% rename from components/TextControls/src/private/MDCTextControlVerticalPositioningReferenceBase.h rename to components/private/TextControlsPrivate/src/BaseStyle/MDCTextControlVerticalPositioningReferenceBase.h diff --git a/components/TextControls/src/private/MDCTextControlVerticalPositioningReferenceBase.m b/components/private/TextControlsPrivate/src/BaseStyle/MDCTextControlVerticalPositioningReferenceBase.m similarity index 100% rename from components/TextControls/src/private/MDCTextControlVerticalPositioningReferenceBase.m rename to components/private/TextControlsPrivate/src/BaseStyle/MDCTextControlVerticalPositioningReferenceBase.m diff --git a/components/private/TextControlsPrivate/src/BaseStyle/MaterialTextControlsPrivate+BaseStyle.h b/components/private/TextControlsPrivate/src/BaseStyle/MaterialTextControlsPrivate+BaseStyle.h new file mode 100644 index 00000000000..d1d1458f006 --- /dev/null +++ b/components/private/TextControlsPrivate/src/BaseStyle/MaterialTextControlsPrivate+BaseStyle.h @@ -0,0 +1,16 @@ +// 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 "MDCTextControlStyleBase.h" +#import "MDCTextControlVerticalPositioningReferenceBase.h" diff --git a/components/TextControls/src/private/MDCTextControlStyleFilled.h b/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlStyleFilled.h similarity index 96% rename from components/TextControls/src/private/MDCTextControlStyleFilled.h rename to components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlStyleFilled.h index 99b97a3f647..48d0435c70c 100644 --- a/components/TextControls/src/private/MDCTextControlStyleFilled.h +++ b/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlStyleFilled.h @@ -15,8 +15,6 @@ #import #import "MDCTextControl.h" -#import "MDCTextControlLabelBehavior.h" -#import "MDCTextControlStyleBase.h" // TODO: When the MDCBaseTextField subclass that makes use of this style (and the path drawing logic // inside it) lands there should be snapshot tests for it. diff --git a/components/TextControls/src/private/MDCTextControlStyleFilled.m b/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlStyleFilled.m similarity index 100% rename from components/TextControls/src/private/MDCTextControlStyleFilled.m rename to components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlStyleFilled.m diff --git a/components/TextControls/src/private/MDCTextControlVerticalPositioningReferenceFilled.h b/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlVerticalPositioningReferenceFilled.h similarity index 100% rename from components/TextControls/src/private/MDCTextControlVerticalPositioningReferenceFilled.h rename to components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlVerticalPositioningReferenceFilled.h diff --git a/components/TextControls/src/private/MDCTextControlVerticalPositioningReferenceFilled.m b/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlVerticalPositioningReferenceFilled.m similarity index 100% rename from components/TextControls/src/private/MDCTextControlVerticalPositioningReferenceFilled.m rename to components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlVerticalPositioningReferenceFilled.m diff --git a/components/private/TextControlsPrivate/src/FilledStyle/MaterialTextControlsPrivate+FilledStyle.h b/components/private/TextControlsPrivate/src/FilledStyle/MaterialTextControlsPrivate+FilledStyle.h new file mode 100644 index 00000000000..c287a9a182f --- /dev/null +++ b/components/private/TextControlsPrivate/src/FilledStyle/MaterialTextControlsPrivate+FilledStyle.h @@ -0,0 +1,16 @@ +// 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 "MDCTextControlStyleFilled.h" +#import "MDCTextControlVerticalPositioningReferenceFilled.h" diff --git a/components/TextControls/src/private/MDCTextControlStyleOutlined.h b/components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlStyleOutlined.h similarity index 100% rename from components/TextControls/src/private/MDCTextControlStyleOutlined.h rename to components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlStyleOutlined.h diff --git a/components/TextControls/src/private/MDCTextControlStyleOutlined.m b/components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlStyleOutlined.m similarity index 100% rename from components/TextControls/src/private/MDCTextControlStyleOutlined.m rename to components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlStyleOutlined.m diff --git a/components/TextControls/src/private/MDCTextControlVerticalPositioningReferenceOutlined.h b/components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlVerticalPositioningReferenceOutlined.h similarity index 100% rename from components/TextControls/src/private/MDCTextControlVerticalPositioningReferenceOutlined.h rename to components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlVerticalPositioningReferenceOutlined.h diff --git a/components/TextControls/src/private/MDCTextControlVerticalPositioningReferenceOutlined.m b/components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlVerticalPositioningReferenceOutlined.m similarity index 100% rename from components/TextControls/src/private/MDCTextControlVerticalPositioningReferenceOutlined.m rename to components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlVerticalPositioningReferenceOutlined.m diff --git a/components/private/TextControlsPrivate/src/OutlinedStyle/MaterialTextControlsPrivate+OutlinedStyle.h b/components/private/TextControlsPrivate/src/OutlinedStyle/MaterialTextControlsPrivate+OutlinedStyle.h new file mode 100644 index 00000000000..fa3544f7eb0 --- /dev/null +++ b/components/private/TextControlsPrivate/src/OutlinedStyle/MaterialTextControlsPrivate+OutlinedStyle.h @@ -0,0 +1,16 @@ +// 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 "MDCTextControlStyleOutlined.h" +#import "MDCTextControlVerticalPositioningReferenceOutlined.h" diff --git a/components/TextControls/src/private/MDCTextControl.h b/components/private/TextControlsPrivate/src/Shared/MDCTextControl.h similarity index 100% rename from components/TextControls/src/private/MDCTextControl.h rename to components/private/TextControlsPrivate/src/Shared/MDCTextControl.h diff --git a/components/TextControls/src/private/MDCTextControlAssistiveLabelDrawPriority.h b/components/private/TextControlsPrivate/src/Shared/MDCTextControlAssistiveLabelDrawPriority.h similarity index 100% rename from components/TextControls/src/private/MDCTextControlAssistiveLabelDrawPriority.h rename to components/private/TextControlsPrivate/src/Shared/MDCTextControlAssistiveLabelDrawPriority.h diff --git a/components/TextControls/src/private/MDCTextControlAssistiveLabelView.h b/components/private/TextControlsPrivate/src/Shared/MDCTextControlAssistiveLabelView.h similarity index 100% rename from components/TextControls/src/private/MDCTextControlAssistiveLabelView.h rename to components/private/TextControlsPrivate/src/Shared/MDCTextControlAssistiveLabelView.h diff --git a/components/TextControls/src/private/MDCTextControlAssistiveLabelView.m b/components/private/TextControlsPrivate/src/Shared/MDCTextControlAssistiveLabelView.m similarity index 100% rename from components/TextControls/src/private/MDCTextControlAssistiveLabelView.m rename to components/private/TextControlsPrivate/src/Shared/MDCTextControlAssistiveLabelView.m diff --git a/components/TextControls/src/private/MDCTextControlAssistiveLabelViewLayout.h b/components/private/TextControlsPrivate/src/Shared/MDCTextControlAssistiveLabelViewLayout.h similarity index 100% rename from components/TextControls/src/private/MDCTextControlAssistiveLabelViewLayout.h rename to components/private/TextControlsPrivate/src/Shared/MDCTextControlAssistiveLabelViewLayout.h diff --git a/components/TextControls/src/private/MDCTextControlAssistiveLabelViewLayout.m b/components/private/TextControlsPrivate/src/Shared/MDCTextControlAssistiveLabelViewLayout.m similarity index 100% rename from components/TextControls/src/private/MDCTextControlAssistiveLabelViewLayout.m rename to components/private/TextControlsPrivate/src/Shared/MDCTextControlAssistiveLabelViewLayout.m diff --git a/components/TextControls/src/private/MDCTextControlColorViewModel.h b/components/private/TextControlsPrivate/src/Shared/MDCTextControlColorViewModel.h similarity index 100% rename from components/TextControls/src/private/MDCTextControlColorViewModel.h rename to components/private/TextControlsPrivate/src/Shared/MDCTextControlColorViewModel.h diff --git a/components/TextControls/src/private/MDCTextControlColorViewModel.m b/components/private/TextControlsPrivate/src/Shared/MDCTextControlColorViewModel.m similarity index 100% rename from components/TextControls/src/private/MDCTextControlColorViewModel.m rename to components/private/TextControlsPrivate/src/Shared/MDCTextControlColorViewModel.m diff --git a/components/TextControls/src/private/MDCTextControlLabelAnimation.h b/components/private/TextControlsPrivate/src/Shared/MDCTextControlLabelAnimation.h similarity index 100% rename from components/TextControls/src/private/MDCTextControlLabelAnimation.h rename to components/private/TextControlsPrivate/src/Shared/MDCTextControlLabelAnimation.h diff --git a/components/TextControls/src/private/MDCTextControlLabelAnimation.m b/components/private/TextControlsPrivate/src/Shared/MDCTextControlLabelAnimation.m similarity index 100% rename from components/TextControls/src/private/MDCTextControlLabelAnimation.m rename to components/private/TextControlsPrivate/src/Shared/MDCTextControlLabelAnimation.m diff --git a/components/TextControls/src/private/MDCTextControlLabelState.h b/components/private/TextControlsPrivate/src/Shared/MDCTextControlLabelState.h similarity index 100% rename from components/TextControls/src/private/MDCTextControlLabelState.h rename to components/private/TextControlsPrivate/src/Shared/MDCTextControlLabelState.h diff --git a/components/TextControls/src/private/MDCTextControlVerticalPositioningReference.h b/components/private/TextControlsPrivate/src/Shared/MDCTextControlVerticalPositioningReference.h similarity index 100% rename from components/TextControls/src/private/MDCTextControlVerticalPositioningReference.h rename to components/private/TextControlsPrivate/src/Shared/MDCTextControlVerticalPositioningReference.h diff --git a/components/private/TextControlsPrivate/src/Shared/MaterialTextControlsPrivate+Shared.h b/components/private/TextControlsPrivate/src/Shared/MaterialTextControlsPrivate+Shared.h new file mode 100644 index 00000000000..a678f266349 --- /dev/null +++ b/components/private/TextControlsPrivate/src/Shared/MaterialTextControlsPrivate+Shared.h @@ -0,0 +1,20 @@ +// 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 "MDCTextControl.h" +#import "MDCTextControlAssistiveLabelView.h" +#import "MDCTextControlAssistiveLabelViewLayout.h" +#import "MDCTextControlColorViewModel.h" +#import "MDCTextControlLabelAnimation.h" +#import "MDCTextControlVerticalPositioningReference.h" diff --git a/components/TextControls/src/private/UIBezierPath+MDCTextControlStyle.h b/components/private/TextControlsPrivate/src/Shared/UIBezierPath+MDCTextControlStyle.h similarity index 100% rename from components/TextControls/src/private/UIBezierPath+MDCTextControlStyle.h rename to components/private/TextControlsPrivate/src/Shared/UIBezierPath+MDCTextControlStyle.h diff --git a/components/TextControls/src/private/UIBezierPath+MDCTextControlStyle.m b/components/private/TextControlsPrivate/src/Shared/UIBezierPath+MDCTextControlStyle.m similarity index 100% rename from components/TextControls/src/private/UIBezierPath+MDCTextControlStyle.m rename to components/private/TextControlsPrivate/src/Shared/UIBezierPath+MDCTextControlStyle.m From 5ba178fb3ab06f7839c42d4c4b94c03330bf8524 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Fri, 17 Jan 2020 16:18:13 -0500 Subject: [PATCH 03/10] Revert "merged release-candidate" This reverts commit 3e9fee2952bdaa7667a03dc303702ac53a323a85, reversing changes made to 3b3d288ea42ddcc53b61127283770f145b9def38. --- CHANGELOG.md | 21 ------------------- 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 ++-- .../MaterialCatalog/MaterialCatalog.podspec | 2 +- components/LibraryInfo/src/MDCLibraryInfo.m | 2 +- .../LibraryInfo/tests/unit/LibraryInfoTests.m | 2 +- .../RemoteImageServiceForMDCDemos.podspec | 2 +- 13 files changed, 14 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9795b0acee5..2fbf2933465 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,24 +1,3 @@ -# 101.1.2 - -This release fixes layout bugs in Chips and marks -`-[MDCAppBarNavigationControllerDelegate -appBarNavigationController:willAddAppBar:asChildOfViewController:]` as planned -for deprecation. - -## Component changes - -### AppBar - -* [Annotate MDCAppBarNavigationControllerDelegate's appBarNavigationController:willAddAppBar:asChildOfViewController: as to be deprecated. (#9395)](https://github.com/material-components/material-components-ios/commit/580d152be3d235b91dab3fb5c5f0d81613348f53) (featherless) - -### Chips - -* [Additional `imagePadding` tests. (#9441)](https://github.com/material-components/material-components-ios/commit/bc34beb9b4bd9e90f7d914ec85d59ae916024f90) (Robert Moore) -* [Fix `contentPadding` API. (#9440)](https://github.com/material-components/material-components-ios/commit/13d20ebddf7c709c507973ed9f317939e650a94b) (Robert Moore) -* [Fix `imagePadding` behavior. (#9442)](https://github.com/material-components/material-components-ios/commit/1621a25c6b829c006d52008f743f07112f40a3a6) (Robert Moore) - ---- - # 101.1.1 This release includes a bug fix for Dialogs. In some cases a change in diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index c322a2f9427..8fdf94cc2ae 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 = "101.1.2" + mdc.version = "101.1.1" 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 fd805b8aa84..1a02ff79933 100644 --- a/MaterialComponentsBeta.podspec +++ b/MaterialComponentsBeta.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |mdc| mdc.name = "MaterialComponentsBeta" - mdc.version = "101.1.2" + mdc.version = "101.1.1" 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 06339b2181b..e32dab3198e 100644 --- a/MaterialComponentsEarlGreyTests.podspec +++ b/MaterialComponentsEarlGreyTests.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MaterialComponentsEarlGreyTests" - s.version = "101.1.2" + s.version = "101.1.1" 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 1daabab1bf8..ba8ba6e9058 100644 --- a/MaterialComponentsExamples.podspec +++ b/MaterialComponentsExamples.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MaterialComponentsExamples" - s.version = "101.1.2" + s.version = "101.1.1" 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 19c4d570505..1452a104b8e 100644 --- a/MaterialComponentsSnapshotTests.podspec +++ b/MaterialComponentsSnapshotTests.podspec @@ -53,7 +53,7 @@ end Pod::Spec.new do |s| s.name = "MaterialComponentsSnapshotTests" - s.version = "101.1.2" + s.version = "101.1.1" 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 d0c8b84e160..1556c3a6819 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -101.1.2 +101.1.1 diff --git a/catalog/MDCCatalog/Info.plist b/catalog/MDCCatalog/Info.plist index bc3e4e680d4..0af20623079 100644 --- a/catalog/MDCCatalog/Info.plist +++ b/catalog/MDCCatalog/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 101.1.2 + 101.1.1 CFBundleSignature ???? CFBundleVersion - 101.1.2 + 101.1.1 LSRequiresIPhoneOS UIAppFonts diff --git a/catalog/MDCDragons/Info.plist b/catalog/MDCDragons/Info.plist index 225c306cb50..045c1abf374 100644 --- a/catalog/MDCDragons/Info.plist +++ b/catalog/MDCDragons/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 101.1.2 + 101.1.1 CFBundleVersion - 101.1.2 + 101.1.1 LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/catalog/MaterialCatalog/MaterialCatalog.podspec b/catalog/MaterialCatalog/MaterialCatalog.podspec index 6e9bf9cdd9a..175f7550f01 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 = "101.1.2" + s.version = "101.1.1" 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 88ae03aedff..5c7f1121b41 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 = @"101.1.2"; +static NSString const *MDCLibraryInfoVersionString = @"101.1.1"; @implementation MDCLibraryInfo diff --git a/components/LibraryInfo/tests/unit/LibraryInfoTests.m b/components/LibraryInfo/tests/unit/LibraryInfoTests.m index d63c1c72caf..7bb4f3abb05 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: "101.1.2", etc. + // Accept: "101.1.1", 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 dd38e54402e..bf2eb046023 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 = "101.1.2" + s.version = "101.1.1" 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 f320ddfde3564982bc7cae885291475a92e398ea Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Tue, 21 Jan 2020 15:05:57 -0500 Subject: [PATCH 04/10] Automatic changelog preparation for release. --- .gitattributes | 28 +++++++++++++++++++++++++--- CHANGELOG.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 75 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 d2e893f452d..d18327d27dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,53 @@ +# #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 + +### TextControls+BaseTextFields + +**New extension.** + +### TextControls+Enums + +**New extension.** + +### TextControls+FilledTextFields + +**New extension.** + +### TextControls+FilledTextFieldsTheming + +**New extension.** + +### TextControls+OutlinedTextFields + +**New extension.** + +### TextControls+OutlinedTextFieldsTheming + +**New extension.** + +## Component changes + +### TextFields + +* [Add theming extension for underline controller (#9437)](https://github.com/material-components/material-components-ios/commit/3b3d288ea42ddcc53b61127283770f145b9def38) (Cody Weaver) + +## Multi-component changes + +* [Restructure Cocoapods and Blaze targets (#9430)](https://github.com/material-components/material-components-ios/commit/083cf8c12f8efe1d9351ddb56f513a5fed5cd289) (Andrew Overton) + +--- + # 102.0.0 This major hotfix release reverts a change introduced in 101.1.0 that caused Snackbar not to appear in some situations. From 8f80efe08d3af4643ef402f10d369f15f4eeef51 Mon Sep 17 00:00:00 2001 From: featherless Date: Thu, 16 Jan 2020 10:33:32 -0500 Subject: [PATCH 05/10] [AppBar] Annotate MDCAppBarNavigationControllerDelegate's appBarNavigationController:willAddAppBar:asChildOfViewController: as to be deprecated. (#9395) Part of https://github.com/material-components/material-components-ios/issues/9392 --- .../src/MDCAppBarNavigationController.h | 58 +++++++++++-------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/components/AppBar/src/MDCAppBarNavigationController.h b/components/AppBar/src/MDCAppBarNavigationController.h index afe8c7c118e..8acda6698b6 100644 --- a/components/AppBar/src/MDCAppBarNavigationController.h +++ b/components/AppBar/src/MDCAppBarNavigationController.h @@ -19,10 +19,42 @@ @class MDCAppBarNavigationController; @class MDCFlexibleHeaderViewController; +/** + Defines delegate methods that will be deprecated. + */ +@protocol MDCAppBarNavigationControllerToBeDeprecatedDelegate +@optional + +/** + Informs the receiver that the given App Bar will be added as a child of the given view controller. + + This event is primarily intended to allow any configuration or theming of the App Bar to occur + before it becomes part of the view controller hierarchy. + + By the time this event has fired, the navigation controller will already have attempted to infer + the tracking scroll view from the provided view controller. + + @note This method will only be invoked if a new App Bar instance is about to be added to the view + controller. If a flexible header is already present in the view controller, this method will not + be invoked. + + @warning This method will soon be deprecated. Please use + -appBarNavigationController:willAddAppBarViewController:asChildOfViewController: instead. Learn + more at + https://github.com/material-components/material-components-ios/blob/develop/components/AppBar/docs/migration-guide-appbar-appbarviewcontroller.md + */ +- (void)appBarNavigationController:(nonnull MDCAppBarNavigationController *)navigationController + willAddAppBar:(nonnull MDCAppBar *)appBar + asChildOfViewController:(nonnull UIViewController *)viewController; + +@end + /** Defines the events that an MDCAppBarNavigationController may send to a delegate. */ -@protocol MDCAppBarNavigationControllerDelegate +@protocol + MDCAppBarNavigationControllerDelegate @optional /** @@ -73,30 +105,6 @@ trackingScrollViewForViewController:(nonnull UIViewController *)viewController suggestedTrackingScrollView:(nullable UIScrollView *)scrollView; -#pragma mark - Will be deprecated - -/** - Informs the receiver that the given App Bar will be added as a child of the given view controller. - - This event is primarily intended to allow any configuration or theming of the App Bar to occur - before it becomes part of the view controller hierarchy. - - By the time this event has fired, the navigation controller will already have attempted to infer - the tracking scroll view from the provided view controller. - - @note This method will only be invoked if a new App Bar instance is about to be added to the view - controller. If a flexible header is already present in the view controller, this method will not - be invoked. - - @warning This method will soon be deprecated. Please use - -appBarNavigationController:willAddAppBarViewController:asChildOfViewController: instead. Learn - more at - https://github.com/material-components/material-components-ios/blob/develop/components/AppBar/docs/migration-guide-appbar-appbarviewcontroller.md - */ -- (void)appBarNavigationController:(nonnull MDCAppBarNavigationController *)navigationController - willAddAppBar:(nonnull MDCAppBar *)appBar - asChildOfViewController:(nonnull UIViewController *)viewController; - @end /** From d1d494b0ef0fe716f9b1422830077b5552e48996 Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Thu, 16 Jan 2020 14:39:51 -0500 Subject: [PATCH 06/10] [Chips] Fix `contentPadding` API. (#9440) Corrects the behavior of `contentPadding` to ensure that it correctly positions content within its padding bounds. This change includes two corrections that addressed problems in layout: * Calculating subview bounding rectangles within the `MDCChipView` failed to account for `contentPadding.top` when determining the bounding rectangle origin. * Positioning the subviews vertically within the bounding rectangle was accidentally using the `MDCChipView` frame rather than the content rectangle. This resulted in the content padding being evenly "split" between the top and bottom rather than the actual values. Closes #9249 Rolls-forward #9264 --- components/Chips/src/MDCChipView.m | 30 +++++++++++-------- ...entPaddingAllNegativeValuesLTR_11_2@2x.png | 4 +-- ...entPaddingAllNegativeValuesRTL_11_2@2x.png | 4 +-- ...entPaddingAllPositiveValuesLTR_11_2@2x.png | 4 +-- ...entPaddingAllPositiveValuesRTL_11_2@2x.png | 4 +-- ...estChipContentPaddingShiftDown_11_2@2x.png | 4 +-- .../testChipContentPaddingShiftUp_11_2@2x.png | 4 +-- 7 files changed, 30 insertions(+), 24 deletions(-) diff --git a/components/Chips/src/MDCChipView.m b/components/Chips/src/MDCChipView.m index 6f3ca033625..a90d4c73cff 100644 --- a/components/Chips/src/MDCChipView.m +++ b/components/Chips/src/MDCChipView.m @@ -76,8 +76,9 @@ static CGRect CGRectVerticallyCentered(CGRect rect, } static inline CGRect MDCChipBuildFrame( - UIEdgeInsets insets, CGSize size, CGFloat xOffset, CGFloat chipHeight, CGFloat pixelScale) { - CGRect frame = CGRectMake(xOffset + insets.left, insets.top, size.width, size.height); + UIEdgeInsets insets, CGSize size, CGPoint originPoint, CGFloat chipHeight, CGFloat pixelScale) { + CGRect frame = + CGRectMake(originPoint.x + insets.left, originPoint.y + insets.top, size.width, size.height); return CGRectVerticallyCentered(frame, insets, chipHeight, pixelScale); } @@ -708,11 +709,13 @@ - (CGRect)selectedImageViewFrame { } - (CGRect)frameForImageView:(UIImageView *)imageView visible:(BOOL)visible { - CGRect frame = CGRectMake(CGRectGetMinX(self.contentRect), CGRectGetMidY(self.contentRect), 0, 0); + CGRect contentRect = self.contentRect; + CGRect frame = CGRectMake(CGRectGetMinX(contentRect), CGRectGetMidY(contentRect), 0, 0); if (visible) { - CGSize selectedSize = [self sizeForImageView:imageView maxSize:self.contentRect.size]; - frame = MDCChipBuildFrame(_imagePadding, selectedSize, CGRectGetMinX(self.contentRect), - CGRectGetHeight(self.frame), self.pixelScale); + CGSize selectedSize = [self sizeForImageView:imageView maxSize:contentRect.size]; + frame = MDCChipBuildFrame(_imagePadding, selectedSize, + CGPointMake(CGRectGetMinX(contentRect), CGRectGetMinY(contentRect)), + CGRectGetHeight(contentRect), self.pixelScale); } return frame; } @@ -724,12 +727,14 @@ - (CGSize)sizeForImageView:(UIImageView *)imageView maxSize:(CGSize)maxSize { - (CGRect)accessoryViewFrame { CGSize size = CGSizeZero; + CGRect contentRect = self.contentRect; if (self.showAccessoryView) { - size = [self sizeForAccessoryViewWithMaxSize:self.contentRect.size]; + size = [self sizeForAccessoryViewWithMaxSize:contentRect.size]; } CGFloat xOffset = CGRectGetMaxX(self.contentRect) - size.width - UIEdgeInsetsHorizontal(_accessoryPadding); - return MDCChipBuildFrame(_accessoryPadding, size, xOffset, CGRectGetHeight(self.frame), + CGPoint frameOrigin = CGPointMake(xOffset, CGRectGetMinY(contentRect)); + return MDCChipBuildFrame(_accessoryPadding, size, frameOrigin, CGRectGetHeight(contentRect), self.pixelScale); } @@ -739,22 +744,23 @@ - (CGSize)sizeForAccessoryViewWithMaxSize:(CGSize)maxSize { } - (CGRect)titleLabelFrame { + CGRect contentRect = self.contentRect; CGRect imageFrame = CGRectUnion(_imageView.frame, _selectedImageView.frame); - CGFloat maximumTitleWidth = CGRectGetWidth(self.contentRect) - CGRectGetWidth(imageFrame) - + CGFloat maximumTitleWidth = CGRectGetWidth(contentRect) - CGRectGetWidth(imageFrame) - UIEdgeInsetsHorizontal(_titlePadding) + UIEdgeInsetsHorizontal(_imagePadding); if (self.showAccessoryView) { maximumTitleWidth -= CGRectGetWidth(_accessoryView.frame) + UIEdgeInsetsHorizontal(_accessoryPadding); } - CGFloat maximumTitleHeight = - CGRectGetHeight(self.contentRect) - UIEdgeInsetsVertical(_titlePadding); + CGFloat maximumTitleHeight = CGRectGetHeight(contentRect) - UIEdgeInsetsVertical(_titlePadding); CGSize maximumSize = CGSizeMake(maximumTitleWidth, maximumTitleHeight); CGSize titleSize = [_titleLabel sizeThatFits:maximumSize]; titleSize.width = MAX(0, maximumTitleWidth); CGFloat imageRightEdge = CGRectGetMaxX(imageFrame) + _imagePadding.right; - return MDCChipBuildFrame(_titlePadding, titleSize, imageRightEdge, CGRectGetHeight(self.frame), + CGPoint frameOrigin = CGPointMake(imageRightEdge, CGRectGetMinY(contentRect)); + return MDCChipBuildFrame(_titlePadding, titleSize, frameOrigin, CGRectGetHeight(contentRect), self.pixelScale); } diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllNegativeValuesLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllNegativeValuesLTR_11_2@2x.png index 166f9e272d1..ee53a440158 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllNegativeValuesLTR_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllNegativeValuesLTR_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7896af5dae1c0492e03b20e5e6f6e09d8ff817e18bcf0d644db0431a010a8f73 -size 5997 +oid sha256:640d0ad7e49ae7678a2e761d687170efe0ba1b13074dfd7a12ea76c616c0a22e +size 5862 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllNegativeValuesRTL_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllNegativeValuesRTL_11_2@2x.png index 1cc426c7e4a..3a5303c0238 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllNegativeValuesRTL_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllNegativeValuesRTL_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:136e36a494f4595a75901aa666386b3d623991613a2de5d77960d1ee5dd98a70 -size 5871 +oid sha256:49cdc9ad21b382ed3d1f488dc26808822c1a97c37725e64e2873eafef7ea3566 +size 5922 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllPositiveValuesLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllPositiveValuesLTR_11_2@2x.png index e0bf90345bf..537cc8710db 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllPositiveValuesLTR_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllPositiveValuesLTR_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9f99ab685678acaf0eda999a86c486050ebca6d4b3e3852a5d6d498b52ed4f3e -size 8795 +oid sha256:770264fac4dd654a89e3e3197f97ead8e15ba9de7687c35ec89ad9779b02692e +size 8726 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllPositiveValuesRTL_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllPositiveValuesRTL_11_2@2x.png index 97cd39c4c6c..71a6f255f47 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllPositiveValuesRTL_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingAllPositiveValuesRTL_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f71bf46c1ef41a83ef2944b3f5a887bbc37b829cd10f266164e1376ba9d11956 -size 8926 +oid sha256:b23ab4a7d4634d31417ea74b16800e19da6d74bd4613fdf72823ede2442587d0 +size 8838 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingShiftDown_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingShiftDown_11_2@2x.png index 6188f66cd30..4fbcc3cc2c0 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingShiftDown_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingShiftDown_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:07fae752bdb3974f04476b74fe9edb4fa4d7f51e04192683156f59b8876361c7 -size 6087 +oid sha256:0dfbb32a6d4ba28714170748c127857689982969a3fea79ee7a402b3a393bafa +size 6176 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingShiftUp_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingShiftUp_11_2@2x.png index 16997dd1c7e..adef5ab9a1b 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingShiftUp_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipContentPaddingShiftUp_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:029e5f8b0c87251d84a12db039b0105faa4bd4e4dc29e78d020a0c043c8b09ab -size 6064 +oid sha256:af19f093196d3361a70052b05c68efe688fcd4aa99372fc85e5215c4279bf06c +size 6183 From 8377722bdb22163068e0775aea5cc39a89a35f6f Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Thu, 16 Jan 2020 15:06:47 -0500 Subject: [PATCH 07/10] [Chips] Additional `imagePadding` tests. (#9441) Adds extra tests for `imagePadding` focused on when no image is visible or when only `selectedImage` is visible. Preparation to roll-forward #9267 Part of #9250 --- .../snapshot/MDCChipViewLayoutSnapshotTests.m | 37 +++++++++++++++++++ ...ipImagePaddingWithoutImagesLTR_11_2@2x.png | 3 ++ ...ValuesForSmallSelectedImageLTR_11_2@2x.png | 3 ++ ...ValuesForSmallSelectedImageLTR_11_2@2x.png | 3 ++ 4 files changed, 46 insertions(+) create mode 100644 snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipImagePaddingWithoutImagesLTR_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png create mode 100644 snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png diff --git a/components/Chips/tests/snapshot/MDCChipViewLayoutSnapshotTests.m b/components/Chips/tests/snapshot/MDCChipViewLayoutSnapshotTests.m index 369b6b0a1a9..2031f176af1 100644 --- a/components/Chips/tests/snapshot/MDCChipViewLayoutSnapshotTests.m +++ b/components/Chips/tests/snapshot/MDCChipViewLayoutSnapshotTests.m @@ -195,6 +195,16 @@ - (void)testChipContentPaddingShiftUp { #pragma mark - ImagePadding +- (void)testChipImagePaddingWithoutImagesLTR { + // When + self.chipView.imageView.image = nil; + self.chipView.selectedImageView.image = nil; + self.chipView.imagePadding = UIEdgeInsetsMake(10, 20, 30, 40); + + // Then + [self generateSnapshotAndVerifyForView:self.chipView]; +} + - (void)testUnselectedChipImagePaddingAllPositiveValuesLTR { // When self.chipView.imagePadding = UIEdgeInsetsMake(10, 20, 30, 40); @@ -259,6 +269,33 @@ - (void)testSelectedChipImagePaddingAllPositiveValuesForLargeSelectedImageLTR { [self generateSnapshotAndVerifyForView:self.chipView]; } +- (void)testUnselectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR { + // Given + self.chipView.selectedImageView.image = + [UIImage mdc_testImageOfSize:CGSizeMake(8, 8) + withStyle:MDCSnapshotTestImageStyleDiagonalLines]; + + // When + self.chipView.imagePadding = UIEdgeInsetsMake(10, 20, 30, 40); + + // Then + [self generateSnapshotAndVerifyForView:self.chipView]; +} + +- (void)testSelectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR { + // Given + self.chipView.selectedImageView.image = + [UIImage mdc_testImageOfSize:CGSizeMake(8, 8) + withStyle:MDCSnapshotTestImageStyleDiagonalLines]; + self.chipView.selected = YES; + + // When + self.chipView.imagePadding = UIEdgeInsetsMake(10, 20, 30, 40); + + // Then + [self generateSnapshotAndVerifyForView:self.chipView]; +} + - (void)testUnselectedChipImagePaddingAllPositiveValuesRTL { // Given [self changeToRTL:self.chipView]; diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipImagePaddingWithoutImagesLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipImagePaddingWithoutImagesLTR_11_2@2x.png new file mode 100644 index 00000000000..6f0bb855d1b --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipImagePaddingWithoutImagesLTR_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b4b496a7c4d42a4f1536003af79be3161cc0fa27d4663079c73c5075d961aae5 +size 5317 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png new file mode 100644 index 00000000000..3187e1af4c8 --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2daab9012d4c50ee5226f0ea3b0671150c2224548f27b483140d5c972934a20 +size 8697 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png new file mode 100644 index 00000000000..402e48e7b75 --- /dev/null +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:91fa84afcba24db32489ba231e2831242cd97f59fff81bd1196a20b0638b9d64 +size 9330 From 944ed3a1852e77dcf8a961e022fd18dd3645b6dc Mon Sep 17 00:00:00 2001 From: Robert Moore Date: Thu, 16 Jan 2020 15:43:17 -0500 Subject: [PATCH 08/10] [Chips] Fix `imagePadding` behavior. (#9442) Corrects the behavior of `imagePadding` in two significant ways: * Previously, the union of the frames of `selectedImageView` and `imageView` were used to determine the position of the `titleLabel`. However, since `selectedImageView` is documented as not having an effect on `MDCChipView` unless it is set and the Chip is selected, it should not have any effect on the frame calculations when unselected or unset. * `imagePadding` is now only applied if either `selectedImageView` or `imageView` in the Chip. Previously, `imagePadding` would have been applied even without an image present. Closes #9250 Closes #7940 Roll-forward of #9267 --- components/Chips/src/MDCChipView.m | 22 +++++++++++++++---- ...ipImagePaddingWithoutImagesLTR_11_2@2x.png | 4 ++-- ...ValuesForLargeSelectedImageLTR_11_2@2x.png | 4 ++-- ...eValuesForOnlySelectedImageLTR_11_2@2x.png | 4 ++-- ...ValuesForSmallSelectedImageLTR_11_2@2x.png | 4 ++-- ...agePaddingAllNegativeValuesLTR_11_2@2x.png | 4 ++-- ...agePaddingAllNegativeValuesRTL_11_2@2x.png | 4 ++-- ...ValuesForLargeSelectedImageLTR_11_2@2x.png | 4 ++-- ...eValuesForOnlySelectedImageLTR_11_2@2x.png | 4 ++-- ...ValuesForSmallSelectedImageLTR_11_2@2x.png | 4 ++-- ...agePaddingAllPositiveValuesLTR_11_2@2x.png | 4 ++-- ...agePaddingAllPositiveValuesRTL_11_2@2x.png | 4 ++-- ...ePaddingShiftToTrailingEdgeLTR_11_2@2x.png | 4 ++-- ...ePaddingShiftToTrailingEdgeRTL_11_2@2x.png | 4 ++-- 14 files changed, 44 insertions(+), 30 deletions(-) diff --git a/components/Chips/src/MDCChipView.m b/components/Chips/src/MDCChipView.m index a90d4c73cff..18d77bd3bcb 100644 --- a/components/Chips/src/MDCChipView.m +++ b/components/Chips/src/MDCChipView.m @@ -744,11 +744,22 @@ - (CGSize)sizeForAccessoryViewWithMaxSize:(CGSize)maxSize { } - (CGRect)titleLabelFrame { + // Default to the unselected image, but account for the selected image if it's shown. + CGRect imageFrame = _imageView.frame; + if (self.showSelectedImageView) { + // Both images are present, take the union of their frames. + if (self.showImageView) { + imageFrame = CGRectUnion(_imageView.frame, _selectedImageView.frame); + } else { + imageFrame = _selectedImageView.frame; + } + } CGRect contentRect = self.contentRect; - CGRect imageFrame = CGRectUnion(_imageView.frame, _selectedImageView.frame); CGFloat maximumTitleWidth = CGRectGetWidth(contentRect) - CGRectGetWidth(imageFrame) - - UIEdgeInsetsHorizontal(_titlePadding) + - UIEdgeInsetsHorizontal(_imagePadding); + UIEdgeInsetsHorizontal(_titlePadding); + if (self.showImageView || self.showSelectedImageView) { + maximumTitleWidth -= UIEdgeInsetsHorizontal(_imagePadding); + } if (self.showAccessoryView) { maximumTitleWidth -= CGRectGetWidth(_accessoryView.frame) + UIEdgeInsetsHorizontal(_accessoryPadding); @@ -758,7 +769,10 @@ - (CGRect)titleLabelFrame { CGSize titleSize = [_titleLabel sizeThatFits:maximumSize]; titleSize.width = MAX(0, maximumTitleWidth); - CGFloat imageRightEdge = CGRectGetMaxX(imageFrame) + _imagePadding.right; + CGFloat imageRightEdge = CGRectGetMinX(contentRect); + if (self.showImageView || self.showSelectedImageView) { + imageRightEdge = CGRectGetMaxX(imageFrame) + _imagePadding.right; + } CGPoint frameOrigin = CGPointMake(imageRightEdge, CGRectGetMinY(contentRect)); return MDCChipBuildFrame(_titlePadding, titleSize, frameOrigin, CGRectGetHeight(contentRect), self.pixelScale); diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipImagePaddingWithoutImagesLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipImagePaddingWithoutImagesLTR_11_2@2x.png index 6f0bb855d1b..300bad0cd08 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipImagePaddingWithoutImagesLTR_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testChipImagePaddingWithoutImagesLTR_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b4b496a7c4d42a4f1536003af79be3161cc0fa27d4663079c73c5075d961aae5 -size 5317 +oid sha256:e01be4724fd2e9df9548872dabaed87318739cebf6ac100c4b2b99961f863c78 +size 5223 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForLargeSelectedImageLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForLargeSelectedImageLTR_11_2@2x.png index d89d7ca1934..8959b2ea1fc 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForLargeSelectedImageLTR_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForLargeSelectedImageLTR_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dcb8e22109690963a5675a63f2738d2cadf78ae08334b7ab7fc76e3d66a3baeb -size 10308 +oid sha256:7a1f514e412a9e259b3d38baa06e4d98e3d07560d70dc1d97501973c8d5897ac +size 10406 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForOnlySelectedImageLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForOnlySelectedImageLTR_11_2@2x.png index 3a5c8b8c1f2..0cf9fc6f916 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForOnlySelectedImageLTR_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForOnlySelectedImageLTR_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1382dbf50e015f11ee01adfb2d6f67eb660b97c2ec319b5d470d5bff7b1605be -size 8608 +oid sha256:63b9e04a21fc747b2f74e6153a2648e32d9f4d6073495da1e20694c47aedea75 +size 8715 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png index 3187e1af4c8..24cf0ba9abe 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testSelectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e2daab9012d4c50ee5226f0ea3b0671150c2224548f27b483140d5c972934a20 -size 8697 +oid sha256:2139a473e8a6c21a6fe3327d9e26d567142d066437cf36db062007679297b908 +size 8891 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllNegativeValuesLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllNegativeValuesLTR_11_2@2x.png index 9a699894fdf..7a524de9880 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllNegativeValuesLTR_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllNegativeValuesLTR_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dbf66c18249f1d8de80d9cfddcb5dd9b015236db2cd49550a011f9f24750f678 -size 4507 +oid sha256:ff2c0f9c24922f8aeb0444dc01b15b75bafd21fdd9a236b98e67a3b69ab55a6a +size 5698 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllNegativeValuesRTL_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllNegativeValuesRTL_11_2@2x.png index 1b736283a06..a4e1e75a620 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllNegativeValuesRTL_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllNegativeValuesRTL_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3f2bcef5bade497a0b0d06f2567075aa95cfaa6dcf586c7160c7a20877684314 -size 4741 +oid sha256:fe2c47762155435c5337741d5c893b57072d138a4ab3af7c71a983318afd6a13 +size 5792 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForLargeSelectedImageLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForLargeSelectedImageLTR_11_2@2x.png index 402e48e7b75..a0148a71fad 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForLargeSelectedImageLTR_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForLargeSelectedImageLTR_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:91fa84afcba24db32489ba231e2831242cd97f59fff81bd1196a20b0638b9d64 -size 9330 +oid sha256:97a7ff43c2245d550eac5321d976ee579deb0d23161d58f7a208e7902d9ddc9b +size 9260 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForOnlySelectedImageLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForOnlySelectedImageLTR_11_2@2x.png index 6f0bb855d1b..300bad0cd08 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForOnlySelectedImageLTR_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForOnlySelectedImageLTR_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b4b496a7c4d42a4f1536003af79be3161cc0fa27d4663079c73c5075d961aae5 -size 5317 +oid sha256:e01be4724fd2e9df9548872dabaed87318739cebf6ac100c4b2b99961f863c78 +size 5223 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png index 402e48e7b75..a0148a71fad 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesForSmallSelectedImageLTR_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:91fa84afcba24db32489ba231e2831242cd97f59fff81bd1196a20b0638b9d64 -size 9330 +oid sha256:97a7ff43c2245d550eac5321d976ee579deb0d23161d58f7a208e7902d9ddc9b +size 9260 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesLTR_11_2@2x.png index 402e48e7b75..a0148a71fad 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesLTR_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesLTR_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:91fa84afcba24db32489ba231e2831242cd97f59fff81bd1196a20b0638b9d64 -size 9330 +oid sha256:97a7ff43c2245d550eac5321d976ee579deb0d23161d58f7a208e7902d9ddc9b +size 9260 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesRTL_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesRTL_11_2@2x.png index 6bbe44d3440..f8d72d31d3e 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesRTL_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingAllPositiveValuesRTL_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8934d24a090b3e2318f2cca5ea7373e7e072dc6bfdd814120ede1590f2a1428d -size 9288 +oid sha256:698e2b144df85dfe4a9c0d79bfbb4271b46341689a8a96ddc23b9886f7eb0917 +size 9100 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingShiftToTrailingEdgeLTR_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingShiftToTrailingEdgeLTR_11_2@2x.png index b73ace732e9..4b6a257143d 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingShiftToTrailingEdgeLTR_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingShiftToTrailingEdgeLTR_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2099c086772f4406383947e52d90123bbd626221b508e76d3467f068c58a2c48 -size 5537 +oid sha256:f13f80c70c2ced03df3305aa579de3370473d7d8895e666041a8fa40f9de1fea +size 5907 diff --git a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingShiftToTrailingEdgeRTL_11_2@2x.png b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingShiftToTrailingEdgeRTL_11_2@2x.png index 4e776e851a3..576092c8e32 100644 --- a/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingShiftToTrailingEdgeRTL_11_2@2x.png +++ b/snapshot_test_goldens/goldens_64/MDCChipViewLayoutSnapshotTests/testUnselectedChipImagePaddingShiftToTrailingEdgeRTL_11_2@2x.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7b8e1849239345866d2defb6e60059b66fe8a4857eef4546d9add6b36b23a63f -size 5123 +oid sha256:55a638b1a2e7a3621a2d4d1083ee57296d78b55b7064a6b693a831dc267746c7 +size 5853 From 5d2f8cec086bcea66a4f8a72394aa7ba4792a7e5 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Fri, 24 Jan 2020 08:24:48 -0500 Subject: [PATCH 09/10] Notes. --- CHANGELOG.md | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d18327d27dc..1917da33f4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,8 @@ -# #develop# +# 103.0.0 -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 +This major release includes a refactoring of the TextControls libraries, a theming extension for TextFields' underline controller, +a bugfix change to Chips imagePadding handling, and the annotation of an AppBar API as to be deprecated. -Replace this text with links to deprecation guides. -## New features - -Replace this text with example code for each new feature. ## API changes ### TextControls+BaseTextFields @@ -38,6 +31,16 @@ Replace this text with example code for each new feature. ## Component changes +### AppBar + +* [Annotate MDCAppBarNavigationControllerDelegate's appBarNavigationController:willAddAppBar:asChildOfViewController: as to be deprecated. (#9395)](https://github.com/material-components/material-components-ios/commit/8f80efe08d3af4643ef402f10d369f15f4eeef51) (featherless) + +### Chips + +* [Additional `imagePadding` tests. (#9441)](https://github.com/material-components/material-components-ios/commit/8377722bdb22163068e0775aea5cc39a89a35f6f) (Robert Moore) +* [Fix `contentPadding` API. (#9440)](https://github.com/material-components/material-components-ios/commit/d1d494b0ef0fe716f9b1422830077b5552e48996) (Robert Moore) +* [Fix `imagePadding` behavior. (#9442)](https://github.com/material-components/material-components-ios/commit/944ed3a1852e77dcf8a961e022fd18dd3645b6dc) (Robert Moore) + ### TextFields * [Add theming extension for underline controller (#9437)](https://github.com/material-components/material-components-ios/commit/3b3d288ea42ddcc53b61127283770f145b9def38) (Cody Weaver) From 11139a8477ab9c22c569790678e422a32be80885 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Fri, 24 Jan 2020 08:25:15 -0500 Subject: [PATCH 10/10] Bump the release. --- 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 8d3d3754fa5..052577b3149 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 = "102.0.0" + mdc.version = "103.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 59c7a71ebde..60d5b4540e2 100644 --- a/MaterialComponentsBeta.podspec +++ b/MaterialComponentsBeta.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |mdc| mdc.name = "MaterialComponentsBeta" - mdc.version = "102.0.0" + mdc.version = "103.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 cf63a8584f9..f4390f643a6 100644 --- a/MaterialComponentsEarlGreyTests.podspec +++ b/MaterialComponentsEarlGreyTests.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MaterialComponentsEarlGreyTests" - s.version = "102.0.0" + s.version = "103.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 5c8bda6443e..907d680eec3 100644 --- a/MaterialComponentsExamples.podspec +++ b/MaterialComponentsExamples.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MaterialComponentsExamples" - s.version = "102.0.0" + s.version = "103.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 400205f1d56..55bfc6fd4c8 100644 --- a/MaterialComponentsSnapshotTests.podspec +++ b/MaterialComponentsSnapshotTests.podspec @@ -53,7 +53,7 @@ end Pod::Spec.new do |s| s.name = "MaterialComponentsSnapshotTests" - s.version = "102.0.0" + s.version = "103.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 d4641b132dc..9dd4f066910 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -102.0.0 +103.0.0 diff --git a/catalog/MDCCatalog/Info.plist b/catalog/MDCCatalog/Info.plist index eb64eb61f55..41d69d99055 100644 --- a/catalog/MDCCatalog/Info.plist +++ b/catalog/MDCCatalog/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 102.0.0 + 103.0.0 CFBundleSignature ???? CFBundleVersion - 102.0.0 + 103.0.0 LSRequiresIPhoneOS UIAppFonts diff --git a/catalog/MDCDragons/Info.plist b/catalog/MDCDragons/Info.plist index 9d43ccd2df0..5caf6eace10 100644 --- a/catalog/MDCDragons/Info.plist +++ b/catalog/MDCDragons/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 102.0.0 + 103.0.0 CFBundleVersion - 102.0.0 + 103.0.0 LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/catalog/MaterialCatalog/MaterialCatalog.podspec b/catalog/MaterialCatalog/MaterialCatalog.podspec index ba291bbaa46..72f5a7eec63 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 = "102.0.0" + s.version = "103.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 32fdf1afe26..967b1386d6f 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 = @"102.0.0"; +static NSString const *MDCLibraryInfoVersionString = @"103.0.0"; @implementation MDCLibraryInfo diff --git a/components/LibraryInfo/tests/unit/LibraryInfoTests.m b/components/LibraryInfo/tests/unit/LibraryInfoTests.m index dead23267c2..bdace19a31e 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: "102.0.0", etc. + // Accept: "103.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 1ddda040574..cb199d7d75d 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 = "102.0.0" + s.version = "103.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"