From 73e404888d1e98e930e62b68f864b60e264c32f3 Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Tue, 2 Feb 2021 10:55:10 -0800 Subject: [PATCH 01/24] [TextControls] Expose density on text fields and text areas PiperOrigin-RevId: 355204832 --- .../src/BaseTextAreas/MDCBaseTextArea.h | 8 ++++++++ .../src/BaseTextAreas/MDCBaseTextArea.m | 7 ++++++- .../src/BaseTextFields/MDCBaseTextField.h | 8 ++++++++ .../src/BaseTextFields/MDCBaseTextField.m | 7 ++++++- .../tests/snapshot/MDCBaseTextAreaSnapshotTests.m | 14 ++++++++++++++ .../tests/snapshot/MDCBaseTextFieldSnapshotTests.m | 12 ++++++++++++ .../snapshot/MDCFilledTextFieldSnapshotTests.m | 12 ++++++++++++ .../snapshot/MDCOutlinedTextFieldSnapshotTests.m | 12 ++++++++++++ .../MDCBaseTextFieldTestsSnapshotTestHelpers.h | 1 + .../MDCBaseTextFieldTestsSnapshotTestHelpers.m | 7 +++++++ ...TextControlVerticalPositioningReferenceFilled.m | 2 +- ...xtControlVerticalPositioningReferenceOutlined.m | 4 ++-- 12 files changed, 89 insertions(+), 5 deletions(-) diff --git a/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.h b/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.h index b33195f8ecb..54c0b022ffd 100644 --- a/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.h +++ b/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.h @@ -229,4 +229,12 @@ values are allowed. */ @property(nonatomic, strong, null_resettable) UIColor *placeholderColor; +/** + This property influences how much vertical space there is between the various elements contained in + the text area. When it's 0 (the default) there is maximal vertical space between elements. When it + is 1, there is minimal vertical space between elements. Values less than 0 and greater than 1 will + be clamped. + */ +@property(nonatomic, assign) CGFloat verticalDensity; + @end diff --git a/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.m b/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.m index e20c713a87c..b9f3b933227 100644 --- a/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.m +++ b/components/TextControls/src/BaseTextAreas/MDCBaseTextArea.m @@ -293,7 +293,7 @@ - (MDCBaseTextAreaLayout *)calculateLayoutWithSize:(CGSize)size { textRowHeight:(self.normalFont.lineHeight + self.normalFont.leading) numberOfTextRows:self.numberOfLinesOfVisibleText - density:0 + density:self.verticalDensity preferredContainerHeight:self.preferredContainerHeight isMultilineTextControl:YES]; } @@ -537,6 +537,11 @@ - (void)setPlaceholderColor:(UIColor *)placeholderColor { _placeholderColor = placeholderColor ?: [self defaultPlaceholderColor]; } +- (void)setVerticalDensity:(CGFloat)verticalDensity { + _verticalDensity = verticalDensity; + [self setNeedsLayout]; +} + #pragma mark MDCTextControl Protocol Accessors - (void)setLeadingView:(UIView *)leadingView { diff --git a/components/TextControls/src/BaseTextFields/MDCBaseTextField.h b/components/TextControls/src/BaseTextFields/MDCBaseTextField.h index e4000a68d25..d2e411444b4 100644 --- a/components/TextControls/src/BaseTextFields/MDCBaseTextField.h +++ b/components/TextControls/src/BaseTextFields/MDCBaseTextField.h @@ -205,6 +205,14 @@ */ @property(nonatomic, assign) CGFloat containerRadius; +/** + This property influences how much vertical space there is between the various elements contained in + the text field. When it's 0 (the default) there is maximal vertical space between elements. When it + is 1, there is minimal vertical space between elements. Values less than 0 and greater than 1 will + be clamped. + */ +@property(nonatomic, assign) CGFloat verticalDensity; + @end @interface MDCBaseTextField (UIAccessibility) diff --git a/components/TextControls/src/BaseTextFields/MDCBaseTextField.m b/components/TextControls/src/BaseTextFields/MDCBaseTextField.m index 4d279a152b2..1a227c53549 100644 --- a/components/TextControls/src/BaseTextFields/MDCBaseTextField.m +++ b/components/TextControls/src/BaseTextFields/MDCBaseTextField.m @@ -327,7 +327,7 @@ - (MDCBaseTextFieldLayout *)calculateLayoutWithTextFieldSize:(CGSize)textFieldSi normalFontLineHeight:self.normalFont.lineHeight textRowHeight:self.normalFont.lineHeight numberOfTextRows:self.numberOfLinesOfVisibleText - density:0 + density:self.verticalDensity preferredContainerHeight:self.preferredContainerHeight isMultilineTextControl:NO]; } @@ -457,6 +457,11 @@ - (void)setLeadingViewMode:(UITextFieldViewMode)leadingViewMode { [self setNeedsLayout]; } +- (void)setVerticalDensity:(CGFloat)verticalDensity { + _verticalDensity = verticalDensity; + [self setNeedsLayout]; +} + #pragma mark MDCTextControl accessors - (void)setLabelBehavior:(MDCTextControlLabelBehavior)labelBehavior { diff --git a/components/TextControls/tests/snapshot/MDCBaseTextAreaSnapshotTests.m b/components/TextControls/tests/snapshot/MDCBaseTextAreaSnapshotTests.m index 8a2de87bd4e..de75961c199 100644 --- a/components/TextControls/tests/snapshot/MDCBaseTextAreaSnapshotTests.m +++ b/components/TextControls/tests/snapshot/MDCBaseTextAreaSnapshotTests.m @@ -199,6 +199,20 @@ - (void)testTextAreaWithLeadingViewTrailingViewAndCustomPaddings { [self validateTextArea:textArea]; } +- (void)testDenseTextAreaWithLabelTextAndText { + // Given + MDCBaseTextArea *textArea = self.textArea; + + // When + textArea.label.text = @"Label text"; + textArea.textView.text = @"Text"; + textArea.verticalDensity = 1.0f; + [textArea.textView becomeFirstResponder]; + + // Then + [self validateTextArea:textArea]; +} + #pragma mark Helpers - (UIView *)createSideView { diff --git a/components/TextControls/tests/snapshot/MDCBaseTextFieldSnapshotTests.m b/components/TextControls/tests/snapshot/MDCBaseTextFieldSnapshotTests.m index c415460b214..e35bfa5594a 100644 --- a/components/TextControls/tests/snapshot/MDCBaseTextFieldSnapshotTests.m +++ b/components/TextControls/tests/snapshot/MDCBaseTextFieldSnapshotTests.m @@ -268,4 +268,16 @@ - (void)testTextFieldWithLeadingViewTrailingViewAndCustomPaddings { [self validateTextField:textField]; } +- (void)testEditingDenseTextFieldWithLabelTextAndText { + // Given + MDCBaseTextField *textField = self.textField; + + // When + [MDCBaseTextFieldTestsSnapshotTestHelpers + configureEditingDenseTextFieldWithLabelTextAndText:textField]; + + // Then + [self validateTextField:textField]; +} + @end diff --git a/components/TextControls/tests/snapshot/MDCFilledTextFieldSnapshotTests.m b/components/TextControls/tests/snapshot/MDCFilledTextFieldSnapshotTests.m index 17a44e55d61..b030a706a7e 100644 --- a/components/TextControls/tests/snapshot/MDCFilledTextFieldSnapshotTests.m +++ b/components/TextControls/tests/snapshot/MDCFilledTextFieldSnapshotTests.m @@ -269,4 +269,16 @@ - (void)testTextFieldWithLeadingViewTrailingViewAndCustomPaddings { [self validateTextField:textField]; } +- (void)testEditingDenseTextFieldWithLabelTextAndText { + // Given + MDCFilledTextField *textField = self.textField; + + // When + [MDCBaseTextFieldTestsSnapshotTestHelpers + configureEditingDenseTextFieldWithLabelTextAndText:textField]; + + // Then + [self validateTextField:textField]; +} + @end diff --git a/components/TextControls/tests/snapshot/MDCOutlinedTextFieldSnapshotTests.m b/components/TextControls/tests/snapshot/MDCOutlinedTextFieldSnapshotTests.m index 3ed7a13a73f..fbaa8003dbd 100644 --- a/components/TextControls/tests/snapshot/MDCOutlinedTextFieldSnapshotTests.m +++ b/components/TextControls/tests/snapshot/MDCOutlinedTextFieldSnapshotTests.m @@ -269,4 +269,16 @@ - (void)testTextFieldWithLeadingViewTrailingViewAndCustomPaddings { [self validateTextField:textField]; } +- (void)testEditingDenseTextFieldWithLabelTextAndText { + // Given + MDCOutlinedTextField *textField = self.textField; + + // When + [MDCBaseTextFieldTestsSnapshotTestHelpers + configureEditingDenseTextFieldWithLabelTextAndText:textField]; + + // Then + [self validateTextField:textField]; +} + @end diff --git a/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h b/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h index e7cce49b201..901a368c304 100644 --- a/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h +++ b/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.h @@ -49,5 +49,6 @@ + (void)configureTextFieldWithHebrewTextAndLeadingViewInRTL:(MDCBaseTextField *)textField; + (void)configureTextFieldWithLeadingViewTrailingViewAndCustomPaddings: (MDCBaseTextField *)textField; ++ (void)configureEditingDenseTextFieldWithLabelTextAndText:(MDCBaseTextField *)textField; @end diff --git a/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.m b/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.m index 282626ec766..e76e7c2faa6 100644 --- a/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.m +++ b/components/TextControls/tests/snapshot/supplemental/MDCBaseTextFieldTestsSnapshotTestHelpers.m @@ -237,6 +237,13 @@ + (void)configureTextFieldWithLeadingViewTrailingViewAndCustomPaddings: textField.horizontalInterItemSpacingOverride = @(30.0f); } ++ (void)configureEditingDenseTextFieldWithLabelTextAndText:(MDCBaseTextField *)textField { + textField.text = @"Some text"; + textField.label.text = @"Label text"; + textField.verticalDensity = 1.0f; + [textField becomeFirstResponder]; +} + #pragma mark Helpers + (UIView *)createBlueSideView { diff --git a/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlVerticalPositioningReferenceFilled.m b/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlVerticalPositioningReferenceFilled.m index d24b311b23c..ac42a989ff3 100644 --- a/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlVerticalPositioningReferenceFilled.m +++ b/components/private/TextControlsPrivate/src/FilledStyle/MDCTextControlVerticalPositioningReferenceFilled.m @@ -17,7 +17,7 @@ static const CGFloat kMinPaddingAroundTextWhenNoFloatingLabel = 6.0f; static const CGFloat kMaxPaddingAroundTextWhenNoFloatingLabel = 10.0f; -static const CGFloat kMinPaddingBetweenContainerTopAndFloatingLabel = 6.0f; +static const CGFloat kMinPaddingBetweenContainerTopAndFloatingLabel = 3.0f; static const CGFloat kMaxPaddingBetweenContainerTopAndFloatingLabel = 10.0f; static const CGFloat kMinPaddingBetweenFloatingLabelAndEditingText = 3.0f; static const CGFloat kMaxPaddingBetweenFloatingLabelAndEditingText = 6.0f; diff --git a/components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlVerticalPositioningReferenceOutlined.m b/components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlVerticalPositioningReferenceOutlined.m index 0504659cf11..974361d9af2 100644 --- a/components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlVerticalPositioningReferenceOutlined.m +++ b/components/private/TextControlsPrivate/src/OutlinedStyle/MDCTextControlVerticalPositioningReferenceOutlined.m @@ -20,9 +20,9 @@ achieve the look and feel of the textfields at https://material.io/design/components/text-fields.html. */ -static const CGFloat kMinPaddingAroundTextWhenNoFloatingLabel = 6.0f; +static const CGFloat kMinPaddingAroundTextWhenNoFloatingLabel = 4.0f; static const CGFloat kMaxPaddingAroundTextWhenNoFloatingLabel = 10.0f; -static const CGFloat kMinPaddingBetweenFloatingLabelAndEditingText = (CGFloat)8.0; +static const CGFloat kMinPaddingBetweenFloatingLabelAndEditingText = (CGFloat)3.0; static const CGFloat kMaxPaddingBetweenFloatingLabelAndEditingText = (CGFloat)12.0; static const CGFloat kMinPaddingAroundAssistiveLabels = (CGFloat)3.0; static const CGFloat kMaxPaddingAroundAssistiveLabels = (CGFloat)6.0; From d0ac5f2c8396ba7c5cd278b7892330effe7aa093 Mon Sep 17 00:00:00 2001 From: Nobody Date: Wed, 3 Feb 2021 10:50:29 -0800 Subject: [PATCH 02/24] [Material-iOS/Chips, Material-iOS/BottomSheet] Clean up markdown formatting. PiperOrigin-RevId: 355431936 --- components/BottomSheet/README.md | 3 +- components/Chips/README.md | 225 ++++++++++++++++--------------- 2 files changed, 117 insertions(+), 111 deletions(-) diff --git a/components/BottomSheet/README.md b/components/BottomSheet/README.md index 3dc6952a970..05cb2a300a2 100644 --- a/components/BottomSheet/README.md +++ b/components/BottomSheet/README.md @@ -124,6 +124,7 @@ MDCBottomSheetController *bottomSheet = [[MDCBottomSheetController alloc] initWi // Present the bottom sheet [self presentViewController:bottomSheet animated:true completion:nil]; ``` + #### Behavioral customizations @@ -265,4 +266,4 @@ id shapeScheme = [[MDCShapeScheme alloc] init]; [MDCBottomSheetControllerShapeThemer applyShapeScheme:shapeScheme toBottomSheetController:component]; ``` - \ No newline at end of file + diff --git a/components/Chips/README.md b/components/Chips/README.md index 55a47d040c1..25ffa22b4d5 100644 --- a/components/Chips/README.md +++ b/components/Chips/README.md @@ -164,7 +164,6 @@ chipField.showChipsDeleteButton = true [chipField sizeToFit]; [self.view addSubview:chipField]; ``` - ## Choice chip @@ -174,37 +173,39 @@ Choice chips clearly delineate and display options in a compact area. They are a It is easiest to create choice Chips using a `UICollectionView`: - - Use `MDCChipCollectionViewFlowLayout` as the `UICollectionView` layout: - - ```objc - MDCChipCollectionViewFlowLayout *layout = [[MDCChipCollectionViewFlowLayout alloc] init]; - _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; - ``` - - - - Leave the default `UICollectionView` selection setting (single selection). - - Use `MDCChipCollectionViewCell` as `UICollectionView` cells. (`MDCChipCollectionViewCell` manages the state of the chip based on selection state of `UICollectionView` automatically) - - - ```objc - - (void)loadView { - [super loadView]; - … - [_collectionView registerClass:[MDCChipCollectionViewCell class] - forCellWithReuseIdentifier:@"identifier"]; - ... - } - - - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView - cellForItemAtIndexPath:(NSIndexPath *)indexPath { - MDCChipCollectionViewCell *cell = - [collectionView dequeueReusableCellWithReuseIdentifier:@"identifier" forIndexPath:indexPath]; - MDCChipView *chipView = cell.chipView; - // configure the chipView - return cell; - } - ``` - +- Use `MDCChipCollectionViewFlowLayout` as the `UICollectionView` layout: + + +```objc +MDCChipCollectionViewFlowLayout *layout = [[MDCChipCollectionViewFlowLayout alloc] init]; +_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; +``` + + +- Leave the default `UICollectionView` selection setting (single selection). + +- Use `MDCChipCollectionViewCell` as `UICollectionView` cells. (`MDCChipCollectionViewCell` manages the state of the chip based on selection state of `UICollectionView` automatically) + + +```objc +- (void)loadView { + [super loadView]; + … + [_collectionView registerClass:[MDCChipCollectionViewCell class] + forCellWithReuseIdentifier:@"identifier"]; + ... + } + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView + cellForItemAtIndexPath:(NSIndexPath *)indexPath { + MDCChipCollectionViewCell *cell = + [collectionView dequeueReusableCellWithReuseIdentifier:@"identifier" forIndexPath:indexPath]; + MDCChipView *chipView = cell.chipView; + // configure the chipView + return cell; +} +``` + - Use `UICollectionViewDelegate` methods `collectionView:didSelectItemAtIndexPath:` for reacting to new choices. @@ -218,42 +219,45 @@ Filter chips clearly delineate and display options in a compact area. They are a It is easiest to create filter Chips using a `UICollectionView`: - - Use `MDCChipCollectionViewFlowLayout` as the `UICollectionView` layout: - - ```objc - MDCChipCollectionViewFlowLayout *layout = [[MDCChipCollectionViewFlowLayout alloc] init]; - _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; - ``` - - - - Allow multi cell selection in the `UICollectionView`: - - ```objc - collectionView.allowsMultipleSelection = YES; - ``` - - - Use `MDCChipCollectionViewCell` as `UICollectionView` cells. (`MDCChipCollectionViewCell` manages the state of the chip based on selection state of `UICollectionView` automatically) - - - ```objc - - (void)loadView { - [super loadView]; - … - [_collectionView registerClass:[MDCChipCollectionViewCell class] - forCellWithReuseIdentifier:@"identifier"]; - ... - } - - - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView - cellForItemAtIndexPath:(NSIndexPath *)indexPath { - MDCChipCollectionViewCell *cell = - [collectionView dequeueReusableCellWithReuseIdentifier:@"identifier" forIndexPath:indexPath]; - MDCChipView *chipView = cell.chipView; - // configure the chipView - return cell; - } - ``` - +- Use `MDCChipCollectionViewFlowLayout` as the `UICollectionView` layout: + + +```objc +MDCChipCollectionViewFlowLayout *layout = [[MDCChipCollectionViewFlowLayout alloc] init]; +_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; +``` + + +- Allow multi cell selection in the `UICollectionView`: + + +```objc +collectionView.allowsMultipleSelection = YES; +``` + + +- Use `MDCChipCollectionViewCell` as `UICollectionView` cells. (`MDCChipCollectionViewCell` manages the state of the chip based on selection state of `UICollectionView` automatically) + + +```objc +- (void)loadView { + [super loadView]; + … + [_collectionView registerClass:[MDCChipCollectionViewCell class] + forCellWithReuseIdentifier:@"identifier"]; + ... + } + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView + cellForItemAtIndexPath:(NSIndexPath *)indexPath { + MDCChipCollectionViewCell *cell = + [collectionView dequeueReusableCellWithReuseIdentifier:@"identifier" forIndexPath:indexPath]; + MDCChipView *chipView = cell.chipView; + // configure the chipView + return cell; +} +``` + - Use `UICollectionViewDelegate` methods `collectionView:didSelectItemAtIndexPath:` and `collectionView:didDeselectItemAtIndexPath:` for reacting to filter changes. @@ -267,51 +271,52 @@ An alternative to action chips are buttons, which should appear persistently and It is easiest to create action Chips using a `UICollectionView`: - - Use `MDCChipCollectionViewFlowLayout` as the `UICollectionView` layout: - - ```objc - MDCChipCollectionViewFlowLayout *layout = [[MDCChipCollectionViewFlowLayout alloc] init]; - _collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; - ``` - - - - Leave the default `UICollectionView` selection setting (single selection). - - Use `MDCChipCollectionViewCell` as `UICollectionView` cells. (`MDCChipCollectionViewCell` manages the state of the chip based on selection state of `UICollectionView` automatically) - - - ```objc - - (void)loadView { - [super loadView]; - … - [_collectionView registerClass:[MDCChipCollectionViewCell class] - forCellWithReuseIdentifier:@"identifier"]; - ... - } - - - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView - cellForItemAtIndexPath:(NSIndexPath *)indexPath { - MDCChipCollectionViewCell *cell = - [collectionView dequeueReusableCellWithReuseIdentifier:@"identifier" forIndexPath:indexPath]; - MDCChipView *chipView = cell.chipView; - // configure the chipView - return cell; - } - ``` - +- Use `MDCChipCollectionViewFlowLayout` as the `UICollectionView` layout: + + +```objc +MDCChipCollectionViewFlowLayout *layout = [[MDCChipCollectionViewFlowLayout alloc] init]; +_collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout]; +``` + + +- Leave the default `UICollectionView` selection setting (single selection). +- Use `MDCChipCollectionViewCell` as `UICollectionView` cells. (`MDCChipCollectionViewCell` manages the state of the chip based on selection state of `UICollectionView` automatically) + + +```objc +- (void)loadView { + [super loadView]; + … + [_collectionView registerClass:[MDCChipCollectionViewCell class] + forCellWithReuseIdentifier:@"identifier"]; + ... + } + +- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView + cellForItemAtIndexPath:(NSIndexPath *)indexPath { + MDCChipCollectionViewCell *cell = + [collectionView dequeueReusableCellWithReuseIdentifier:@"identifier" forIndexPath:indexPath]; + MDCChipView *chipView = cell.chipView; + // configure the chipView + return cell; +} +``` + - Make sure that `MDCChipCollectionViewCell` does not stay in selected state - - ```objc - - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { - // For action chips, we never want the chip to stay in selected state. - // Other possible apporaches would be relying on theming or Customizing collectionViewCell - // selected state. - [collectionView deselectItemAtIndexPath:indexPath animated:NO]; - // Trigger the action - } - ``` - + +```objc +- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { + // For action chips, we never want the chip to stay in selected state. + // Other possible apporaches would be relying on theming or Customizing collectionViewCell + // selected state. + [collectionView deselectItemAtIndexPath:indexPath animated:NO]; + // Trigger the action +} +``` + - Use `UICollectionViewDelegate` method `collectionView:didSelectItemAtIndexPath:` to Trigger the action. From fdb53be95e6923b7175e5fcd09e850ae0bf69252 Mon Sep 17 00:00:00 2001 From: Alyssa Weiss Date: Thu, 4 Feb 2021 07:59:09 -0800 Subject: [PATCH 03/24] Add snapshot and unit tests. PiperOrigin-RevId: 355626654 --- .../snapshot/MDCProgressViewSnapshotTests.m | 38 +++++++++++++++++++ .../tests/unit/ProgressViewTests.m | 19 ++++++++++ 2 files changed, 57 insertions(+) diff --git a/components/ProgressView/tests/snapshot/MDCProgressViewSnapshotTests.m b/components/ProgressView/tests/snapshot/MDCProgressViewSnapshotTests.m index 78aea0fb9f7..35514a3c990 100644 --- a/components/ProgressView/tests/snapshot/MDCProgressViewSnapshotTests.m +++ b/components/ProgressView/tests/snapshot/MDCProgressViewSnapshotTests.m @@ -215,4 +215,42 @@ - (void)testGradientProgress100RTL { [self generateSnapshotAndVerifyForView:self.progressView]; } +- (void)testHidden { + // When + self.progressView.progress = .5; + XCTestExpectation *hiddenExpectation = [self expectationWithDescription:@"hidden"]; + [self.progressView setHidden:YES + animated:NO + completion:^(BOOL finished) { + [hiddenExpectation fulfill]; + }]; + [self waitForExpectations:@[ hiddenExpectation ] timeout:1]; + + // Then + [self generateSnapshotAndVerifyForView:self.progressView]; +} + +- (void)testHiddenThenUnhidden { + // When + self.progressView.progress = .5; + XCTestExpectation *hiddenExpectation = [self expectationWithDescription:@"hidden"]; + XCTestExpectation *unhiddenExpectation = [self expectationWithDescription:@"unhidden"]; + [self.progressView setHidden:YES + animated:NO + completion:^(BOOL finished) { + [hiddenExpectation fulfill]; + }]; + [self waitForExpectations:@[ hiddenExpectation ] timeout:1]; + + [self.progressView setHidden:NO + animated:NO + completion:^(BOOL finished) { + [unhiddenExpectation fulfill]; + }]; + [self waitForExpectations:@[ unhiddenExpectation ] timeout:1]; + + // Then + [self generateSnapshotAndVerifyForView:self.progressView]; +} + @end diff --git a/components/ProgressView/tests/unit/ProgressViewTests.m b/components/ProgressView/tests/unit/ProgressViewTests.m index 75845e8f919..0d3fa59214f 100644 --- a/components/ProgressView/tests/unit/ProgressViewTests.m +++ b/components/ProgressView/tests/unit/ProgressViewTests.m @@ -45,6 +45,25 @@ - (void)testCornerRadius { XCTAssertEqual(_progressView.cornerRadius, 0); } +- (void)testDefaultMode { + XCTAssertEqual(_progressView.mode, MDCProgressViewModeDeterminate); +} + +- (void)testSetMode { + _progressView.mode = MDCProgressViewModeIndeterminate; + XCTAssertEqual(_progressView.mode, MDCProgressViewModeIndeterminate); +} + +- (void)testDefaultProgressTintColors { + XCTAssertEqual(_progressView.progressTintColors, nil); +} + +- (void)testSetProgressTintColors { + NSArray *colors = @[ UIColor.blueColor, UIColor.greenColor ]; + _progressView.progressTintColors = colors; + XCTAssertEqualObjects(_progressView.progressTintColors, colors); +} + - (void)testInitialProgress { XCTAssertEqual(_progressView.progress, 0); } From 2bb776a0a76132dfcc6cadcd7a5bcc01331361c4 Mon Sep 17 00:00:00 2001 From: Alyssa Weiss Date: Fri, 5 Feb 2021 06:39:31 -0800 Subject: [PATCH 04/24] Remove Google specific deprecation policy from Github. PiperOrigin-RevId: 355839846 --- contributing/deprecation_policy.md | 161 +---------------------------- 1 file changed, 2 insertions(+), 159 deletions(-) diff --git a/contributing/deprecation_policy.md b/contributing/deprecation_policy.md index a7203942b35..74753828032 100644 --- a/contributing/deprecation_policy.md +++ b/contributing/deprecation_policy.md @@ -15,165 +15,8 @@ Before embarking on the deprecation of any API we should collaboratively answer 1. What is a good deprecation timeline? 1. Who is responsible for the deprecation plan? -## Our deprecation process (Non-Googlers) +## Deprecation process If you would like to propose that an API be deprecated please [file a bug](https://github.com/material-components/material-components-ios/issues/new/choose) -explaining which API you'd like deprecated. A Googler will take the issue from there by following -the deprecation process below. - -## Our deprecation process (Googlers) - -1. Measure internal usage of the API. -2. Write a migration guide. -3. Determine a schedule for the API deprecation and deletion. -4. Mark the API as To Be Deprecated. -5. Announce that the API will be deprecated. -6. After the deprecation date, annotate the API as deprecated. -7. After the deletion date, re-evaluate usage of the API. -8. Delete the API and migration guide. - -### Step 1: Measure internal usage of the API - -Read [go/mdc-ios-measuring-api-usage](http://go/mdc-ios-measuring-api-usage) to learn how to measure -API usage internally. - -If there is zero API usage beyond our own library: skip to step 7 (Deprecate the API). - -### Step 2: Write a migration guide - -This guide should be placed in the component's docs/ folder and have a prefix `migration-guide-`. - -For example, `migration-guide-appbar-appbarviewcontroller.md` is a guide from MDCAppBar to -MDCAppBarViewController. - -Send this migration guide out for review as a standalone pull request. - -### Step 3: Determine a schedule for the API deprecation and deletion - -Generally speaking deprecations take a long time unless you take an active part in migrating -clients. Calculate your estimates with this in mind. A rough guideline: - -- small changes can often be done in a month. -- larger changes can be done in a quarter/three months. - -Adjust up or down based on the usage of the to-be-deprecated API and the complexity of the -migration guide. - -Sanity check your estimate with a team member before moving on to the next step. - -Assuming that you’re looking at a one-month deprecation, then the schedule looks roughly like -this: - -1. *T minus 4 weeks*: Deprecation is announced but no breaking or behavior changes are -introduced. -1. *T minus 3 weeks*: Old code is marked as deprecated, generating warnings. - -A three-month deprecation is similar with more time for clients to adjust code: - -1. *T minus 12 weeks*: Announce. -1. *T minus 9 weeks*: Mark code as deprecated. - -Map this schedule onto reality: - -1. Is there a holiday/conference coming up that would prevent clients from being able to - collaborate and comment? -1. Is the to-be-replaced code particularly problematic for some reason? -1. Does the deprecation fall near a release of the operating system or new devices? - -**Once you have determined a schedule, add the schedule to the migration guide**. - -### Step 4: Mark the API as To Be Deprecated - -Add a `@warning` annotation to the API's public documentation indicating the intent for this API to -eventually be deprecated. This warning should also provide a short suggested alternative, if one -exists, and a link to the migration guide. - -For example: - -```objc -@warning This method will soon be deprecated. Consider using -@c +applySemanticColorScheme:toFlexibleHeaderView: instead. Learn more at -components/schemes/Color/docs/migration-guide-semantic-color-scheme.md -``` - -If the API to be deprecated is a method or property of a class, also move the API to a category -named `ToBeDeprecated`. This will cause the API to show up in our release notes automatically as -a to-be-deprecated API. - -For example: - -```objc -@interface MDCAppBarContainerViewController (ToBeDeprecated) - -/** - The App Bar views that will be presented in front of the contentViewController's view. - - @warning This API will eventually be deprecated. Use appBarViewController instead. Learn more at - components/AppBar/docs/migration-guide-appbar-appbarviewcontroller.md - */ -@property(nonatomic, strong, nonnull, readonly) MDCAppBar *appBar; - -@end -``` - -### Step 5: Announce that the API will be deprecated - -Inform internal clients of the impending deprecation by sending an email with the following -format: - -``` -Subject: YYY will eventually be deprecated. -Body: -YYY will eventually be deprecated. Please see for more details. - -The timeline for this deprecation is as follows: - -- : The API will be formally marked as deprecated. You will start receiving - build warnings if you are still using the deprecated API. -- : The API will be deleted. -``` - -### Step 6: After the deprecation date, annotate the API as deprecated - -Send a pull request annotating the API as deprecated. Use `__deprecated_msg("")` and provide a -concise message with a recommendation for an alternative API, if any is available. - -### Step 7: After the deletion date, re-evaluate usage of the API - -Once the deletion date has passed and at least one release has been cut since the API was marked as -deprecated, you can now consider deleting the API. But first: you must evaluate whether the API is -being used by any internal clients. - -If the API is still being used by clients, you have a few options: - -- Reach out to the client teams directly, reminding them of the deprecation. -- Help the client teams migrate. - -Proceed to step 9 once you've confirmed that there are zero internal usages of the API. - -### Step 8: Delete the API and migration guide - -Once you have confirmed that there is no internal usage of the API, you can safely delete it and the migration guide. - -Send a pull request deleting the API, marking your "Delete YYY" issue as closed. - -## Addendum - -### Versioning - -Adding the deprecation *warning* (no breaking change) is a minor version bump. - -Actually changing the code (breaking change) is a major version bump. - -Changes that don't break anyone (or change behavior surprisingly) don't need a deprecation. - -### Compiler warnings - -If you are treating warnings as errors in your application via the `-Werror` compiler flag, you -may need to disable this functionality for deprecated code warnings. - -This can be done by adding the `-Wno-error=deprecated` and `-Wno-error=deprecated-implementations` -compiler flags to your application target via an .xcconfig or under "Other C Flags" in your Build -Settings. Xcode will still issue the warning during compilation, but they will not be treated as -errors. +explaining which API you'd like deprecated. From c7a70ce81893c97656f8aec6c824fc44066dad88 Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Fri, 5 Feb 2021 11:00:55 -0800 Subject: [PATCH 05/24] [ProgressView] Remove generics from ProgressView's progressTintColors PiperOrigin-RevId: 355885230 --- components/ProgressView/src/MDCProgressView.h | 2 +- components/ProgressView/src/MDCProgressView.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ProgressView/src/MDCProgressView.h b/components/ProgressView/src/MDCProgressView.h index ef54877c7a3..ea943c246ac 100644 --- a/components/ProgressView/src/MDCProgressView.h +++ b/components/ProgressView/src/MDCProgressView.h @@ -56,7 +56,7 @@ IB_DESIGNABLE The default is nil. */ -@property(nonatomic, copy, nullable) NSArray *progressTintColors; +@property(nonatomic, copy, nullable) NSArray *progressTintColors; /** The color shown for the portion of the progress view that is not filled. diff --git a/components/ProgressView/src/MDCProgressView.m b/components/ProgressView/src/MDCProgressView.m index 1da69dd46e7..0beb13b1171 100644 --- a/components/ProgressView/src/MDCProgressView.m +++ b/components/ProgressView/src/MDCProgressView.m @@ -140,7 +140,7 @@ - (void)setProgressTintColor:(UIColor *)progressTintColor { } } -- (void)setProgressTintColors:(NSArray *)progressTintColors { +- (void)setProgressTintColors:(NSArray *)progressTintColors { _progressTintColors = [progressTintColors copy]; _progressTintColor = nil; self.progressView.colors = _progressTintColors; From 4b4b0f3d7d1753a926ef88723361656252219f28 Mon Sep 17 00:00:00 2001 From: Alyssa Weiss Date: Fri, 5 Feb 2021 11:34:48 -0800 Subject: [PATCH 06/24] Ensure correct Voiceover behavior in iOS 14. PiperOrigin-RevId: 355892745 --- .../src/private/MDCBottomNavigationItemView.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/BottomNavigation/src/private/MDCBottomNavigationItemView.m b/components/BottomNavigation/src/private/MDCBottomNavigationItemView.m index 091e937a3ac..c294b918c42 100644 --- a/components/BottomNavigation/src/private/MDCBottomNavigationItemView.m +++ b/components/BottomNavigation/src/private/MDCBottomNavigationItemView.m @@ -168,6 +168,10 @@ - (void)commonMDCBottomNavigationItemViewInit { _button.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); _button.accessibilityLabel = [self accessibilityLabelWithTitle:_title]; _button.accessibilityValue = self.accessibilityValue; + // This needs to be set specifically for VoiceOver to work on iOS 14, see b/175421576 + if (@available(iOS 14, *)) { + _button.accessibilityTraits |= UIAccessibilityTraitButton; + } [self addSubview:_button]; } } From bcf4760ceba9933de3aa771b1e58cc9e97d7fbed Mon Sep 17 00:00:00 2001 From: Randall Li Date: Mon, 8 Feb 2021 10:43:50 -0800 Subject: [PATCH 07/24] [MDCAlertController] Fixed typo in API doc. PiperOrigin-RevId: 356300861 --- components/Dialogs/src/MDCAlertController.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Dialogs/src/MDCAlertController.h b/components/Dialogs/src/MDCAlertController.h index fef88628c1f..a7962b27361 100644 --- a/components/Dialogs/src/MDCAlertController.h +++ b/components/Dialogs/src/MDCAlertController.h @@ -74,7 +74,7 @@ - (nullable instancetype)initWithCoder:(nonnull NSCoder *)aDecoder NS_UNAVAILABLE; /** - A block that is invoked whan a link (a URL) in the attributed message text is tapped. + A block that is invoked when a link (a URL) in the attributed message text is tapped. @param URL The URL of the link that was tapped. May include external or internal URLs. @param range The range of characters (in the attributed text) of the link that was tapped. From 22cb5afa87d9fedc134ae64002e48a3c227b2798 Mon Sep 17 00:00:00 2001 From: Randall Li Date: Mon, 8 Feb 2021 18:47:11 -0800 Subject: [PATCH 08/24] [MDCFlexibleHeader] Redefine topSafeAreaGuide as a UIView. Was of type id. This allows for friendlier use by clients. PiperOrigin-RevId: 356403425 --- components/FlexibleHeader/src/MDCFlexibleHeaderView.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/FlexibleHeader/src/MDCFlexibleHeaderView.h b/components/FlexibleHeader/src/MDCFlexibleHeaderView.h index 2191399b40c..7d3696fa9a4 100644 --- a/components/FlexibleHeader/src/MDCFlexibleHeaderView.h +++ b/components/FlexibleHeader/src/MDCFlexibleHeaderView.h @@ -251,7 +251,7 @@ IB_DESIGNABLE This object is intended to be used as a constraint item. */ -@property(nonatomic, nonnull, readonly) id topSafeAreaGuide; +@property(nonatomic, nonnull, readonly) UIView *topSafeAreaGuide; #pragma mark Behaviors From 25c9049d5a4ee13ed9085ca01a92ed3b25867989 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Wed, 10 Feb 2021 11:58:20 -0800 Subject: [PATCH 09/24] Optimizing imports PiperOrigin-RevId: 356791916 --- components/Buttons/tests/unit/MDCButtonAlphaTests.m | 4 ---- components/Buttons/tests/unit/MDCButtonColorThemerTests.m | 1 + .../unit/MDCButtonInterfaceBuilderCompatibilityTests.m | 1 + components/Buttons/tests/unit/MDCButtonRippleTests.m | 1 + components/Buttons/tests/unit/MDCButtonShapeThemerTests.m | 4 +++- components/Buttons/tests/unit/MDCButtonSubclassingTests.m | 3 --- components/Buttons/tests/unit/MDCButtonThemerTests.m | 1 - .../Buttons/tests/unit/MDCButtonTypographyThemerTests.m | 3 ++- components/Dialogs/tests/unit/MDCAlertActionManagerTests.m | 1 + .../tests/unit/MDCAlertControllerColorThemerTests.m | 2 ++ .../tests/unit/MDCAlertControllerCustomizationTests.m | 1 - .../Dialogs/tests/unit/MDCAlertControllerInsetsTests.m | 2 ++ .../Dialogs/tests/unit/MDCAlertControllerRippleTests.m | 2 ++ components/Dialogs/tests/unit/MDCAlertControllerTests.m | 2 ++ .../tests/unit/MDCAlertControllerTypographyThemerTests.m | 2 ++ .../supplemental/MDCTextControlConfiguratorExample.m | 6 ++---- .../supplemental/MDCTextControlContentViewController.m | 7 ++----- .../MDCTextControlTextAreaConfiguratorExample.m | 1 + .../MDCTextControlTextAreaContentViewController.m | 4 +--- .../MDCTextControlTextFieldConfiguratorExample.m | 1 + .../MDCTextControlTextFieldContentViewController.m | 6 ++---- 21 files changed, 28 insertions(+), 27 deletions(-) diff --git a/components/Buttons/tests/unit/MDCButtonAlphaTests.m b/components/Buttons/tests/unit/MDCButtonAlphaTests.m index cfc99a07ac9..fe115552feb 100644 --- a/components/Buttons/tests/unit/MDCButtonAlphaTests.m +++ b/components/Buttons/tests/unit/MDCButtonAlphaTests.m @@ -15,10 +15,6 @@ #import #import "MaterialButtons.h" -#import "MaterialShadowElevations.h" -#import "MaterialShadowLayer.h" -#import "MaterialShapes.h" -#import "MaterialTypography.h" @interface MDCButtonAlphaTests : XCTestCase @property(nonatomic, strong, nullable) MDCButton *button; diff --git a/components/Buttons/tests/unit/MDCButtonColorThemerTests.m b/components/Buttons/tests/unit/MDCButtonColorThemerTests.m index bdf7c88bf0e..2a69de21a7d 100644 --- a/components/Buttons/tests/unit/MDCButtonColorThemerTests.m +++ b/components/Buttons/tests/unit/MDCButtonColorThemerTests.m @@ -16,6 +16,7 @@ #import "MaterialButtons+ColorThemer.h" #import "MaterialButtons.h" +#import "MaterialColorScheme.h" static const CGFloat kEpsilonAccuracy = (CGFloat)0.001; diff --git a/components/Buttons/tests/unit/MDCButtonInterfaceBuilderCompatibilityTests.m b/components/Buttons/tests/unit/MDCButtonInterfaceBuilderCompatibilityTests.m index 55aebafcc72..5aa3a29fc5d 100644 --- a/components/Buttons/tests/unit/MDCButtonInterfaceBuilderCompatibilityTests.m +++ b/components/Buttons/tests/unit/MDCButtonInterfaceBuilderCompatibilityTests.m @@ -16,6 +16,7 @@ #import #import "supplemental/ButtonTestView.h" +#import "MaterialButtons.h" @interface MDCButtonInterfaceBuilderCompatibilityTests : XCTestCase diff --git a/components/Buttons/tests/unit/MDCButtonRippleTests.m b/components/Buttons/tests/unit/MDCButtonRippleTests.m index d6b7c642e34..77db2c9925a 100644 --- a/components/Buttons/tests/unit/MDCButtonRippleTests.m +++ b/components/Buttons/tests/unit/MDCButtonRippleTests.m @@ -15,6 +15,7 @@ #import #import "MaterialButtons.h" +#import "MaterialInk.h" #import "MaterialRipple.h" @interface MDCButton (Testing) diff --git a/components/Buttons/tests/unit/MDCButtonShapeThemerTests.m b/components/Buttons/tests/unit/MDCButtonShapeThemerTests.m index 3fca0044904..79416360eee 100644 --- a/components/Buttons/tests/unit/MDCButtonShapeThemerTests.m +++ b/components/Buttons/tests/unit/MDCButtonShapeThemerTests.m @@ -14,9 +14,11 @@ #import -#import "MaterialButtons+ShapeThemer.h" #import "MaterialButtons.h" +#import "MaterialButtons+ShapeThemer.h" #import "MaterialShapeLibrary.h" +#import "MaterialShapes.h" +#import "MaterialShapeScheme.h" @interface MDCButtonShapeThemerTests : XCTestCase diff --git a/components/Buttons/tests/unit/MDCButtonSubclassingTests.m b/components/Buttons/tests/unit/MDCButtonSubclassingTests.m index 4980ea5c47b..6c8dcd52146 100644 --- a/components/Buttons/tests/unit/MDCButtonSubclassingTests.m +++ b/components/Buttons/tests/unit/MDCButtonSubclassingTests.m @@ -14,10 +14,7 @@ #import -#import "../../src/private/MDCButton+Subclassing.h" #import "MaterialButtons.h" -#import "MaterialShadowElevations.h" -#import "MaterialTypography.h" static const UIEdgeInsets ButtonTestContentEdgeInsets = {1, 2, 3, 4}; static const CGFloat ButtonTestCornerRadius = (CGFloat)1.234; diff --git a/components/Buttons/tests/unit/MDCButtonThemerTests.m b/components/Buttons/tests/unit/MDCButtonThemerTests.m index 118ce8af7f0..5c7e2f8a98c 100644 --- a/components/Buttons/tests/unit/MDCButtonThemerTests.m +++ b/components/Buttons/tests/unit/MDCButtonThemerTests.m @@ -17,7 +17,6 @@ #import "MaterialButtons+ButtonThemer.h" #import "MaterialButtons.h" #import "MaterialColorScheme.h" -#import "MaterialPalettes.h" #import "MaterialTypographyScheme.h" static const CGFloat kEpsilonAccuracy = (CGFloat)0.001; diff --git a/components/Buttons/tests/unit/MDCButtonTypographyThemerTests.m b/components/Buttons/tests/unit/MDCButtonTypographyThemerTests.m index 90dd5f2a556..a387ad3e5e2 100644 --- a/components/Buttons/tests/unit/MDCButtonTypographyThemerTests.m +++ b/components/Buttons/tests/unit/MDCButtonTypographyThemerTests.m @@ -14,8 +14,9 @@ #import -#import "MaterialButtons+TypographyThemer.h" #import "MaterialButtons.h" +#import "MaterialButtons+TypographyThemer.h" +#import "MaterialTypographyScheme.h" @interface MDCButtonTypographyThemerTests : XCTestCase @end diff --git a/components/Dialogs/tests/unit/MDCAlertActionManagerTests.m b/components/Dialogs/tests/unit/MDCAlertActionManagerTests.m index a8251bcf466..ef09b5640df 100644 --- a/components/Dialogs/tests/unit/MDCAlertActionManagerTests.m +++ b/components/Dialogs/tests/unit/MDCAlertActionManagerTests.m @@ -15,6 +15,7 @@ #import #import "MaterialButtons.h" #import "MDCAlertController+ButtonForAction.h" +#import "MaterialDialogs.h" #import "MDCAlertActionManager.h" #import "MDCAlertControllerView+Private.h" diff --git a/components/Dialogs/tests/unit/MDCAlertControllerColorThemerTests.m b/components/Dialogs/tests/unit/MDCAlertControllerColorThemerTests.m index 1ea47c70cc5..4295c238073 100644 --- a/components/Dialogs/tests/unit/MDCAlertControllerColorThemerTests.m +++ b/components/Dialogs/tests/unit/MDCAlertControllerColorThemerTests.m @@ -15,7 +15,9 @@ #import "MaterialDialogs+ColorThemer.h" #import "MaterialDialogs.h" +#import "MDCAlertActionManager.h" #import "MDCAlertControllerView+Private.h" +#import "MaterialColorScheme.h" #import diff --git a/components/Dialogs/tests/unit/MDCAlertControllerCustomizationTests.m b/components/Dialogs/tests/unit/MDCAlertControllerCustomizationTests.m index 84f3b2b23e8..95d56ac6b00 100644 --- a/components/Dialogs/tests/unit/MDCAlertControllerCustomizationTests.m +++ b/components/Dialogs/tests/unit/MDCAlertControllerCustomizationTests.m @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "MaterialDialogs+TypographyThemer.h" #import "MaterialDialogs.h" #import "MDCAlertControllerView+Private.h" diff --git a/components/Dialogs/tests/unit/MDCAlertControllerInsetsTests.m b/components/Dialogs/tests/unit/MDCAlertControllerInsetsTests.m index 07d67667b74..f01e8149ec5 100644 --- a/components/Dialogs/tests/unit/MDCAlertControllerInsetsTests.m +++ b/components/Dialogs/tests/unit/MDCAlertControllerInsetsTests.m @@ -12,10 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. +#import "MaterialButtons.h" #import "MaterialDialogs.h" #import "MDCAlertController+ButtonForAction.h" #import "MDCAlertController+Testing.h" +#import "MDCAlertActionManager.h" #import "MDCAlertControllerView+Private.h" #import diff --git a/components/Dialogs/tests/unit/MDCAlertControllerRippleTests.m b/components/Dialogs/tests/unit/MDCAlertControllerRippleTests.m index 0ef58966521..a71e68cc9fc 100644 --- a/components/Dialogs/tests/unit/MDCAlertControllerRippleTests.m +++ b/components/Dialogs/tests/unit/MDCAlertControllerRippleTests.m @@ -14,8 +14,10 @@ #import +#import "MaterialButtons.h" #import "MaterialDialogs.h" +#import "MDCAlertActionManager.h" #import "MDCAlertControllerView+Private.h" #pragma mark - Subclasses for testing diff --git a/components/Dialogs/tests/unit/MDCAlertControllerTests.m b/components/Dialogs/tests/unit/MDCAlertControllerTests.m index 63ec6168dd4..3edbe23591b 100644 --- a/components/Dialogs/tests/unit/MDCAlertControllerTests.m +++ b/components/Dialogs/tests/unit/MDCAlertControllerTests.m @@ -16,6 +16,8 @@ #import "MaterialButtons.h" #import "MaterialDialogs.h" +#import "MDCAlertActionManager.h" +#import "MaterialShadowElevations.h" #import "MaterialTypography.h" #import "../../src/private/MDCDialogShadowedView.h" diff --git a/components/Dialogs/tests/unit/MDCAlertControllerTypographyThemerTests.m b/components/Dialogs/tests/unit/MDCAlertControllerTypographyThemerTests.m index c4719902ad0..3db040be23b 100644 --- a/components/Dialogs/tests/unit/MDCAlertControllerTypographyThemerTests.m +++ b/components/Dialogs/tests/unit/MDCAlertControllerTypographyThemerTests.m @@ -15,7 +15,9 @@ #import "MaterialDialogs+TypographyThemer.h" #import "MaterialDialogs.h" +#import "MDCAlertActionManager.h" #import "MDCAlertControllerView+Private.h" +#import "MaterialTypographyScheme.h" #import diff --git a/components/TextControls/examples/supplemental/MDCTextControlConfiguratorExample.m b/components/TextControls/examples/supplemental/MDCTextControlConfiguratorExample.m index 9a27550c69d..15ef6faf222 100644 --- a/components/TextControls/examples/supplemental/MDCTextControlConfiguratorExample.m +++ b/components/TextControls/examples/supplemental/MDCTextControlConfiguratorExample.m @@ -15,13 +15,11 @@ #import #import "MaterialButtons.h" +#import "MDCTextControlContentViewController.h" +#import "MaterialColorScheme.h" #import "MaterialContainerScheme.h" -#import "MaterialTextControls+FilledTextFieldsTheming.h" -#import "MaterialTextControls+OutlinedTextFieldsTheming.h" -#import "MaterialTextControlsPrivate+Shared.h" #import "MDCTextControlConfiguratorExample.h" -#import "MDCTraitEnvironmentChangeDelegate.h" @interface MDCTextControlConfiguratorExample () diff --git a/components/TextControls/examples/supplemental/MDCTextControlContentViewController.m b/components/TextControls/examples/supplemental/MDCTextControlContentViewController.m index bbf4d080bc4..628f8d11a17 100644 --- a/components/TextControls/examples/supplemental/MDCTextControlContentViewController.m +++ b/components/TextControls/examples/supplemental/MDCTextControlContentViewController.m @@ -16,16 +16,13 @@ #import "MaterialButtons.h" -#import "MDCBaseTextField.h" #import "MaterialButtons+Theming.h" #import "MaterialColorScheme.h" -#import "MDCFilledTextField+MaterialTheming.h" -#import "MDCFilledTextField.h" -#import "MDCOutlinedTextField+MaterialTheming.h" -#import "MDCOutlinedTextField.h" #import "MDCTraitEnvironmentChangeDelegate.h" +#import "MaterialContainerScheme.h" +#import "MaterialTypographyScheme+Scheming.h" @interface MDCTextControlContentViewController () diff --git a/components/TextControls/examples/supplemental/MDCTextControlTextAreaConfiguratorExample.m b/components/TextControls/examples/supplemental/MDCTextControlTextAreaConfiguratorExample.m index f24b2ba3dd1..7f57fb134bc 100644 --- a/components/TextControls/examples/supplemental/MDCTextControlTextAreaConfiguratorExample.m +++ b/components/TextControls/examples/supplemental/MDCTextControlTextAreaConfiguratorExample.m @@ -16,6 +16,7 @@ #import "MDCTextControlTextAreaConfiguratorExample.h" +#import "MDCTextControlConfiguratorExample.h" #import "MDCTextControlTextAreaContentViewController.h" static NSString *const kExampleTitle = @"MDCTextControl TextAreas"; diff --git a/components/TextControls/examples/supplemental/MDCTextControlTextAreaContentViewController.m b/components/TextControls/examples/supplemental/MDCTextControlTextAreaContentViewController.m index 0527f7f8355..72e1f7fc5e9 100644 --- a/components/TextControls/examples/supplemental/MDCTextControlTextAreaContentViewController.m +++ b/components/TextControls/examples/supplemental/MDCTextControlTextAreaContentViewController.m @@ -14,9 +14,7 @@ #import "MDCTextControlTextAreaContentViewController.h" -#import "MaterialButtons.h" - -#import "MaterialButtons+Theming.h" +#import "MDCTextControlContentViewController.h" #import "MDCBaseTextArea.h" #import "MaterialColorScheme.h" #import "MaterialContainerScheme.h" diff --git a/components/TextControls/examples/supplemental/MDCTextControlTextFieldConfiguratorExample.m b/components/TextControls/examples/supplemental/MDCTextControlTextFieldConfiguratorExample.m index b1453a53aa1..eb84724f259 100644 --- a/components/TextControls/examples/supplemental/MDCTextControlTextFieldConfiguratorExample.m +++ b/components/TextControls/examples/supplemental/MDCTextControlTextFieldConfiguratorExample.m @@ -16,6 +16,7 @@ #import "MDCTextControlTextFieldConfiguratorExample.h" +#import "MDCTextControlConfiguratorExample.h" #import "MDCTextControlTextFieldContentViewController.h" static NSString *const kExampleTitle = @"MDCTextControl TextFields"; diff --git a/components/TextControls/examples/supplemental/MDCTextControlTextFieldContentViewController.m b/components/TextControls/examples/supplemental/MDCTextControlTextFieldContentViewController.m index 30a395dfc81..e366336f169 100644 --- a/components/TextControls/examples/supplemental/MDCTextControlTextFieldContentViewController.m +++ b/components/TextControls/examples/supplemental/MDCTextControlTextFieldContentViewController.m @@ -14,10 +14,7 @@ #import "MDCTextControlTextFieldContentViewController.h" -#import "MaterialButtons.h" - -#import "MaterialButtons+Theming.h" -#import "MDCBaseTextField.h" +#import "MDCTextControlContentViewController.h" #import "MaterialTextControls+BaseTextFields.h" #import "MaterialColorScheme.h" @@ -28,6 +25,7 @@ #import "MDCOutlinedTextField+MaterialTheming.h" #import "MaterialTextControls+UnderlinedTextFields.h" #import "MDCUnderlinedTextField+MaterialTheming.h" +#import "MaterialContainerScheme.h" @interface MDCTextControlTextFieldContentViewController () @property(nonatomic, assign) BOOL shouldAddDebugLeadingView; From 105c4f4ab046ab01bf0677247cfbceee2b51440f Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Wed, 10 Feb 2021 12:26:09 -0800 Subject: [PATCH 10/24] [Material-iOS/Buttons] Internal change PiperOrigin-RevId: 356799194 --- components/Buttons/src/MDCButton.m | 3 +-- components/Buttons/tests/snapshot/MDCButtonSnapshotTests.m | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/components/Buttons/src/MDCButton.m b/components/Buttons/src/MDCButton.m index d263d5205cd..c3203902cb2 100644 --- a/components/Buttons/src/MDCButton.m +++ b/components/Buttons/src/MDCButton.m @@ -15,15 +15,14 @@ #import "MDCButton.h" #import "private/MDCButton+Subclassing.h" +#import "MaterialElevation.h" #import "MaterialInk.h" #import "MaterialRipple.h" #import "MaterialShadowElevations.h" -#import "MaterialShadowLayer.h" #import "MaterialShapeLibrary.h" #import "MaterialShapes.h" #import "MaterialTypography.h" #import "MaterialMath.h" -#import // TODO(ajsecord): Animate title color when animating between enabled/disabled states. // Non-trivial: http://corecocoa.wordpress.com/2011/10/04/animatable-text-color-of-uilabel/ diff --git a/components/Buttons/tests/snapshot/MDCButtonSnapshotTests.m b/components/Buttons/tests/snapshot/MDCButtonSnapshotTests.m index bafad0e018b..25c5a644383 100644 --- a/components/Buttons/tests/snapshot/MDCButtonSnapshotTests.m +++ b/components/Buttons/tests/snapshot/MDCButtonSnapshotTests.m @@ -19,7 +19,7 @@ #import "MaterialAvailability.h" #import "MaterialButtons.h" #import "MaterialButtons+Theming.h" -#import "UIView+MDCSnapshot.h" +#import "MaterialColorScheme.h" #import "MaterialContainerScheme.h" /** A tests fake class of MDCButton. */ From 9f9b452b3aeb357ed46977d3c86d40d29e63200f Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Wed, 10 Feb 2021 16:13:12 -0800 Subject: [PATCH 11/24] Optimizing imports PiperOrigin-RevId: 356850973 --- .../BottomSheet/examples/BottomSheetAutolayoutExample.m | 1 - .../examples/BottomSheetDismissOnDraggingDownExample.m | 5 +++++ .../examples/BottomSheetModalPresentationExample.m | 1 - .../BottomSheetPresentationControllerDelegateExample.m | 1 + components/BottomSheet/examples/BottomSheetShapedExample.m | 5 ++++- .../BottomSheet/examples/BottomSheetTypicalUseExample.m | 5 +++++ .../unit/FlexibleHeaderHeightLegacySafeAreaBehaviorTests.m | 1 + .../FlexibleHeader/tests/unit/FlexibleHeaderHeightTests.m | 1 + .../unit/FlexibleHeaderMinMaxHeightIncludesSafeAreaTests.m | 2 +- .../tests/unit/FlexibleHeaderMinMaxHeightTests.m | 2 +- .../FlexibleHeader/tests/unit/FlexibleHeaderShifterTests.m | 1 + .../tests/unit/FlexibleHeaderTopSafeAreaTests.m | 2 +- .../NavigationBar/examples/NavigationBarIconsExample.m | 2 ++ .../NavigationBar/examples/NavigationBarLayoutExample.m | 3 +-- components/NavigationBar/examples/NavigationBarRTLIcons.m | 3 --- .../NavigationBar/examples/NavigationBarTypicalUseExample.m | 3 ++- .../examples/NavigationBarWithBarItemsExample.m | 3 ++- .../NavigationBar/examples/NavigationbarWithCustomFont.m | 3 ++- 18 files changed, 30 insertions(+), 14 deletions(-) diff --git a/components/BottomSheet/examples/BottomSheetAutolayoutExample.m b/components/BottomSheet/examples/BottomSheetAutolayoutExample.m index fc155152e80..e7fc43b3ae4 100644 --- a/components/BottomSheet/examples/BottomSheetAutolayoutExample.m +++ b/components/BottomSheet/examples/BottomSheetAutolayoutExample.m @@ -14,7 +14,6 @@ #import -#import "supplemental/BottomSheetDummyStaticViewController.h" #import "BottomSheetPresenterViewController.h" #import "MaterialBottomSheet.h" diff --git a/components/BottomSheet/examples/BottomSheetDismissOnDraggingDownExample.m b/components/BottomSheet/examples/BottomSheetDismissOnDraggingDownExample.m index e2b2928ea6a..27bde786098 100644 --- a/components/BottomSheet/examples/BottomSheetDismissOnDraggingDownExample.m +++ b/components/BottomSheet/examples/BottomSheetDismissOnDraggingDownExample.m @@ -19,8 +19,13 @@ #import "MaterialAppBar.h" #import "MaterialAppBar+TypographyThemer.h" #import "BottomSheetPresenterViewController.h" +#import "MDCSheetState.h" #import "MaterialBottomSheet.h" #import "MaterialBottomSheet+ShapeThemer.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialColorScheme.h" +#import "MaterialShapeScheme.h" +#import "MaterialTypographyScheme.h" @interface BottomSheetDismissOnDraggingDownExample : BottomSheetPresenterViewController @end diff --git a/components/BottomSheet/examples/BottomSheetModalPresentationExample.m b/components/BottomSheet/examples/BottomSheetModalPresentationExample.m index 4e04b3e9650..8034263081a 100644 --- a/components/BottomSheet/examples/BottomSheetModalPresentationExample.m +++ b/components/BottomSheet/examples/BottomSheetModalPresentationExample.m @@ -14,7 +14,6 @@ #import -#import "supplemental/BottomSheetDummyStaticViewController.h" #import "BottomSheetPresenterViewController.h" #import "MaterialBottomSheet.h" #import "MaterialButtons.h" diff --git a/components/BottomSheet/examples/BottomSheetPresentationControllerDelegateExample.m b/components/BottomSheet/examples/BottomSheetPresentationControllerDelegateExample.m index b840b62f28c..f4dc0f19aa7 100644 --- a/components/BottomSheet/examples/BottomSheetPresentationControllerDelegateExample.m +++ b/components/BottomSheet/examples/BottomSheetPresentationControllerDelegateExample.m @@ -1,5 +1,6 @@ #import "BottomSheetPresenterViewController.h" #import "MaterialBottomSheet.h" +#import "MaterialButtons.h" /** Demonstrates the use of MDCBottomSheetTransitionController. diff --git a/components/BottomSheet/examples/BottomSheetShapedExample.m b/components/BottomSheet/examples/BottomSheetShapedExample.m index 5954f2acc73..e0c148e3b5d 100644 --- a/components/BottomSheet/examples/BottomSheetShapedExample.m +++ b/components/BottomSheet/examples/BottomSheetShapedExample.m @@ -15,14 +15,17 @@ #import #import "supplemental/BottomSheetDummyCollectionViewController.h" -#import "supplemental/BottomSheetDummyStaticViewController.h" #import "MaterialAppBar+ColorThemer.h" #import "MaterialAppBar.h" #import "MaterialAppBar+TypographyThemer.h" #import "BottomSheetPresenterViewController.h" +#import "MDCSheetState.h" #import "MaterialBottomSheet.h" +#import "MaterialFlexibleHeader.h" #import "MaterialShapeLibrary.h" #import "MaterialShapes.h" +#import "MaterialColorScheme.h" +#import "MaterialTypographyScheme.h" @interface BottomSheetShapedExample : BottomSheetPresenterViewController @end diff --git a/components/BottomSheet/examples/BottomSheetTypicalUseExample.m b/components/BottomSheet/examples/BottomSheetTypicalUseExample.m index d926f965148..6bbba1d19e2 100644 --- a/components/BottomSheet/examples/BottomSheetTypicalUseExample.m +++ b/components/BottomSheet/examples/BottomSheetTypicalUseExample.m @@ -19,8 +19,13 @@ #import "MaterialAppBar.h" #import "MaterialAppBar+TypographyThemer.h" #import "BottomSheetPresenterViewController.h" +#import "MDCSheetState.h" #import "MaterialBottomSheet.h" #import "MaterialBottomSheet+ShapeThemer.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialColorScheme.h" +#import "MaterialShapeScheme.h" +#import "MaterialTypographyScheme.h" @interface BottomSheetTypicalUseExample : BottomSheetPresenterViewController @end diff --git a/components/FlexibleHeader/tests/unit/FlexibleHeaderHeightLegacySafeAreaBehaviorTests.m b/components/FlexibleHeader/tests/unit/FlexibleHeaderHeightLegacySafeAreaBehaviorTests.m index 74de2c2a27a..35f41d8e511 100644 --- a/components/FlexibleHeader/tests/unit/FlexibleHeaderHeightLegacySafeAreaBehaviorTests.m +++ b/components/FlexibleHeader/tests/unit/FlexibleHeaderHeightLegacySafeAreaBehaviorTests.m @@ -18,6 +18,7 @@ #import "MaterialFlexibleHeader.h" #import "supplemental/FlexibleHeaderTopSafeAreaTestsFakeTopSafeAreaDelegate.h" +#import "MDCFlexibleHeaderTopSafeArea.h" @interface MDCFlexibleHeaderView (UnitTestingPrivateAPIs) @property(nonatomic, strong) MDCFlexibleHeaderTopSafeArea *topSafeArea; diff --git a/components/FlexibleHeader/tests/unit/FlexibleHeaderHeightTests.m b/components/FlexibleHeader/tests/unit/FlexibleHeaderHeightTests.m index 67ba28fc7b9..33c11e1565b 100644 --- a/components/FlexibleHeader/tests/unit/FlexibleHeaderHeightTests.m +++ b/components/FlexibleHeader/tests/unit/FlexibleHeaderHeightTests.m @@ -18,6 +18,7 @@ #import "MaterialFlexibleHeader.h" #import "supplemental/FlexibleHeaderTopSafeAreaTestsFakeTopSafeAreaDelegate.h" +#import "MDCFlexibleHeaderTopSafeArea.h" @interface MDCFlexibleHeaderView (UnitTestingPrivateAPIs) @property(nonatomic, strong) MDCFlexibleHeaderTopSafeArea *topSafeArea; diff --git a/components/FlexibleHeader/tests/unit/FlexibleHeaderMinMaxHeightIncludesSafeAreaTests.m b/components/FlexibleHeader/tests/unit/FlexibleHeaderMinMaxHeightIncludesSafeAreaTests.m index 9194d8869c8..7b4572be52c 100644 --- a/components/FlexibleHeader/tests/unit/FlexibleHeaderMinMaxHeightIncludesSafeAreaTests.m +++ b/components/FlexibleHeader/tests/unit/FlexibleHeaderMinMaxHeightIncludesSafeAreaTests.m @@ -17,8 +17,8 @@ #import #import "../../src/private/MDCFlexibleHeaderMinMaxHeight.h" -#import "MaterialFlexibleHeader.h" #import "supplemental/FlexibleHeaderTopSafeAreaTestsFakeTopSafeAreaDelegate.h" +#import "MDCFlexibleHeaderTopSafeArea.h" @interface FlexibleHeaderMinMaxHeightIncludesSafeAreaTests : XCTestCase @end diff --git a/components/FlexibleHeader/tests/unit/FlexibleHeaderMinMaxHeightTests.m b/components/FlexibleHeader/tests/unit/FlexibleHeaderMinMaxHeightTests.m index 0d7145bb0a1..8aeab02e048 100644 --- a/components/FlexibleHeader/tests/unit/FlexibleHeaderMinMaxHeightTests.m +++ b/components/FlexibleHeader/tests/unit/FlexibleHeaderMinMaxHeightTests.m @@ -17,8 +17,8 @@ #import #import "../../src/private/MDCFlexibleHeaderMinMaxHeight.h" -#import "MaterialFlexibleHeader.h" #import "supplemental/FlexibleHeaderTopSafeAreaTestsFakeTopSafeAreaDelegate.h" +#import "MDCFlexibleHeaderTopSafeArea.h" @interface FlexibleHeaderMinMaxHeightTests : XCTestCase @end diff --git a/components/FlexibleHeader/tests/unit/FlexibleHeaderShifterTests.m b/components/FlexibleHeader/tests/unit/FlexibleHeaderShifterTests.m index cd0721a2a12..bedb4489502 100644 --- a/components/FlexibleHeader/tests/unit/FlexibleHeaderShifterTests.m +++ b/components/FlexibleHeader/tests/unit/FlexibleHeaderShifterTests.m @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#import "MDCFlexibleHeaderView+ShiftBehavior.h" #import "MDCFlexibleHeaderShifter.h" #import "MaterialFlexibleHeader+ShiftBehaviorEnabledWithStatusBar.h" diff --git a/components/FlexibleHeader/tests/unit/FlexibleHeaderTopSafeAreaTests.m b/components/FlexibleHeader/tests/unit/FlexibleHeaderTopSafeAreaTests.m index 89735aa37f0..74fb4599e12 100644 --- a/components/FlexibleHeader/tests/unit/FlexibleHeaderTopSafeAreaTests.m +++ b/components/FlexibleHeader/tests/unit/FlexibleHeaderTopSafeAreaTests.m @@ -16,10 +16,10 @@ #import -#import "MaterialFlexibleHeader.h" #import "supplemental/FlexibleHeaderTopSafeAreaTestsFakeTopSafeAreaDelegate.h" #import "supplemental/FlexibleHeaderTopSafeAreaTestsFakeViewController.h" +#import "MDCFlexibleHeaderTopSafeArea.h" @interface FlexibleHeaderTopSafeAreaTests : XCTestCase @end diff --git a/components/NavigationBar/examples/NavigationBarIconsExample.m b/components/NavigationBar/examples/NavigationBarIconsExample.m index 9bc223343f9..012a7922dfa 100644 --- a/components/NavigationBar/examples/NavigationBarIconsExample.m +++ b/components/NavigationBar/examples/NavigationBarIconsExample.m @@ -13,6 +13,8 @@ // limitations under the License. #import +#import "MaterialColorScheme.h" +#import "MaterialTypographyScheme.h" #import #import "MaterialIcons+ic_arrow_back.h" diff --git a/components/NavigationBar/examples/NavigationBarLayoutExample.m b/components/NavigationBar/examples/NavigationBarLayoutExample.m index 04d5350c832..2df99dfe6db 100644 --- a/components/NavigationBar/examples/NavigationBarLayoutExample.m +++ b/components/NavigationBar/examples/NavigationBarLayoutExample.m @@ -12,11 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import -#import "MaterialIcons+ic_arrow_back.h" #import "MaterialNavigationBar+ColorThemer.h" #import "MaterialNavigationBar.h" #import "MaterialTextFields.h" +#import "MaterialColorScheme.h" @interface NavigationBarLayoutExample : UIViewController diff --git a/components/NavigationBar/examples/NavigationBarRTLIcons.m b/components/NavigationBar/examples/NavigationBarRTLIcons.m index c74f2ae82b5..9880149efc8 100644 --- a/components/NavigationBar/examples/NavigationBarRTLIcons.m +++ b/components/NavigationBar/examples/NavigationBarRTLIcons.m @@ -13,15 +13,12 @@ // limitations under the License. #import -#import #import "MaterialIcons+ic_arrow_back.h" #import "MaterialIcons+ic_check_circle.h" #import "MaterialIcons+ic_info.h" #import "MaterialIcons+ic_reorder.h" -#import "MaterialNavigationBar+ColorThemer.h" #import "MaterialNavigationBar.h" -#import "supplemental/NavigationBarTypicalUseExampleSupplemental.h" @interface NavigationBarRTL : UIViewController diff --git a/components/NavigationBar/examples/NavigationBarTypicalUseExample.m b/components/NavigationBar/examples/NavigationBarTypicalUseExample.m index f668270ed6e..a93e247a9b3 100644 --- a/components/NavigationBar/examples/NavigationBarTypicalUseExample.m +++ b/components/NavigationBar/examples/NavigationBarTypicalUseExample.m @@ -14,9 +14,10 @@ #import +#import "supplemental/NavigationBarTypicalUseExampleSupplemental.h" #import "MaterialNavigationBar+ColorThemer.h" #import "MaterialNavigationBar.h" -#import "supplemental/NavigationBarTypicalUseExampleSupplemental.h" +#import "MaterialColorScheme.h" @interface NavigationBarTypicalUseExample () diff --git a/components/NavigationBar/examples/NavigationBarWithBarItemsExample.m b/components/NavigationBar/examples/NavigationBarWithBarItemsExample.m index e0b61982bfc..de5f0aab4e7 100644 --- a/components/NavigationBar/examples/NavigationBarWithBarItemsExample.m +++ b/components/NavigationBar/examples/NavigationBarWithBarItemsExample.m @@ -14,9 +14,10 @@ #import +#import "supplemental/NavigationBarTypicalUseExampleSupplemental.h" #import "MaterialNavigationBar+ColorThemer.h" #import "MaterialNavigationBar.h" -#import "supplemental/NavigationBarTypicalUseExampleSupplemental.h" +#import "MaterialColorScheme.h" @implementation NavigationBarWithBarItemsExample diff --git a/components/NavigationBar/examples/NavigationbarWithCustomFont.m b/components/NavigationBar/examples/NavigationbarWithCustomFont.m index e4e84b6e857..46e2ab6ab9b 100644 --- a/components/NavigationBar/examples/NavigationbarWithCustomFont.m +++ b/components/NavigationBar/examples/NavigationbarWithCustomFont.m @@ -14,9 +14,10 @@ #import +#import "supplemental/NavigationBarTypicalUseExampleSupplemental.h" #import "MaterialNavigationBar+ColorThemer.h" #import "MaterialNavigationBar.h" -#import "supplemental/NavigationBarTypicalUseExampleSupplemental.h" +#import "MaterialColorScheme.h" @implementation NavigationBarWithCustomFontExample From 1437067081c38031d16e80f08437d4667543bce0 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Wed, 10 Feb 2021 16:14:01 -0800 Subject: [PATCH 12/24] Optimizing imports PiperOrigin-RevId: 356851164 --- components/AppBar/examples/AppBarImageryExample.m | 3 +++ .../examples/AppBarInterfaceBuilderExampleController.m | 2 ++ components/AppBar/examples/AppBarModalPresentationExample.m | 2 ++ components/AppBar/examples/AppBarPresentedExample.m | 2 -- components/AppBar/examples/AppBarPresentedHiddenExample.m | 2 +- components/AppBar/examples/AppBarSectionHeadersExample.m | 2 ++ .../AppBar/examples/AppBarTypicalCollectionViewExample.m | 5 ++++- components/AppBar/examples/AppBarTypicalUseExample.m | 6 +++++- .../AppBar/examples/AppBarWKWebViewLargeContentExample.m | 6 +++++- .../examples/AppBarWKWebViewLargeContentNoBugExample.m | 6 +++++- .../AppBar/examples/AppBarWKWebViewSmallContentBugExample.m | 6 +++++- .../AppBar/examples/AppBarWKWebViewSmallContentExample.m | 6 +++++- components/AppBar/examples/AppBarWrappedExample.m | 5 ++++- .../examples/AppBarWrappingUITableViewControllerExample.m | 5 ++++- 14 files changed, 47 insertions(+), 11 deletions(-) diff --git a/components/AppBar/examples/AppBarImageryExample.m b/components/AppBar/examples/AppBarImageryExample.m index 533de3fae26..95fabfb6f8c 100644 --- a/components/AppBar/examples/AppBarImageryExample.m +++ b/components/AppBar/examples/AppBarImageryExample.m @@ -16,6 +16,9 @@ #import "MaterialAppBar+ColorThemer.h" #import "MaterialAppBar.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialNavigationBar.h" +#import "MaterialColorScheme.h" @interface AppBarImageryExample : UITableViewController @property(nonatomic, strong) MDCAppBarViewController *appBarViewController; diff --git a/components/AppBar/examples/AppBarInterfaceBuilderExampleController.m b/components/AppBar/examples/AppBarInterfaceBuilderExampleController.m index f039635b2a0..b7dfa5780e4 100644 --- a/components/AppBar/examples/AppBarInterfaceBuilderExampleController.m +++ b/components/AppBar/examples/AppBarInterfaceBuilderExampleController.m @@ -16,6 +16,8 @@ #import "MaterialAppBar+ColorThemer.h" #import "MaterialAppBar.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialColorScheme.h" @interface AppBarInterfaceBuilderExample : UIViewController diff --git a/components/AppBar/examples/AppBarModalPresentationExample.m b/components/AppBar/examples/AppBarModalPresentationExample.m index 91c98aa14f9..06f7422ac76 100644 --- a/components/AppBar/examples/AppBarModalPresentationExample.m +++ b/components/AppBar/examples/AppBarModalPresentationExample.m @@ -16,6 +16,8 @@ #import "MaterialAppBar+ColorThemer.h" #import "MaterialAppBar.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialColorScheme.h" @interface AppBarModalPresentationExamplePresented : UITableViewController @property(strong, nonatomic) MDCAppBarViewController *appBarViewController; diff --git a/components/AppBar/examples/AppBarPresentedExample.m b/components/AppBar/examples/AppBarPresentedExample.m index 9de828f200d..4c65a5efb18 100644 --- a/components/AppBar/examples/AppBarPresentedExample.m +++ b/components/AppBar/examples/AppBarPresentedExample.m @@ -15,8 +15,6 @@ #import #import "AppBarSampleViewController.h" -#import "MaterialAppBar.h" -#import "MaterialAppBar+Theming.h" #import "MaterialButtons.h" #import "MaterialButtons+Theming.h" #import "MaterialContainerScheme.h" diff --git a/components/AppBar/examples/AppBarPresentedHiddenExample.m b/components/AppBar/examples/AppBarPresentedHiddenExample.m index 6b42fc311eb..4dc8f9eea6c 100644 --- a/components/AppBar/examples/AppBarPresentedHiddenExample.m +++ b/components/AppBar/examples/AppBarPresentedHiddenExample.m @@ -16,10 +16,10 @@ #import "AppBarSampleViewController.h" #import "MaterialAppBar.h" -#import "MaterialAppBar+Theming.h" #import "MaterialAvailability.h" #import "MaterialButtons.h" #import "MaterialButtons+Theming.h" +#import "MaterialFlexibleHeader.h" #import "MaterialContainerScheme.h" // This example demonstrates a view controller being presented with the AppBar initially hidden. diff --git a/components/AppBar/examples/AppBarSectionHeadersExample.m b/components/AppBar/examples/AppBarSectionHeadersExample.m index 4168b6a586d..aa13890c6a8 100644 --- a/components/AppBar/examples/AppBarSectionHeadersExample.m +++ b/components/AppBar/examples/AppBarSectionHeadersExample.m @@ -16,6 +16,8 @@ #import "MaterialAppBar+ColorThemer.h" #import "MaterialAppBar.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialColorScheme.h" @interface AppBarSectionHeadersExample : UITableViewController diff --git a/components/AppBar/examples/AppBarTypicalCollectionViewExample.m b/components/AppBar/examples/AppBarTypicalCollectionViewExample.m index a5a1bbabbbb..92ee035b993 100644 --- a/components/AppBar/examples/AppBarTypicalCollectionViewExample.m +++ b/components/AppBar/examples/AppBarTypicalCollectionViewExample.m @@ -15,8 +15,11 @@ #import #import "MaterialAppBar+ColorThemer.h" -#import "MaterialAppBar+TypographyThemer.h" #import "MaterialAppBar.h" +#import "MaterialAppBar+TypographyThemer.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialColorScheme.h" +#import "MaterialTypographyScheme.h" @interface AppBarTypicalCollectionViewExample : UICollectionViewController diff --git a/components/AppBar/examples/AppBarTypicalUseExample.m b/components/AppBar/examples/AppBarTypicalUseExample.m index 102f0b850ec..a4d806d35ab 100644 --- a/components/AppBar/examples/AppBarTypicalUseExample.m +++ b/components/AppBar/examples/AppBarTypicalUseExample.m @@ -15,8 +15,12 @@ #import #import "MaterialAppBar+ColorThemer.h" -#import "MaterialAppBar+TypographyThemer.h" #import "MaterialAppBar.h" +#import "MaterialAppBar+TypographyThemer.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialNavigationBar.h" +#import "MaterialColorScheme.h" +#import "MaterialTypographyScheme.h" @interface AppBarTypicalUseExample : UITableViewController diff --git a/components/AppBar/examples/AppBarWKWebViewLargeContentExample.m b/components/AppBar/examples/AppBarWKWebViewLargeContentExample.m index 200014f6c6d..022fbcf4692 100644 --- a/components/AppBar/examples/AppBarWKWebViewLargeContentExample.m +++ b/components/AppBar/examples/AppBarWKWebViewLargeContentExample.m @@ -16,8 +16,12 @@ #import #import "MaterialAppBar+ColorThemer.h" -#import "MaterialAppBar+TypographyThemer.h" #import "MaterialAppBar.h" +#import "MaterialAppBar+TypographyThemer.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialNavigationBar.h" +#import "MaterialColorScheme.h" +#import "MaterialTypographyScheme.h" // This demonstrates that a WKWebView with large content as the tracking scroll view is able to // scroll as expected, even with the useAdditionalSafeAreaInsetsForWebKitScrollViews flag enabled. diff --git a/components/AppBar/examples/AppBarWKWebViewLargeContentNoBugExample.m b/components/AppBar/examples/AppBarWKWebViewLargeContentNoBugExample.m index 4e4497998f8..207a4328045 100644 --- a/components/AppBar/examples/AppBarWKWebViewLargeContentNoBugExample.m +++ b/components/AppBar/examples/AppBarWKWebViewLargeContentNoBugExample.m @@ -16,8 +16,12 @@ #import #import "MaterialAppBar+ColorThemer.h" -#import "MaterialAppBar+TypographyThemer.h" #import "MaterialAppBar.h" +#import "MaterialAppBar+TypographyThemer.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialNavigationBar.h" +#import "MaterialColorScheme.h" +#import "MaterialTypographyScheme.h" // This demonstrates that a WKWebView with large content as the tracking scroll view is able to // scroll as expected, even without the useAdditionalSafeAreaInsetsForWebKitScrollViews flag diff --git a/components/AppBar/examples/AppBarWKWebViewSmallContentBugExample.m b/components/AppBar/examples/AppBarWKWebViewSmallContentBugExample.m index 8fc0fe79528..7f8718ea38c 100644 --- a/components/AppBar/examples/AppBarWKWebViewSmallContentBugExample.m +++ b/components/AppBar/examples/AppBarWKWebViewSmallContentBugExample.m @@ -16,8 +16,12 @@ #import #import "MaterialAppBar+ColorThemer.h" -#import "MaterialAppBar+TypographyThemer.h" #import "MaterialAppBar.h" +#import "MaterialAppBar+TypographyThemer.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialNavigationBar.h" +#import "MaterialColorScheme.h" +#import "MaterialTypographyScheme.h" // This demonstrates a bug when WKWebView's scroll view is the tracking scroll view and the web // view's content is smaller than the screen. Note that the content is scrollable because the diff --git a/components/AppBar/examples/AppBarWKWebViewSmallContentExample.m b/components/AppBar/examples/AppBarWKWebViewSmallContentExample.m index 74a83106c72..1fedc068218 100644 --- a/components/AppBar/examples/AppBarWKWebViewSmallContentExample.m +++ b/components/AppBar/examples/AppBarWKWebViewSmallContentExample.m @@ -16,8 +16,12 @@ #import #import "MaterialAppBar+ColorThemer.h" -#import "MaterialAppBar+TypographyThemer.h" #import "MaterialAppBar.h" +#import "MaterialAppBar+TypographyThemer.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialNavigationBar.h" +#import "MaterialColorScheme.h" +#import "MaterialTypographyScheme.h" // This demonstrates that a WKWebView with minimal content as the tracking scroll view is not able // to scroll as expected. This requires enabling useAdditionalSafeAreaInsetsForWebKitScrollViews diff --git a/components/AppBar/examples/AppBarWrappedExample.m b/components/AppBar/examples/AppBarWrappedExample.m index 11efee12a86..b61ddc14aa6 100644 --- a/components/AppBar/examples/AppBarWrappedExample.m +++ b/components/AppBar/examples/AppBarWrappedExample.m @@ -15,8 +15,11 @@ #import #import "MaterialAppBar+ColorThemer.h" -#import "MaterialAppBar+TypographyThemer.h" #import "MaterialAppBar.h" +#import "MaterialAppBar+TypographyThemer.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialColorScheme.h" +#import "MaterialTypographyScheme.h" @interface WrappedDemoViewController : UIViewController @end diff --git a/components/AppBar/examples/AppBarWrappingUITableViewControllerExample.m b/components/AppBar/examples/AppBarWrappingUITableViewControllerExample.m index 397bd5d472d..86af0338c0c 100644 --- a/components/AppBar/examples/AppBarWrappingUITableViewControllerExample.m +++ b/components/AppBar/examples/AppBarWrappingUITableViewControllerExample.m @@ -15,8 +15,11 @@ #import #import "MaterialAppBar+ColorThemer.h" -#import "MaterialAppBar+TypographyThemer.h" #import "MaterialAppBar.h" +#import "MaterialAppBar+TypographyThemer.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialColorScheme.h" +#import "MaterialTypographyScheme.h" @interface AppBarWrappingUITableViewControllerExample : UIViewController From 6171ea2840fb0901a49c0a886c54bf048ff0e8f4 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Wed, 10 Feb 2021 16:27:54 -0800 Subject: [PATCH 13/24] Optimizing imports PiperOrigin-RevId: 356854140 --- components/Collections/examples/CollectionsALaCarteExample.m | 2 +- .../examples/CollectionsAppearanceAnimationExample.m | 2 +- .../Collections/examples/CollectionsCellAccessoryExample.m | 1 + components/Collections/examples/CollectionsCellColorExample.m | 1 + .../Collections/examples/CollectionsCellSeparatorExample.m | 1 + components/Collections/examples/CollectionsEditingExample.m | 1 + .../Collections/examples/CollectionsEditingManyCellsExample.m | 1 + components/Collections/examples/CollectionsEmptySections.m | 1 - components/Collections/examples/CollectionsGridExample.m | 1 + .../Collections/examples/CollectionsHeaderFooterExample.m | 2 +- components/Collections/examples/CollectionsInkExample.m | 1 + components/Collections/examples/CollectionsInlayExample.m | 1 + .../Collections/examples/CollectionsSectionInsetsExample.m | 1 + components/Collections/examples/CollectionsSimpleDemo.m | 2 +- components/Collections/examples/CollectionsStoryboardExample.m | 1 + .../Collections/examples/CollectionsSwipeToDismissRowExample.m | 1 + .../examples/CollectionsSwipeToDismissSectionExample.m | 1 + 17 files changed, 16 insertions(+), 5 deletions(-) diff --git a/components/Collections/examples/CollectionsALaCarteExample.m b/components/Collections/examples/CollectionsALaCarteExample.m index 71ce921429f..7333944ef42 100644 --- a/components/Collections/examples/CollectionsALaCarteExample.m +++ b/components/Collections/examples/CollectionsALaCarteExample.m @@ -13,7 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsALaCarteExample.h" -#import "MaterialTypography.h" +#import "MaterialCollections.h" static const NSInteger kSectionCount = 10; static const NSInteger kSectionItemCount = 5; diff --git a/components/Collections/examples/CollectionsAppearanceAnimationExample.m b/components/Collections/examples/CollectionsAppearanceAnimationExample.m index ea8589cc294..2fee18fe357 100644 --- a/components/Collections/examples/CollectionsAppearanceAnimationExample.m +++ b/components/Collections/examples/CollectionsAppearanceAnimationExample.m @@ -13,7 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsAppearanceAnimationExample.h" -#import "MaterialTypography.h" +#import "MaterialCollections.h" static const NSInteger kSectionCount = 10; static const NSInteger kSectionItemCount = 5; diff --git a/components/Collections/examples/CollectionsCellAccessoryExample.m b/components/Collections/examples/CollectionsCellAccessoryExample.m index ed369d2fdb0..3c30edce962 100644 --- a/components/Collections/examples/CollectionsCellAccessoryExample.m +++ b/components/Collections/examples/CollectionsCellAccessoryExample.m @@ -13,6 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsCellAccessoryExample.h" +#import "MaterialCollections.h" static NSString *const kReusableIdentifierItem = @"itemCellIdentifier"; diff --git a/components/Collections/examples/CollectionsCellColorExample.m b/components/Collections/examples/CollectionsCellColorExample.m index 75e6a74f29f..422659a2271 100644 --- a/components/Collections/examples/CollectionsCellColorExample.m +++ b/components/Collections/examples/CollectionsCellColorExample.m @@ -15,6 +15,7 @@ #import "supplemental/CollectionsCellColorExample.h" #import "MaterialAvailability.h" +#import "MaterialCollections.h" static NSString *const kReusableIdentifierItem = @"itemCellIdentifier"; diff --git a/components/Collections/examples/CollectionsCellSeparatorExample.m b/components/Collections/examples/CollectionsCellSeparatorExample.m index 28710bd2e79..90a05bc117f 100644 --- a/components/Collections/examples/CollectionsCellSeparatorExample.m +++ b/components/Collections/examples/CollectionsCellSeparatorExample.m @@ -13,6 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsCellSeparatorExample.h" +#import "MaterialCollections.h" static const NSInteger kSectionCount = 10; static const NSInteger kSectionItemCount = 3; diff --git a/components/Collections/examples/CollectionsEditingExample.m b/components/Collections/examples/CollectionsEditingExample.m index c8bfa7e18ee..487981a994e 100644 --- a/components/Collections/examples/CollectionsEditingExample.m +++ b/components/Collections/examples/CollectionsEditingExample.m @@ -13,6 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsEditingExample.h" +#import "MaterialCollections.h" static const NSInteger kSectionCount = 10; static const NSInteger kSectionItemCount = 5; diff --git a/components/Collections/examples/CollectionsEditingManyCellsExample.m b/components/Collections/examples/CollectionsEditingManyCellsExample.m index b6101d83809..96490c29599 100644 --- a/components/Collections/examples/CollectionsEditingManyCellsExample.m +++ b/components/Collections/examples/CollectionsEditingManyCellsExample.m @@ -13,6 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsEditingManyCellsExampleSupplemental.h" +#import "MaterialCollections.h" static const NSInteger kSectionCount = 25; static const NSInteger kSectionItemCount = 50; diff --git a/components/Collections/examples/CollectionsEmptySections.m b/components/Collections/examples/CollectionsEmptySections.m index 5a6ee214d03..e0fc3050787 100644 --- a/components/Collections/examples/CollectionsEmptySections.m +++ b/components/Collections/examples/CollectionsEmptySections.m @@ -13,7 +13,6 @@ // limitations under the License. #import "MaterialCollections.h" -#import "MaterialTypography.h" static const NSInteger kSectionCount = 3; static const NSInteger kSectionItemCount = 0; diff --git a/components/Collections/examples/CollectionsGridExample.m b/components/Collections/examples/CollectionsGridExample.m index 9bb5f895640..6d666911cf9 100644 --- a/components/Collections/examples/CollectionsGridExample.m +++ b/components/Collections/examples/CollectionsGridExample.m @@ -13,6 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsGridExample.h" +#import "MaterialCollections.h" static const NSInteger kSectionCount = 10; static const NSInteger kSectionItemCount = 4; diff --git a/components/Collections/examples/CollectionsHeaderFooterExample.m b/components/Collections/examples/CollectionsHeaderFooterExample.m index bf4522eedca..1e50db69a23 100644 --- a/components/Collections/examples/CollectionsHeaderFooterExample.m +++ b/components/Collections/examples/CollectionsHeaderFooterExample.m @@ -13,7 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsHeaderFooterExample.h" -#import "MaterialTypography.h" +#import "MaterialCollections.h" static const NSInteger kSectionCount = 3; static const NSInteger kSectionItemCount = 2; diff --git a/components/Collections/examples/CollectionsInkExample.m b/components/Collections/examples/CollectionsInkExample.m index 71058466065..7c37b32df01 100644 --- a/components/Collections/examples/CollectionsInkExample.m +++ b/components/Collections/examples/CollectionsInkExample.m @@ -13,6 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsInkExample.h" +#import "MaterialCollections.h" #import "MaterialPalettes.h" static NSString *const kReusableIdentifierItem = @"itemCellIdentifier"; diff --git a/components/Collections/examples/CollectionsInlayExample.m b/components/Collections/examples/CollectionsInlayExample.m index 0f1c8bf1349..d69d7582b4f 100644 --- a/components/Collections/examples/CollectionsInlayExample.m +++ b/components/Collections/examples/CollectionsInlayExample.m @@ -13,6 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsInlayExample.h" +#import "MaterialCollections.h" static NSString *const kReusableIdentifierItem = @"itemCellIdentifier"; diff --git a/components/Collections/examples/CollectionsSectionInsetsExample.m b/components/Collections/examples/CollectionsSectionInsetsExample.m index 380c234a6a1..58b59e0aece 100644 --- a/components/Collections/examples/CollectionsSectionInsetsExample.m +++ b/components/Collections/examples/CollectionsSectionInsetsExample.m @@ -13,6 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsSectionInsetsExampleSupplemental.h" +#import "MaterialCollections.h" @implementation CollectionsSectionInsetsExample diff --git a/components/Collections/examples/CollectionsSimpleDemo.m b/components/Collections/examples/CollectionsSimpleDemo.m index 6f02b119741..771c9fe9ec0 100644 --- a/components/Collections/examples/CollectionsSimpleDemo.m +++ b/components/Collections/examples/CollectionsSimpleDemo.m @@ -13,7 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsSimpleDemo.h" -#import "MaterialTypography.h" +#import "MaterialCollections.h" static const NSInteger kSectionCount = 10; static const NSInteger kSectionItemCount = 5; diff --git a/components/Collections/examples/CollectionsStoryboardExample.m b/components/Collections/examples/CollectionsStoryboardExample.m index b5a82877a4a..ae89cf49a2a 100644 --- a/components/Collections/examples/CollectionsStoryboardExample.m +++ b/components/Collections/examples/CollectionsStoryboardExample.m @@ -13,6 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsStoryboardExample.h" +#import "MaterialCollections.h" static const NSInteger kSectionCount = 10; static const NSInteger kSectionItemCount = 5; diff --git a/components/Collections/examples/CollectionsSwipeToDismissRowExample.m b/components/Collections/examples/CollectionsSwipeToDismissRowExample.m index 16aa580f1fa..8254e907b17 100644 --- a/components/Collections/examples/CollectionsSwipeToDismissRowExample.m +++ b/components/Collections/examples/CollectionsSwipeToDismissRowExample.m @@ -13,6 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsSwipeToDismissRowExample.h" +#import "MaterialCollections.h" static const NSInteger kSectionCount = 10; static const NSInteger kSectionItemCount = 5; diff --git a/components/Collections/examples/CollectionsSwipeToDismissSectionExample.m b/components/Collections/examples/CollectionsSwipeToDismissSectionExample.m index 3d045c2af0c..8e6e140c6ca 100644 --- a/components/Collections/examples/CollectionsSwipeToDismissSectionExample.m +++ b/components/Collections/examples/CollectionsSwipeToDismissSectionExample.m @@ -13,6 +13,7 @@ // limitations under the License. #import "supplemental/CollectionsSwipeToDismissSectionExample.h" +#import "MaterialCollections.h" static const NSInteger kSectionCount = 10; static const NSInteger kSectionItemCount = 5; From 63988b35da1fa5281b4260abd8a075817b19d155 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Thu, 11 Feb 2021 07:07:03 -0800 Subject: [PATCH 14/24] Optimizing imports PiperOrigin-RevId: 356966165 --- catalog/MaterialCatalog/MDCCatalogTiles.m | 2 +- .../AppBar/src/MDCAppBarContainerViewController.m | 1 + .../AppBar/src/MDCAppBarNavigationController.m | 2 ++ components/AppBar/src/MDCAppBarViewController.m | 7 +++---- .../examples/ButtonBarCustomizedFontExample.m | 2 ++ .../ButtonBar/examples/ButtonBarMenuExample.m | 2 ++ .../examples/ButtonBarTypicalUseExample.m | 2 ++ .../Buttons/src/ButtonThemer/MDCButtonScheme.m | 6 ++++++ .../src/ButtonThemer/MDCContainedButtonThemer.m | 2 ++ .../Buttons/src/ButtonThemer/MDCTextButtonThemer.m | 2 ++ components/Cards/src/MDCCard.m | 7 ++++++- components/Cards/src/MDCCardCollectionCell.m | 7 ++++++- .../UICollectionViewController+MDCCardReordering.m | 2 -- .../examples/TextFieldControllerStylesExample.m | 2 ++ .../TextFields/examples/TextFieldOutlinedExample.m | 4 +++- components/Typography/src/MDCFontScaler.m | 1 - .../Typography/src/UIFont+MaterialScalable.m | 1 - .../examples/MDCShapeSchemeExampleViewController.m | 14 +++++++------- .../Shape/examples/MDCShapeWithBorderExample.m | 1 - components/schemes/Shape/src/MDCShapeCategory.m | 1 + components/schemes/Shape/src/MDCShapeScheme.m | 2 ++ 21 files changed, 50 insertions(+), 20 deletions(-) diff --git a/catalog/MaterialCatalog/MDCCatalogTiles.m b/catalog/MaterialCatalog/MDCCatalogTiles.m index 56aa30dc549..b6e56d8436e 100644 --- a/catalog/MaterialCatalog/MDCCatalogTiles.m +++ b/catalog/MaterialCatalog/MDCCatalogTiles.m @@ -15,7 +15,7 @@ #import #import "MDCCatalogTiles.h" -#import "MaterialThemes.h" +#import "MaterialColorScheme.h" UIImage* _Nullable MDCDrawImage(CGRect frame, MDCDrawFunc drawFunc, diff --git a/components/AppBar/src/MDCAppBarContainerViewController.m b/components/AppBar/src/MDCAppBarContainerViewController.m index 7db9bf4a994..5e169b9191b 100644 --- a/components/AppBar/src/MDCAppBarContainerViewController.m +++ b/components/AppBar/src/MDCAppBarContainerViewController.m @@ -16,6 +16,7 @@ #import "MDCAppBarViewController.h" #import "MaterialFlexibleHeader.h" +#import "MaterialNavigationBar.h" @interface MDCAppBarContainerViewController () diff --git a/components/AppBar/src/MDCAppBarNavigationController.m b/components/AppBar/src/MDCAppBarNavigationController.m index 9e23a5c19e7..60887ff7d76 100644 --- a/components/AppBar/src/MDCAppBarNavigationController.m +++ b/components/AppBar/src/MDCAppBarNavigationController.m @@ -16,6 +16,8 @@ #import "MDCAppBarNavigationControllerToBeDeprecatedDelegate.h" #import "MDCAppBarViewController.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialHeaderStackView.h" #import diff --git a/components/AppBar/src/MDCAppBarViewController.m b/components/AppBar/src/MDCAppBarViewController.m index 6777024b456..c843c79672b 100644 --- a/components/AppBar/src/MDCAppBarViewController.m +++ b/components/AppBar/src/MDCAppBarViewController.m @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "MDCAppBar.h" +#import "MDCAppBarViewController.h" #import "MDCAppBarContainerViewController.h" @@ -20,14 +20,13 @@ #import "private/MaterialAppBarStrings_table.h" #import "MDCAppBarViewControllerAccessibilityPerformEscapeDelegate.h" #import "MaterialFlexibleHeader.h" +#import "MaterialHeaderStackView.h" +#import "MaterialNavigationBar.h" #import "MaterialShadowElevations.h" #import "MaterialShadowLayer.h" -#import "MaterialTypography.h" -#import "MaterialApplication.h" #import "MaterialIcons+ic_arrow_back.h" #import "MaterialUIMetrics.h" #import -#import static NSString *const kBarStackKey = @"barStack"; diff --git a/components/ButtonBar/examples/ButtonBarCustomizedFontExample.m b/components/ButtonBar/examples/ButtonBarCustomizedFontExample.m index 4efde4f633d..1849b111fc4 100644 --- a/components/ButtonBar/examples/ButtonBarCustomizedFontExample.m +++ b/components/ButtonBar/examples/ButtonBarCustomizedFontExample.m @@ -15,7 +15,9 @@ #import #import "MaterialButtonBar.h" +#import "MaterialColorScheme.h" #import "MaterialContainerScheme.h" +#import "MaterialTypographyScheme.h" @interface ButtonBarCustomizedFontExample : UIViewController @property(nonatomic, strong) MDCSemanticColorScheme *colorScheme; diff --git a/components/ButtonBar/examples/ButtonBarMenuExample.m b/components/ButtonBar/examples/ButtonBarMenuExample.m index e9621a04ad9..c7b44ecfdb1 100644 --- a/components/ButtonBar/examples/ButtonBarMenuExample.m +++ b/components/ButtonBar/examples/ButtonBarMenuExample.m @@ -16,7 +16,9 @@ #import "MaterialAvailability.h" #import "MaterialButtonBar.h" +#import "MaterialColorScheme.h" #import "MaterialContainerScheme.h" +#import "MaterialTypographyScheme.h" @interface ButtonBarMenuExample : UIViewController @property(nonatomic, strong) MDCSemanticColorScheme *colorScheme; diff --git a/components/ButtonBar/examples/ButtonBarTypicalUseExample.m b/components/ButtonBar/examples/ButtonBarTypicalUseExample.m index ca0607150af..d76d572f1d9 100644 --- a/components/ButtonBar/examples/ButtonBarTypicalUseExample.m +++ b/components/ButtonBar/examples/ButtonBarTypicalUseExample.m @@ -15,7 +15,9 @@ #import #import "MaterialButtonBar.h" +#import "MaterialColorScheme.h" #import "MaterialContainerScheme.h" +#import "MaterialTypographyScheme.h" @interface ButtonBarTypicalUseExample : UIViewController @property(nonatomic, strong) MDCSemanticColorScheme *colorScheme; diff --git a/components/Buttons/src/ButtonThemer/MDCButtonScheme.m b/components/Buttons/src/ButtonThemer/MDCButtonScheme.m index 2a17af1b8ff..55f162cc614 100644 --- a/components/Buttons/src/ButtonThemer/MDCButtonScheme.m +++ b/components/Buttons/src/ButtonThemer/MDCButtonScheme.m @@ -14,6 +14,12 @@ #import "MDCButtonScheme.h" +#import "MaterialColorScheme.h" + +#import "MaterialShapeScheme.h" + +#import "MaterialTypographyScheme.h" + @implementation MDCButtonScheme - (instancetype)init { diff --git a/components/Buttons/src/ButtonThemer/MDCContainedButtonThemer.m b/components/Buttons/src/ButtonThemer/MDCContainedButtonThemer.m index cd56da37482..80f300886b3 100644 --- a/components/Buttons/src/ButtonThemer/MDCContainedButtonThemer.m +++ b/components/Buttons/src/ButtonThemer/MDCContainedButtonThemer.m @@ -14,7 +14,9 @@ #import "MDCContainedButtonThemer.h" +#import "MDCButtonScheme.h" #import "MaterialButtons+ColorThemer.h" +#import "MaterialButtons.h" #import "MaterialButtons+ShapeThemer.h" #import "MaterialButtons+TypographyThemer.h" diff --git a/components/Buttons/src/ButtonThemer/MDCTextButtonThemer.m b/components/Buttons/src/ButtonThemer/MDCTextButtonThemer.m index 919c95b0833..cafa4dd4046 100644 --- a/components/Buttons/src/ButtonThemer/MDCTextButtonThemer.m +++ b/components/Buttons/src/ButtonThemer/MDCTextButtonThemer.m @@ -14,7 +14,9 @@ #import "MDCTextButtonThemer.h" +#import "MDCButtonScheme.h" #import "MaterialButtons+ColorThemer.h" +#import "MaterialButtons.h" #import "MaterialButtons+ShapeThemer.h" #import "MaterialButtons+TypographyThemer.h" diff --git a/components/Cards/src/MDCCard.m b/components/Cards/src/MDCCard.m index 3e88556a5fa..6c48571da5b 100644 --- a/components/Cards/src/MDCCard.m +++ b/components/Cards/src/MDCCard.m @@ -14,8 +14,13 @@ #import "MDCCard.h" -#import "MaterialMath.h" +#import "MaterialElevation.h" +#import "MaterialInk.h" +#import "MaterialRipple.h" +#import "MaterialShadowElevations.h" +#import "MaterialShadowLayer.h" #import "MaterialShapes.h" +#import "MaterialMath.h" static const CGFloat MDCCardShadowElevationNormal = 1; static const CGFloat MDCCardShadowElevationHighlighted = 8; diff --git a/components/Cards/src/MDCCardCollectionCell.m b/components/Cards/src/MDCCardCollectionCell.m index 82f2b863e57..baffd348f41 100644 --- a/components/Cards/src/MDCCardCollectionCell.m +++ b/components/Cards/src/MDCCardCollectionCell.m @@ -14,9 +14,14 @@ #import "MDCCardCollectionCell.h" +#import "MaterialElevation.h" +#import "MaterialInk.h" +#import "MaterialRipple.h" +#import "MaterialShadowElevations.h" +#import "MaterialShadowLayer.h" +#import "MaterialShapes.h" #import "MaterialIcons+ic_check_circle.h" #import "MaterialMath.h" -#import "MaterialShapes.h" static const CGFloat MDCCardCellCornerRadiusDefault = 4; static const CGFloat MDCCardCellSelectedImagePadding = 8; diff --git a/components/Cards/src/UICollectionViewController+MDCCardReordering.m b/components/Cards/src/UICollectionViewController+MDCCardReordering.m index 8359e2ea8b4..948e1224b0e 100644 --- a/components/Cards/src/UICollectionViewController+MDCCardReordering.m +++ b/components/Cards/src/UICollectionViewController+MDCCardReordering.m @@ -14,8 +14,6 @@ #import "UICollectionViewController+MDCCardReordering.h" -#import "MDCCardCollectionCell.h" -#import "MaterialInk.h" @implementation UICollectionViewController (MDCCardReordering) diff --git a/components/TextFields/examples/TextFieldControllerStylesExample.m b/components/TextFields/examples/TextFieldControllerStylesExample.m index e2d737ca6bd..47e3b827ac7 100644 --- a/components/TextFields/examples/TextFieldControllerStylesExample.m +++ b/components/TextFields/examples/TextFieldControllerStylesExample.m @@ -18,6 +18,8 @@ #import "MaterialTextFields.h" #import "supplemental/TextFieldControllerStylesExampleSupplemental.h" +#import "MaterialColorScheme.h" +#import "MaterialContainerScheme.h" @interface TextFieldControllerStylesExample () diff --git a/components/TextFields/examples/TextFieldOutlinedExample.m b/components/TextFields/examples/TextFieldOutlinedExample.m index 986f194c19a..a3d9faf03c2 100644 --- a/components/TextFields/examples/TextFieldOutlinedExample.m +++ b/components/TextFields/examples/TextFieldOutlinedExample.m @@ -12,8 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "MaterialTextFields+Theming.h" #import "MaterialTextFields.h" +#import "MaterialTextFields+Theming.h" +#import "MaterialColorScheme.h" +#import "MaterialContainerScheme.h" @interface TextFieldOutlinedObjectiveCExample : UIViewController diff --git a/components/Typography/src/MDCFontScaler.m b/components/Typography/src/MDCFontScaler.m index dea1d6fd496..dae11f0551b 100644 --- a/components/Typography/src/MDCFontScaler.m +++ b/components/Typography/src/MDCFontScaler.m @@ -17,7 +17,6 @@ #import #import "UIFont+MaterialScalable.h" -#import "private/MDCFontTraits.h" #import "private/MDCTypographyUtilities.h" MDCTextStyle const MDCTextStyleHeadline1 = @"MDC.TextStyle.Headline1"; diff --git a/components/Typography/src/UIFont+MaterialScalable.m b/components/Typography/src/UIFont+MaterialScalable.m index bce998929bb..921e0dbef09 100644 --- a/components/Typography/src/UIFont+MaterialScalable.m +++ b/components/Typography/src/UIFont+MaterialScalable.m @@ -18,7 +18,6 @@ #import "MaterialApplication.h" -#import "MDCTypography.h" #import "private/MDCTypographyUtilities.h" static char MDCFontScaleObjectKey; diff --git a/components/schemes/Shape/examples/MDCShapeSchemeExampleViewController.m b/components/schemes/Shape/examples/MDCShapeSchemeExampleViewController.m index 1b14649654d..f9a4b9cd73b 100644 --- a/components/schemes/Shape/examples/MDCShapeSchemeExampleViewController.m +++ b/components/schemes/Shape/examples/MDCShapeSchemeExampleViewController.m @@ -18,21 +18,21 @@ #import "supplemental/MDCShapeExamplesDummyCollectionViewController.h" #import "MaterialAppBar+ColorThemer.h" -#import "MaterialAppBar+TypographyThemer.h" #import "MaterialAppBar.h" -#import "MaterialBottomSheet+ShapeThemer.h" +#import "MaterialAppBar+TypographyThemer.h" #import "MaterialBottomSheet.h" -#import "MaterialButtons+ButtonThemer.h" +#import "MaterialBottomSheet+ShapeThemer.h" +#import "MaterialButtons.h" #import "MaterialButtons+ShapeThemer.h" #import "MaterialButtons+Theming.h" -#import "MaterialButtons.h" -#import "MaterialCards+Theming.h" #import "MaterialCards.h" -#import "MaterialChips+Theming.h" +#import "MaterialCards+Theming.h" #import "MaterialChips.h" +#import "MaterialChips+Theming.h" +#import "MaterialFlexibleHeader.h" +#import "MaterialShapes.h" #import "MaterialColorScheme.h" #import "MaterialContainerScheme.h" -#import "MaterialShapeLibrary.h" #import "MaterialShapeScheme.h" #import "MaterialTypographyScheme.h" diff --git a/components/schemes/Shape/examples/MDCShapeWithBorderExample.m b/components/schemes/Shape/examples/MDCShapeWithBorderExample.m index 0295c0fa874..230dac8b4f2 100644 --- a/components/schemes/Shape/examples/MDCShapeWithBorderExample.m +++ b/components/schemes/Shape/examples/MDCShapeWithBorderExample.m @@ -13,7 +13,6 @@ // limitations under the License. #import "MaterialCards.h" -#import "MaterialCards+Theming.h" #import "MaterialShapeLibrary.h" #import "MaterialShapes.h" diff --git a/components/schemes/Shape/src/MDCShapeCategory.m b/components/schemes/Shape/src/MDCShapeCategory.m index ca6c911728f..0195ca49514 100644 --- a/components/schemes/Shape/src/MDCShapeCategory.m +++ b/components/schemes/Shape/src/MDCShapeCategory.m @@ -14,6 +14,7 @@ #import "MDCShapeCategory.h" #import "MaterialShapeLibrary.h" +#import "MaterialShapes.h" @implementation MDCShapeCategory diff --git a/components/schemes/Shape/src/MDCShapeScheme.m b/components/schemes/Shape/src/MDCShapeScheme.m index d005c98973f..c6bb5d1f1d1 100644 --- a/components/schemes/Shape/src/MDCShapeScheme.m +++ b/components/schemes/Shape/src/MDCShapeScheme.m @@ -14,6 +14,8 @@ #import "MDCShapeScheme.h" +#import "MDCShapeCategory.h" + @implementation MDCShapeScheme - (instancetype)init { From b3fa42005b31417c687f8a96aa9c4df568182506 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Thu, 11 Feb 2021 07:08:26 -0800 Subject: [PATCH 15/24] Optimizing imports PiperOrigin-RevId: 356966407 --- .../List/src/Theming/MDCBaseCell+MaterialTheming.m | 6 ++++++ .../MDCSelfSizingStereoCell+MaterialTheming.m | 5 +++++ .../tests/unit/NavigationBarRippleTests.m | 2 -- .../NavigationBar/tests/unit/NavigationBarTests.m | 3 ++- .../tests/unit/MDCNavigationDrawerScrollViewTests.m | 3 +++ .../tests/unit/MDCNavigationDrawerThemeTest.m | 3 ++- components/Ripple/tests/unit/MDCRippleLayerTests.m | 1 + .../examples/ShadowElevationsPointsLabel.m | 1 + .../examples/ShadowElevationsTypicalUseExample.m | 1 - .../ShadowLayer/examples/ShadowCornerRadiusExample.m | 1 - components/ShadowLayer/examples/ShadowRadiusLabel.m | 1 + .../examples/SliderAutolayoutExampleViewController.m | 2 ++ .../Slider/examples/SliderCollectionViewController.m | 1 - components/Snackbar/src/MDCSnackbarManager.m | 2 ++ components/Snackbar/src/MDCSnackbarMessageView.m | 3 +++ .../Snackbar/tests/unit/MDCSnackbarRippleTests.m | 2 ++ .../Snackbar/tests/unit/SnackbarManagerTests.m | 1 + components/Tabs/src/MDCTabBar.m | 12 +++++++----- components/Tabs/src/MDCTabBarViewController.m | 3 +++ .../src/TabBarView/private/MDCTabBarViewItemView.m | 1 + .../private/MDCTabBarViewPrivateIndicatorContext.m | 1 - .../snapshot/MDCTabBarDynamicColorSnapshotTests.m | 4 +++- .../MDCTabBarExtendedAlignmentSnapshotTests.m | 1 + 23 files changed, 46 insertions(+), 14 deletions(-) diff --git a/components/List/src/Theming/MDCBaseCell+MaterialTheming.m b/components/List/src/Theming/MDCBaseCell+MaterialTheming.m index 528155aceed..88086113262 100644 --- a/components/List/src/Theming/MDCBaseCell+MaterialTheming.m +++ b/components/List/src/Theming/MDCBaseCell+MaterialTheming.m @@ -14,6 +14,12 @@ #import "MDCBaseCell+MaterialTheming.h" +#import "MaterialList.h" + +#import "MaterialColorScheme.h" + +#import "MaterialContainerScheme.h" + static const CGFloat kInkAlpha = (CGFloat)0.16; @implementation MDCBaseCell (MaterialTheming) diff --git a/components/List/src/Theming/MDCSelfSizingStereoCell+MaterialTheming.m b/components/List/src/Theming/MDCSelfSizingStereoCell+MaterialTheming.m index 7044e01acc5..d1875cdae42 100644 --- a/components/List/src/Theming/MDCSelfSizingStereoCell+MaterialTheming.m +++ b/components/List/src/Theming/MDCSelfSizingStereoCell+MaterialTheming.m @@ -14,7 +14,12 @@ #import "MDCSelfSizingStereoCell+MaterialTheming.h" +#import "MaterialList.h" #import "MaterialTypography.h" +#import "MaterialColorScheme.h" +#import "MaterialContainerScheme.h" +#import "MaterialTypographyScheme.h" +#import "MaterialTypographyScheme+Scheming.h" static const CGFloat kHighAlpha = (CGFloat)0.87; static const CGFloat kInkAlpha = (CGFloat)0.16; diff --git a/components/NavigationBar/tests/unit/NavigationBarRippleTests.m b/components/NavigationBar/tests/unit/NavigationBarRippleTests.m index 064bad2a0c5..a51d5dcc661 100644 --- a/components/NavigationBar/tests/unit/NavigationBarRippleTests.m +++ b/components/NavigationBar/tests/unit/NavigationBarRippleTests.m @@ -15,9 +15,7 @@ #import #import "MaterialButtonBar.h" -#import "MaterialInk.h" #import "MaterialNavigationBar.h" -#import "MaterialRipple.h" @interface MDCNavigationBar (Testing) - (MDCButtonBar *)leadingButtonBar; diff --git a/components/NavigationBar/tests/unit/NavigationBarTests.m b/components/NavigationBar/tests/unit/NavigationBarTests.m index db637f1f393..656c14e1de6 100644 --- a/components/NavigationBar/tests/unit/NavigationBarTests.m +++ b/components/NavigationBar/tests/unit/NavigationBarTests.m @@ -15,8 +15,9 @@ #import #import "MaterialButtonBar.h" -#import "MaterialNavigationBar+TypographyThemer.h" #import "MaterialNavigationBar.h" +#import "MaterialNavigationBar+TypographyThemer.h" +#import "MaterialTypographyScheme.h" static const CGFloat kEpsilonAccuracy = (CGFloat)0.001; diff --git a/components/NavigationDrawer/tests/unit/MDCNavigationDrawerScrollViewTests.m b/components/NavigationDrawer/tests/unit/MDCNavigationDrawerScrollViewTests.m index e61b8753406..425e38d5002 100644 --- a/components/NavigationDrawer/tests/unit/MDCNavigationDrawerScrollViewTests.m +++ b/components/NavigationDrawer/tests/unit/MDCNavigationDrawerScrollViewTests.m @@ -17,6 +17,9 @@ #import "../../src/private/MDCBottomDrawerContainerViewController.h" #import "../../src/private/MDCBottomDrawerHeaderMask.h" #import "../../src/private/MDCBottomDrawerShadowedView.h" +#import "MDCBottomDrawerState.h" +#import "MaterialNavigationDrawer.h" +#import "MDCBottomDrawerContainerViewControllerDelegate.h" #import "MDCNavigationDrawerFakes.h" #import "MaterialShadowLayer.h" diff --git a/components/NavigationDrawer/tests/unit/MDCNavigationDrawerThemeTest.m b/components/NavigationDrawer/tests/unit/MDCNavigationDrawerThemeTest.m index 676184746cd..f858c0c8073 100644 --- a/components/NavigationDrawer/tests/unit/MDCNavigationDrawerThemeTest.m +++ b/components/NavigationDrawer/tests/unit/MDCNavigationDrawerThemeTest.m @@ -14,9 +14,10 @@ #import -#import "MDCNavigationDrawerFakes.h" #import "MaterialNavigationDrawer+ColorThemer.h" #import "MaterialNavigationDrawer.h" +#import "MDCNavigationDrawerFakes.h" +#import "MaterialColorScheme.h" static const CGFloat kScimAlpha = (CGFloat)0.32; diff --git a/components/Ripple/tests/unit/MDCRippleLayerTests.m b/components/Ripple/tests/unit/MDCRippleLayerTests.m index 449ccaf6170..49b5ec1e00d 100644 --- a/components/Ripple/tests/unit/MDCRippleLayerTests.m +++ b/components/Ripple/tests/unit/MDCRippleLayerTests.m @@ -15,6 +15,7 @@ #import #import "../../src/private/MDCRippleLayer.h" +#import "MDCRippleLayerDelegate.h" #pragma mark - Fake classes diff --git a/components/ShadowElevations/examples/ShadowElevationsPointsLabel.m b/components/ShadowElevations/examples/ShadowElevationsPointsLabel.m index 6b0f15177ec..015ee720132 100644 --- a/components/ShadowElevations/examples/ShadowElevationsPointsLabel.m +++ b/components/ShadowElevations/examples/ShadowElevationsPointsLabel.m @@ -14,6 +14,7 @@ #import "ShadowElevationsPointsLabel.h" +#import "MaterialShadowElevations.h" #import "MaterialShadowLayer.h" @implementation ShadowElevationsPointsLabel diff --git a/components/ShadowElevations/examples/ShadowElevationsTypicalUseExample.m b/components/ShadowElevations/examples/ShadowElevationsTypicalUseExample.m index 9e9d4ffc3ca..fe0b4338529 100644 --- a/components/ShadowElevations/examples/ShadowElevationsTypicalUseExample.m +++ b/components/ShadowElevations/examples/ShadowElevationsTypicalUseExample.m @@ -18,7 +18,6 @@ #import "MaterialMath.h" #import "MaterialShadowElevations.h" -#import "MaterialShadowLayer.h" #import "MaterialSlider.h" static NSString *const kDefaultShadowElevationLabelString = @""; diff --git a/components/ShadowLayer/examples/ShadowCornerRadiusExample.m b/components/ShadowLayer/examples/ShadowCornerRadiusExample.m index 10831514ac3..47d5d79de6e 100644 --- a/components/ShadowLayer/examples/ShadowCornerRadiusExample.m +++ b/components/ShadowLayer/examples/ShadowCornerRadiusExample.m @@ -14,7 +14,6 @@ #import -#import "MaterialShadowLayer.h" #import "MaterialSlider.h" #import "ShadowRadiusLabel.h" diff --git a/components/ShadowLayer/examples/ShadowRadiusLabel.m b/components/ShadowLayer/examples/ShadowRadiusLabel.m index 12f3b3b1776..29b3e83c633 100644 --- a/components/ShadowLayer/examples/ShadowRadiusLabel.m +++ b/components/ShadowLayer/examples/ShadowRadiusLabel.m @@ -14,6 +14,7 @@ #import "ShadowRadiusLabel.h" +#import "MaterialShadowElevations.h" #import "MaterialShadowLayer.h" @implementation ShadowRadiusLabel diff --git a/components/Slider/examples/SliderAutolayoutExampleViewController.m b/components/Slider/examples/SliderAutolayoutExampleViewController.m index 900b0ea9977..4a13b038718 100644 --- a/components/Slider/examples/SliderAutolayoutExampleViewController.m +++ b/components/Slider/examples/SliderAutolayoutExampleViewController.m @@ -16,6 +16,8 @@ #import "MaterialSlider+ColorThemer.h" #import "MaterialSlider.h" +#import "MaterialColorScheme.h" +#import "MaterialTypographyScheme.h" @interface SliderAutolayoutExampleViewController () @property(weak, nonatomic) IBOutlet UISlider *vanillaSlider; diff --git a/components/Slider/examples/SliderCollectionViewController.m b/components/Slider/examples/SliderCollectionViewController.m index b42f6c4e921..ac2a97040b7 100644 --- a/components/Slider/examples/SliderCollectionViewController.m +++ b/components/Slider/examples/SliderCollectionViewController.m @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "MaterialCollections.h" #import "MaterialColorScheme.h" #import "MaterialPalettes.h" #import "MaterialSlider+ColorThemer.h" diff --git a/components/Snackbar/src/MDCSnackbarManager.m b/components/Snackbar/src/MDCSnackbarManager.m index 3f8fccca1e5..949d176d489 100644 --- a/components/Snackbar/src/MDCSnackbarManager.m +++ b/components/Snackbar/src/MDCSnackbarManager.m @@ -14,7 +14,9 @@ #import "MDCSnackbarManager.h" +#import "MaterialButtons.h" #import "MaterialOverlayWindow.h" +#import "MaterialShadowElevations.h" #import "MDCSnackbarManagerDelegate.h" #import "MDCSnackbarMessage.h" #import "MDCSnackbarMessageView.h" diff --git a/components/Snackbar/src/MDCSnackbarMessageView.m b/components/Snackbar/src/MDCSnackbarMessageView.m index 52bfe95c4c1..1708987fdb7 100644 --- a/components/Snackbar/src/MDCSnackbarMessageView.m +++ b/components/Snackbar/src/MDCSnackbarMessageView.m @@ -14,6 +14,9 @@ #import +#import "MaterialButtons.h" +#import "MaterialElevation.h" +#import "MaterialShadowElevations.h" #import "MDCSnackbarManager.h" #import "MDCSnackbarMessage.h" #import "MDCSnackbarMessageView.h" diff --git a/components/Snackbar/tests/unit/MDCSnackbarRippleTests.m b/components/Snackbar/tests/unit/MDCSnackbarRippleTests.m index de2c26ac682..1b2007b789e 100644 --- a/components/Snackbar/tests/unit/MDCSnackbarRippleTests.m +++ b/components/Snackbar/tests/unit/MDCSnackbarRippleTests.m @@ -14,6 +14,8 @@ #import +#import "MaterialButtons.h" +#import "MaterialInk.h" #import "MaterialSnackbar.h" #import "../../src/private/MDCSnackbarManagerInternal.h" diff --git a/components/Snackbar/tests/unit/SnackbarManagerTests.m b/components/Snackbar/tests/unit/SnackbarManagerTests.m index c2d399e4aef..cb449671af7 100644 --- a/components/Snackbar/tests/unit/SnackbarManagerTests.m +++ b/components/Snackbar/tests/unit/SnackbarManagerTests.m @@ -14,6 +14,7 @@ #import #import "../../src/private/MDCSnackbarManagerInternal.h" +#import "MaterialShadowElevations.h" #import "MaterialSnackbar.h" @interface MDCSnackbarManagerInternal (SnackbarManagerTesting) diff --git a/components/Tabs/src/MDCTabBar.m b/components/Tabs/src/MDCTabBar.m index 7487e5cbea4..f3a85811baa 100644 --- a/components/Tabs/src/MDCTabBar.m +++ b/components/Tabs/src/MDCTabBar.m @@ -14,6 +14,10 @@ #import "MDCTabBar.h" +#import "MDCTabBarAlignment.h" +#import "MDCTabBarItemAppearance.h" +#import "MDCTabBarTextTransform.h" +#import "MDCItemBarDelegate.h" #import #import "private/MDCItemBar.h" @@ -23,8 +27,6 @@ #import "MaterialRipple.h" #import "MDCTabBarExtendedAlignment.h" #import "MDCTabBarDelegate.h" -#import "MDCTabBarDisplayDelegate.h" -#import "MDCTabBarIndicatorTemplate.h" #import "MDCTabBarUnderlineIndicatorTemplate.h" #import "MDCTabBarSizeClassDelegate.h" #import "MaterialTypography.h" @@ -85,11 +87,11 @@ static MDCItemBarAlignment MDCItemBarAlignmentForTabBarAlignment( return [UIColor colorWithWhite:1 alpha:(CGFloat)0.7]; } -@interface MDCTabBar () -@property(nonatomic, weak, nullable) id sizeClassDelegate; -@end +@protocol MDCTabBarSizeClassDelegate; +@protocol MDCTabBarDisplayDelegate; @interface MDCTabBar () +@property(nonatomic, weak, nullable) id sizeClassDelegate; @property(nonatomic, weak, nullable) id displayDelegate; @end diff --git a/components/Tabs/src/MDCTabBarViewController.m b/components/Tabs/src/MDCTabBarViewController.m index d5f218b1877..b191cf5c7e0 100644 --- a/components/Tabs/src/MDCTabBarViewController.m +++ b/components/Tabs/src/MDCTabBarViewController.m @@ -16,7 +16,10 @@ #import "MaterialShadowElevations.h" #import "MaterialShadowLayer.h" +#import "MDCTabBar.h" +#import "MDCTabBarAlignment.h" #import "MDCTabBarControllerDelegate.h" +#import "MDCTabBarItemAppearance.h" const CGFloat MDCTabBarViewControllerAnimationDuration = (CGFloat)0.3; diff --git a/components/Tabs/src/TabBarView/private/MDCTabBarViewItemView.m b/components/Tabs/src/TabBarView/private/MDCTabBarViewItemView.m index 5cbf1880fd1..a39e46d27df 100644 --- a/components/Tabs/src/TabBarView/private/MDCTabBarViewItemView.m +++ b/components/Tabs/src/TabBarView/private/MDCTabBarViewItemView.m @@ -16,6 +16,7 @@ #import +#import "MaterialRipple.h" #import "MDCTabBarViewItemViewDelegate.h" #import "MaterialMath.h" diff --git a/components/Tabs/src/TabBarView/private/MDCTabBarViewPrivateIndicatorContext.m b/components/Tabs/src/TabBarView/private/MDCTabBarViewPrivateIndicatorContext.m index 21a9563cd20..e8ce5cff508 100644 --- a/components/Tabs/src/TabBarView/private/MDCTabBarViewPrivateIndicatorContext.m +++ b/components/Tabs/src/TabBarView/private/MDCTabBarViewPrivateIndicatorContext.m @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "MDCTabBarViewIndicatorContext.h" #import "MDCTabBarViewPrivateIndicatorContext.h" diff --git a/components/Tabs/tests/snapshot/MDCTabBarDynamicColorSnapshotTests.m b/components/Tabs/tests/snapshot/MDCTabBarDynamicColorSnapshotTests.m index dd4d26b801a..66d3b23e012 100644 --- a/components/Tabs/tests/snapshot/MDCTabBarDynamicColorSnapshotTests.m +++ b/components/Tabs/tests/snapshot/MDCTabBarDynamicColorSnapshotTests.m @@ -15,8 +15,10 @@ #import "MaterialSnapshot.h" #import "MaterialAvailability.h" -#import "MaterialTabs+Theming.h" #import "MaterialTabs.h" +#import "MaterialTabs+Theming.h" +#import "MaterialColorScheme.h" +#import "MaterialContainerScheme.h" /** An MDCTabBar subclass that allows the user to override the @c traitCollection property. diff --git a/components/Tabs/tests/snapshot/MDCTabBarExtendedAlignmentSnapshotTests.m b/components/Tabs/tests/snapshot/MDCTabBarExtendedAlignmentSnapshotTests.m index f45b676ea24..3806b5d5da7 100644 --- a/components/Tabs/tests/snapshot/MDCTabBarExtendedAlignmentSnapshotTests.m +++ b/components/Tabs/tests/snapshot/MDCTabBarExtendedAlignmentSnapshotTests.m @@ -17,6 +17,7 @@ #import "MDCTabBarExtendedAlignment.h" #import "MaterialTabs.h" #import "MaterialTabs+Theming.h" +#import "MaterialContainerScheme.h" static NSString *const kItemTitleShort1Latin = @"Quando"; static NSString *const kItemTitleShort2Latin = @"No"; From 39c20e15f82a89c5ea7311f708c8360671efea5a Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Thu, 11 Feb 2021 07:15:50 -0800 Subject: [PATCH 16/24] Optimizing imports PiperOrigin-RevId: 356967514 --- .../MDCCardCustomTraitCollectionSnapshotTests.m | 3 ++- .../Cards/tests/snapshot/MDCCardSnapshotTests.m | 4 +++- components/Chips/src/MDCChipField.m | 1 + components/Chips/src/MDCChipView.m | 2 +- .../CollectionsEditingManyCellsExampleSupplemental.m | 2 ++ .../CollectionsSectionInsetsExampleSupplemental.m | 2 ++ .../Collections/src/MDCCollectionViewController.m | 5 +++-- .../Collections/src/MDCCollectionViewFlowLayout.m | 9 ++++----- .../Dialogs/src/MDCDialogPresentationController.m | 2 +- .../src/Theming/MDCAlertController+MaterialTheming.m | 12 ++++++++---- ...MDCDialogPresentationController+MaterialTheming.m | 8 ++++++++ .../Dialogs/src/private/MDCAlertActionManager.m | 1 + .../src/private/MDCAlertControllerView+Private.m | 2 +- .../tests/unit/FeatureHighlightAccessibilityTests.m | 1 - .../tests/unit/FeatureHighlightColorThemerTests.m | 1 + .../FlexibleHeader/src/MDCFlexibleHeaderView.m | 5 +++++ .../src/MDCFlexibleHeaderViewController.m | 1 + .../src/private/MDCFlexibleHeaderShifter.m | 2 ++ .../src/private/MDCFlexibleHeaderTopSafeArea.m | 1 - components/Ink/tests/unit/MDCInkLayerTests.m | 1 + components/Ink/tests/unit/MDCLegacyInkLayerTests.m | 3 ++- components/List/examples/MDCBaseCellExample.m | 2 ++ .../List/examples/MDCSelfSizingStereoCellExample.m | 1 + 23 files changed, 52 insertions(+), 19 deletions(-) diff --git a/components/Cards/tests/snapshot/MDCCardCustomTraitCollectionSnapshotTests.m b/components/Cards/tests/snapshot/MDCCardCustomTraitCollectionSnapshotTests.m index 1f96ff33fdf..2b0d7b3aad7 100644 --- a/components/Cards/tests/snapshot/MDCCardCustomTraitCollectionSnapshotTests.m +++ b/components/Cards/tests/snapshot/MDCCardCustomTraitCollectionSnapshotTests.m @@ -15,8 +15,9 @@ #import "MaterialSnapshot.h" #import "MaterialAvailability.h" -#import "MaterialCards+Theming.h" #import "MaterialCards.h" +#import "MaterialColorScheme.h" +#import "MaterialContainerScheme.h" /** An MDCCard subclass that allows the user to override the @c traitCollection property. diff --git a/components/Cards/tests/snapshot/MDCCardSnapshotTests.m b/components/Cards/tests/snapshot/MDCCardSnapshotTests.m index fd7557d65cb..b3d38ff47a9 100644 --- a/components/Cards/tests/snapshot/MDCCardSnapshotTests.m +++ b/components/Cards/tests/snapshot/MDCCardSnapshotTests.m @@ -12,9 +12,11 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "MaterialCards+Theming.h" #import "MaterialCards.h" +#import "MaterialCards+Theming.h" #import "MaterialSnapshot.h" +#import "MaterialColorScheme.h" +#import "MaterialContainerScheme.h" @interface MDCCardSnapshotTests : MDCSnapshotTestCase diff --git a/components/Chips/src/MDCChipField.m b/components/Chips/src/MDCChipField.m index 0bf870f2a69..e2485b4a39a 100644 --- a/components/Chips/src/MDCChipField.m +++ b/components/Chips/src/MDCChipField.m @@ -14,6 +14,7 @@ #import "MDCChipField.h" +#import "MDCChipView.h" #import #import "MDCChipFieldDelegate.h" diff --git a/components/Chips/src/MDCChipView.m b/components/Chips/src/MDCChipView.m index 36f4952cd40..c334015d4fc 100644 --- a/components/Chips/src/MDCChipView.m +++ b/components/Chips/src/MDCChipView.m @@ -15,12 +15,12 @@ #import "MDCChipView.h" #import "private/MDCChipView+Private.h" +#import "MaterialElevation.h" #import #import "MaterialInk.h" #import "MaterialRipple.h" #import "MaterialShadowElevations.h" -#import "MaterialShadowLayer.h" #import "MaterialShapeLibrary.h" #import "MaterialShapes.h" #import "MaterialTypography.h" diff --git a/components/Collections/examples/supplemental/CollectionsEditingManyCellsExampleSupplemental.m b/components/Collections/examples/supplemental/CollectionsEditingManyCellsExampleSupplemental.m index d57a0673ed1..cf037c9b9b1 100644 --- a/components/Collections/examples/supplemental/CollectionsEditingManyCellsExampleSupplemental.m +++ b/components/Collections/examples/supplemental/CollectionsEditingManyCellsExampleSupplemental.m @@ -14,6 +14,8 @@ #import "CollectionsEditingManyCellsExampleSupplemental.h" +#import "MaterialCollections.h" + @implementation CollectionsEditingManyCellsExample (Supplemental) #pragma mark - CatalogByConvention diff --git a/components/Collections/examples/supplemental/CollectionsSectionInsetsExampleSupplemental.m b/components/Collections/examples/supplemental/CollectionsSectionInsetsExampleSupplemental.m index 380510c1be3..b4b4a57effc 100644 --- a/components/Collections/examples/supplemental/CollectionsSectionInsetsExampleSupplemental.m +++ b/components/Collections/examples/supplemental/CollectionsSectionInsetsExampleSupplemental.m @@ -14,6 +14,8 @@ #import "CollectionsSectionInsetsExampleSupplemental.h" +#import "MaterialCollections.h" + @implementation CollectionsSectionInsetsExample (Supplemental) - (void)viewDidLoad { diff --git a/components/Collections/src/MDCCollectionViewController.m b/components/Collections/src/MDCCollectionViewController.m index 255d6ef0f17..0232081893b 100644 --- a/components/Collections/src/MDCCollectionViewController.m +++ b/components/Collections/src/MDCCollectionViewController.m @@ -19,9 +19,10 @@ #import "private/MDCCollectionViewEditor.h" #import "private/MDCCollectionViewStyler.h" #import "MaterialCollectionCells.h" +#import "MDCCollectionViewEditing.h" +#import "MDCCollectionViewEditingDelegate.h" #import "MDCCollectionViewFlowLayout.h" -#import "MaterialInk.h" -#import "MaterialRipple.h" +#import "MDCCollectionInfoBarViewDelegate.h" #include diff --git a/components/Collections/src/MDCCollectionViewFlowLayout.m b/components/Collections/src/MDCCollectionViewFlowLayout.m index 4b724533348..4ee63b8b041 100644 --- a/components/Collections/src/MDCCollectionViewFlowLayout.m +++ b/components/Collections/src/MDCCollectionViewFlowLayout.m @@ -14,13 +14,12 @@ #import "MDCCollectionViewFlowLayout.h" -#import "MDCCollectionViewController.h" -#import "MDCCollectionViewEditingDelegate.h" -#import "MDCCollectionViewStyling.h" -#import "MaterialCollectionLayoutAttributes.h" #import "private/MDCCollectionGridBackgroundView.h" #import "private/MDCCollectionInfoBarView.h" -#import "private/MDCCollectionViewEditor.h" +#import "MaterialCollectionLayoutAttributes.h" +#import "MDCCollectionViewController.h" +#import "MDCCollectionViewEditing.h" +#import "MDCCollectionViewEditingDelegate.h" #include diff --git a/components/Dialogs/src/MDCDialogPresentationController.m b/components/Dialogs/src/MDCDialogPresentationController.m index e0a27ec731f..76f3b8476d6 100644 --- a/components/Dialogs/src/MDCDialogPresentationController.m +++ b/components/Dialogs/src/MDCDialogPresentationController.m @@ -16,7 +16,7 @@ #import "private/MDCDialogShadowedView.h" #import "MDCDialogPresentationControllerDelegate.h" -#import "MaterialShadowLayer.h" +#import "MaterialShadowElevations.h" #import "MaterialKeyboardWatcher.h" static const CGFloat MDCDialogMinimumWidth = 280; diff --git a/components/Dialogs/src/Theming/MDCAlertController+MaterialTheming.m b/components/Dialogs/src/Theming/MDCAlertController+MaterialTheming.m index 63d7e9a527e..9fa04f33716 100644 --- a/components/Dialogs/src/Theming/MDCAlertController+MaterialTheming.m +++ b/components/Dialogs/src/Theming/MDCAlertController+MaterialTheming.m @@ -12,11 +12,15 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import -#import -#import -#import +#import "MaterialButtons.h" #import "MaterialButtons+Theming.h" +#import "MDCAlertController+ButtonForAction.h" // TODO(b/126884296): One-off transformation needs fixing in copy.bara.sky +#import "MaterialDialogs.h" +#import "MaterialShadowElevations.h" // ComponentImport +#import "MaterialColorScheme.h" +#import "MaterialContainerScheme.h" +#import "MaterialTypographyScheme.h" +#import "MaterialTypographyScheme+Scheming.h" static const CGFloat kCornerRadius = 4; diff --git a/components/Dialogs/src/Theming/MDCDialogPresentationController+MaterialTheming.m b/components/Dialogs/src/Theming/MDCDialogPresentationController+MaterialTheming.m index f166f8c59d1..af4b9a9607a 100644 --- a/components/Dialogs/src/Theming/MDCDialogPresentationController+MaterialTheming.m +++ b/components/Dialogs/src/Theming/MDCDialogPresentationController+MaterialTheming.m @@ -14,6 +14,14 @@ #import "MDCDialogPresentationController+MaterialTheming.h" +#import "MaterialDialogs.h" + +#import "MaterialShadowElevations.h" + +#import "MaterialColorScheme.h" + +#import "MaterialContainerScheme.h" + static const CGFloat kCornerRadius = 4; @implementation MDCDialogPresentationController (MaterialTheming) diff --git a/components/Dialogs/src/private/MDCAlertActionManager.m b/components/Dialogs/src/private/MDCAlertActionManager.m index a94e5843182..ff774a5e5f9 100644 --- a/components/Dialogs/src/private/MDCAlertActionManager.m +++ b/components/Dialogs/src/private/MDCAlertActionManager.m @@ -14,6 +14,7 @@ #import "MDCAlertActionManager.h" #import "MaterialButtons.h" +#import "MaterialDialogs.h" @interface MDCAlertActionManager () diff --git a/components/Dialogs/src/private/MDCAlertControllerView+Private.m b/components/Dialogs/src/private/MDCAlertControllerView+Private.m index 85833503fde..d780fb1b250 100644 --- a/components/Dialogs/src/private/MDCAlertControllerView+Private.m +++ b/components/Dialogs/src/private/MDCAlertControllerView+Private.m @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#import "MDCAlertControllerView.h" #import "MDCAlertActionManager.h" #import "MDCAlertControllerView+Private.h" +#import "MaterialShadowElevations.h" #import #import "MaterialButtons.h" diff --git a/components/FeatureHighlight/tests/unit/FeatureHighlightAccessibilityTests.m b/components/FeatureHighlight/tests/unit/FeatureHighlightAccessibilityTests.m index 8c194e78808..cd88d13390a 100644 --- a/components/FeatureHighlight/tests/unit/FeatureHighlightAccessibilityTests.m +++ b/components/FeatureHighlight/tests/unit/FeatureHighlightAccessibilityTests.m @@ -14,7 +14,6 @@ #import -#import "MDCFeatureHighlightView+Private.h" #import "MaterialFeatureHighlight.h" @interface MDCFeatureHighlightViewController (Testing) diff --git a/components/FeatureHighlight/tests/unit/FeatureHighlightColorThemerTests.m b/components/FeatureHighlight/tests/unit/FeatureHighlightColorThemerTests.m index 0b33ad1a749..05fa5350f0e 100644 --- a/components/FeatureHighlight/tests/unit/FeatureHighlightColorThemerTests.m +++ b/components/FeatureHighlight/tests/unit/FeatureHighlightColorThemerTests.m @@ -14,6 +14,7 @@ #import "MaterialFeatureHighlight+ColorThemer.h" #import "MaterialFeatureHighlight.h" +#import "MaterialColorScheme.h" #import diff --git a/components/FlexibleHeader/src/MDCFlexibleHeaderView.m b/components/FlexibleHeader/src/MDCFlexibleHeaderView.m index 0d482461325..f9c94fd7822 100644 --- a/components/FlexibleHeader/src/MDCFlexibleHeaderView.m +++ b/components/FlexibleHeader/src/MDCFlexibleHeaderView.m @@ -19,10 +19,15 @@ #import "private/MDCFlexibleHeaderTopSafeArea.h" #import "private/MDCFlexibleHeaderView+Private.h" #import "private/MDCStatusBarShifter.h" +#import "MaterialElevation.h" #import "MDCFlexibleHeaderView+ShiftBehavior.h" #import "MDCFlexibleHeaderViewAnimationDelegate.h" #import "MDCFlexibleHeaderViewDelegate.h" +#import "MaterialFlexibleHeader+ShiftBehavior.h" #import "MaterialFlexibleHeader+ShiftBehaviorEnabledWithStatusBar.h" +#import "MDCFlexibleHeaderMinMaxHeightDelegate.h" +#import "MDCFlexibleHeaderTopSafeAreaDelegate.h" +#import "MDCStatusBarShifterDelegate.h" #import "MaterialShadowElevations.h" #import "MaterialApplication.h" #import "MaterialMath.h" diff --git a/components/FlexibleHeader/src/MDCFlexibleHeaderViewController.m b/components/FlexibleHeader/src/MDCFlexibleHeaderViewController.m index ce67093bf42..fd8c81f6f34 100644 --- a/components/FlexibleHeader/src/MDCFlexibleHeaderViewController.m +++ b/components/FlexibleHeader/src/MDCFlexibleHeaderViewController.m @@ -21,6 +21,7 @@ #import "MDCFlexibleHeaderSafeAreaDelegate.h" #import "MDCFlexibleHeaderView+ShiftBehavior.h" #import "MDCFlexibleHeaderView.h" +#import "MDCFlexibleHeaderViewDelegate.h" #import "MDCFlexibleHeaderViewLayoutDelegate.h" #import "MaterialFlexibleHeader+ShiftBehaviorEnabledWithStatusBar.h" #import "MaterialApplication.h" diff --git a/components/FlexibleHeader/src/private/MDCFlexibleHeaderShifter.m b/components/FlexibleHeader/src/private/MDCFlexibleHeaderShifter.m index e2b561fb746..0bfc1f332da 100644 --- a/components/FlexibleHeader/src/private/MDCFlexibleHeaderShifter.m +++ b/components/FlexibleHeader/src/private/MDCFlexibleHeaderShifter.m @@ -13,6 +13,8 @@ // limitations under the License. #import "MDCFlexibleHeaderShifter.h" +#import "MDCFlexibleHeaderView+ShiftBehavior.h" +#import "MaterialFlexibleHeader+ShiftBehavior.h" #import "MaterialFlexibleHeader+ShiftBehaviorEnabledWithStatusBar.h" // The suffix for an app extension bundle path. diff --git a/components/FlexibleHeader/src/private/MDCFlexibleHeaderTopSafeArea.m b/components/FlexibleHeader/src/private/MDCFlexibleHeaderTopSafeArea.m index da53d401647..caec2bf423d 100644 --- a/components/FlexibleHeader/src/private/MDCFlexibleHeaderTopSafeArea.m +++ b/components/FlexibleHeader/src/private/MDCFlexibleHeaderTopSafeArea.m @@ -16,7 +16,6 @@ #import "MDCFlexibleHeaderTopSafeArea.h" -#import "MDCFlexibleHeaderView.h" #import "MDCFlexibleHeaderTopSafeAreaDelegate.h" // The default status bar height for non-X devices. diff --git a/components/Ink/tests/unit/MDCInkLayerTests.m b/components/Ink/tests/unit/MDCInkLayerTests.m index 5c4d7c02c13..a799aa1f559 100644 --- a/components/Ink/tests/unit/MDCInkLayerTests.m +++ b/components/Ink/tests/unit/MDCInkLayerTests.m @@ -15,6 +15,7 @@ #import #import "../../src/private/MDCInkLayer.h" +#import "MDCInkLayerDelegate.h" #pragma mark - Fake classes diff --git a/components/Ink/tests/unit/MDCLegacyInkLayerTests.m b/components/Ink/tests/unit/MDCLegacyInkLayerTests.m index f8234c19378..639b392b4ca 100644 --- a/components/Ink/tests/unit/MDCLegacyInkLayerTests.m +++ b/components/Ink/tests/unit/MDCLegacyInkLayerTests.m @@ -14,7 +14,8 @@ #import #import "../../src/private/MDCLegacyInkLayer+Private.h" -#import "MaterialInk.h" +#import "MDCLegacyInkLayer.h" +#import "MDCLegacyInkLayerRippleDelegate.h" #pragma mark - Property exposure diff --git a/components/List/examples/MDCBaseCellExample.m b/components/List/examples/MDCBaseCellExample.m index c9cd8f1c045..b0283791fb1 100644 --- a/components/List/examples/MDCBaseCellExample.m +++ b/components/List/examples/MDCBaseCellExample.m @@ -15,6 +15,8 @@ #import "MDCBaseCellExample.h" #import "MaterialList.h" +#import "MaterialColorScheme.h" +#import "MaterialContainerScheme.h" @implementation MDCBaseCellExample diff --git a/components/List/examples/MDCSelfSizingStereoCellExample.m b/components/List/examples/MDCSelfSizingStereoCellExample.m index 394fac2ce83..5c592f53a9b 100644 --- a/components/List/examples/MDCSelfSizingStereoCellExample.m +++ b/components/List/examples/MDCSelfSizingStereoCellExample.m @@ -14,6 +14,7 @@ #import "MDCSelfSizingStereoCellExample.h" +#import "MaterialContainerScheme.h" #import #import "MaterialList+Theming.h" From 8f2917d52553499260f11c8fd388304838ef9361 Mon Sep 17 00:00:00 2001 From: Andrew Overton Date: Thu, 11 Feb 2021 07:33:50 -0800 Subject: [PATCH 17/24] [Buttons] Add inferMinimumAndMaximumSizeWhenMultiline PiperOrigin-RevId: 356970306 --- components/Buttons/src/MDCButton.h | 18 ++++++ components/Buttons/src/MDCButton.m | 57 +++++++++++++++++- .../tests/snapshot/MDCButtonSnapshotTests.m | 60 +++++++++++++++++++ 3 files changed, 134 insertions(+), 1 deletion(-) diff --git a/components/Buttons/src/MDCButton.h b/components/Buttons/src/MDCButton.h index 70c6fb5fa09..a65428b516d 100644 --- a/components/Buttons/src/MDCButton.h +++ b/components/Buttons/src/MDCButton.h @@ -134,6 +134,24 @@ */ @property(nonatomic, assign) CGSize maximumSize UI_APPEARANCE_SELECTOR; +/** + Setting this property to @c YES when the button's @c titleLabel is multi-line (i.e. when @c + numberOfLines is not equal to 1) will result in the button inferring what its size should be and + then setting both the @c minimumSize and @c maximumSize to that value. Setting this property back + to @c NO will result in @c maximumSize and @c minimumSize being reset to @c CGSizeZero. + + In both Manual Layout and Auto Layout environments the inferred height is a function of the width. + In an Auto Layout environment the width will depend on the constraints placed on the view. In a + Manual Layout environment the current width will be assumed to be the preferred width, so it is + important to make sure the button's width is set to an appropriate value before turning this flag + on. In an Auto Layout environment, the view will likely resize itself as needed when this flag is + turned on. In a Manual Layout environment, you will likely have to call @c -sizeToFit after turning + this flag on. + + Defaults to NO. + */ +@property(nonatomic, assign) BOOL inferMinimumAndMaximumSizeWhenMultiline; + /** The apparent background color as seen by the user, i.e. the color of the view behind the button. diff --git a/components/Buttons/src/MDCButton.m b/components/Buttons/src/MDCButton.m index c3203902cb2..15a35531d13 100644 --- a/components/Buttons/src/MDCButton.m +++ b/components/Buttons/src/MDCButton.m @@ -125,6 +125,7 @@ @interface MDCButton () { @property(nonatomic, strong) UIView *visibleAreaLayoutGuideView; @property(nonatomic) UIEdgeInsets hitAreaInsets; @property(nonatomic, assign) UIEdgeInsets currentVisibleAreaInsets; +@property(nonatomic, assign) CGSize lastRecordedIntrinsicContentSize; @end @implementation MDCButton @@ -358,6 +359,10 @@ - (void)layoutSubviews { self.rippleView.frame = bounds; } self.titleLabel.frame = MDCRectAlignToScale(self.titleLabel.frame, [UIScreen mainScreen].scale); + + if ([self shouldInferMinimumAndMaximumSize]) { + [self inferMinimumAndMaximumSize]; + } } - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { @@ -425,7 +430,9 @@ - (CGSize)sizeThatFits:(CGSize)size { } - (CGSize)intrinsicContentSize { - return [self sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)]; + CGSize size = [self sizeThatFits:CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX)]; + self.lastRecordedIntrinsicContentSize = size; + return size; } - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection { @@ -1293,4 +1300,52 @@ - (MDCRectangleShapeGenerator *)generateShapeWithCornerRadius:(CGFloat)cornerRad return shapeGenerator; } +#pragma mark Multi-line Minimum And Maximum Sizing Inference + +- (BOOL)shouldInferMinimumAndMaximumSize { + return (self.inferMinimumAndMaximumSizeWhenMultiline && self.titleLabel.numberOfLines != 1 && + self.titleLabel.text.length > 0); +} + +- (void)setInferMinimumAndMaximumSizeWhenMultiline:(BOOL)inferMinimumAndMaximumSizeWhenMultiline { + _inferMinimumAndMaximumSizeWhenMultiline = inferMinimumAndMaximumSizeWhenMultiline; + if (!_inferMinimumAndMaximumSizeWhenMultiline) { + self.minimumSize = CGSizeZero; + self.maximumSize = CGSizeZero; + } + [self setNeedsLayout]; + // Call -layoutIfNeeded in addition to -setNeedsLayout. If in a Manual Layout environment, the + // client will probably call -sizeToFit: after enabling this flag, like the docs suggest. We want + // the pending layout pass to happen before they are able to do that, so minimumSize and + // maximumSize are already set when it happens. + [self layoutIfNeeded]; +} + +- (void)inferMinimumAndMaximumSize { + CGSize buttonSize = self.bounds.size; + CGSize sizeShrunkFromVisibleAreaInsets = + CGSizeShrinkWithInsets(buttonSize, self.visibleAreaInsets); + CGSize sizeShrunkFromContentEdgeInsets = + CGSizeShrinkWithInsets(sizeShrunkFromVisibleAreaInsets, self.contentEdgeInsets); + CGSize boundingSizeForLabel = sizeShrunkFromContentEdgeInsets; + if ([self imageForState:self.state]) { + boundingSizeForLabel.width -= CGRectGetWidth(self.imageView.frame); + } + boundingSizeForLabel.height = CGFLOAT_MAX; + CGSize sizeThatFitsLabel = [self.titleLabel sizeThatFits:boundingSizeForLabel]; + CGSize sizeShrunkFromContentEdgeInsetsWithNewHeight = + CGSizeMake(sizeShrunkFromContentEdgeInsets.width, sizeThatFitsLabel.height); + CGSize sizeExpandedFromContentEdgeInsets = + CGSizeExpandWithInsets(sizeShrunkFromContentEdgeInsetsWithNewHeight, self.contentEdgeInsets); + CGSize sizeExpandedFromVisibleAreaInsets = + CGSizeExpandWithInsets(sizeExpandedFromContentEdgeInsets, self.visibleAreaInsets); + self.minimumSize = sizeExpandedFromVisibleAreaInsets; + self.maximumSize = sizeExpandedFromVisibleAreaInsets; + + if (!CGSizeEqualToSize(sizeExpandedFromVisibleAreaInsets, + self.lastRecordedIntrinsicContentSize)) { + [self invalidateIntrinsicContentSize]; + } +} + @end diff --git a/components/Buttons/tests/snapshot/MDCButtonSnapshotTests.m b/components/Buttons/tests/snapshot/MDCButtonSnapshotTests.m index 25c5a644383..c098e37f4b6 100644 --- a/components/Buttons/tests/snapshot/MDCButtonSnapshotTests.m +++ b/components/Buttons/tests/snapshot/MDCButtonSnapshotTests.m @@ -207,4 +207,64 @@ - (void)testVisibleAreaLayoutGuide { [self snapshotVerifyView:containerView]; } +- (void)testInferMinimumAndMaximumSizeWhenMultiline { + // Given + MDCButtonSnapshotTestsFakeButton *button = [[MDCButtonSnapshotTestsFakeButton alloc] init]; + [button applyContainedThemeWithScheme:[[MDCContainerScheme alloc] init]]; + NSString *titleString = + @"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has " + @"been the industry's standard dummy text ever since the 1500s, when an unknown printer took " + @"a galley of type and scrambled it to make a type specimen book."; + [button setTitle:titleString forState:UIControlStateNormal]; + button.translatesAutoresizingMaskIntoConstraints = NO; + + UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 500)]; + containerView.backgroundColor = [UIColor whiteColor]; + [containerView addSubview:button]; + + [NSLayoutConstraint activateConstraints:@[ + [button.heightAnchor constraintGreaterThanOrEqualToConstant:44], + [button.widthAnchor constraintLessThanOrEqualToAnchor:containerView.widthAnchor constant:-40], + [button.centerXAnchor constraintEqualToAnchor:containerView.centerXAnchor], + [button.centerYAnchor constraintEqualToAnchor:containerView.centerYAnchor], + ]]; + + // When + button.titleLabel.numberOfLines = 0; + button.inferMinimumAndMaximumSizeWhenMultiline = YES; + [containerView setNeedsLayout]; + [containerView layoutIfNeeded]; + + // Then + [self snapshotVerifyView:containerView]; +} + +- (void)testInferMinimumAndMaximumSizeWhenMultilineManualLayout { + // Given + CGFloat desiredButtonWidth = 250.0f; + CGFloat estimatedButtonHeight = 100.0f; + CGRect estimatedButtonFrame = CGRectMake(0, 0, desiredButtonWidth, estimatedButtonHeight); + MDCButton *button = [[MDCButton alloc] initWithFrame:estimatedButtonFrame]; + [button applyContainedThemeWithScheme:[[MDCContainerScheme alloc] init]]; + NSString *titleString = + @"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has " + @"been the industry's standard dummy text ever since the 1500s, when an unknown printer took " + @"a galley of type and scrambled it to make a type specimen book."; + [button setTitle:titleString forState:UIControlStateNormal]; + + UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 500)]; + containerView.backgroundColor = [UIColor whiteColor]; + [containerView addSubview:button]; + + // When + button.titleLabel.numberOfLines = 0; + button.inferMinimumAndMaximumSizeWhenMultiline = YES; + [button sizeToFit]; + button.center = CGPointMake(0.5f * CGRectGetWidth(containerView.frame), + 0.5f * CGRectGetHeight(containerView.frame)); + + // Then + [self snapshotVerifyView:containerView]; +} + @end From 6028ffe8792402eb137f9197e0521439bdf999b9 Mon Sep 17 00:00:00 2001 From: Cody Weaver Date: Thu, 11 Feb 2021 08:51:23 -0800 Subject: [PATCH 18/24] Optimizing imports PiperOrigin-RevId: 356984061 --- components/Tabs/src/MDCTabBar.m | 1 - 1 file changed, 1 deletion(-) diff --git a/components/Tabs/src/MDCTabBar.m b/components/Tabs/src/MDCTabBar.m index f3a85811baa..3b9f506ca30 100644 --- a/components/Tabs/src/MDCTabBar.m +++ b/components/Tabs/src/MDCTabBar.m @@ -28,7 +28,6 @@ #import "MDCTabBarExtendedAlignment.h" #import "MDCTabBarDelegate.h" #import "MDCTabBarUnderlineIndicatorTemplate.h" -#import "MDCTabBarSizeClassDelegate.h" #import "MaterialTypography.h" /// Padding between image and title in points, according to the spec. From 8b260f2b02372a111808c8c9c85297e5f164f19f Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Fri, 12 Feb 2021 08:54:41 -0500 Subject: [PATCH 19/24] Automatic changelog preparation for release. --- .gitattributes | 28 ++++++++++++++++++++--- CHANGELOG.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 3 deletions(-) diff --git a/.gitattributes b/.gitattributes index c13f46c3bdc..f56e2dfb895 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,25 @@ -# Do not merge this version into `stable`. # DO NOT CHANGE THIS FILE -snapshot_test_goldens/**/*.png filter=lfs diff=lfs merge=lfs -text # DO NOT EDIT THE LINE BELOW. -.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 7529f667c29..7946aa77a1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,65 @@ +# #develop# + +Replace this text with a summarized description of this release's contents. +## Breaking changes + +Replace this explanations for how to resolve the breaking changes. +## New deprecations + +Replace this text with links to deprecation guides. +## New features + +Replace this text with example code for each new feature. +## API changes + +## Component changes + +### AppBar + +* [Optimizing imports](https://github.com/material-components/material-components-ios/commit/1437067081c38031d16e80f08437d4667543bce0) (Jeff Verkoeyen) + +### BottomNavigation + +* [Ensure correct Voiceover behavior in iOS 14.](https://github.com/material-components/material-components-ios/commit/4b4b0f3d7d1753a926ef88723361656252219f28) (Alyssa Weiss) + +### Buttons + +* [Add inferMinimumAndMaximumSizeWhenMultiline](https://github.com/material-components/material-components-ios/commit/8f2917d52553499260f11c8fd388304838ef9361) (Andrew Overton) +* [Internal change](https://github.com/material-components/material-components-ios/commit/105c4f4ab046ab01bf0677247cfbceee2b51440f) (Andrew Overton) + +### Collections + +* [Optimizing imports](https://github.com/material-components/material-components-ios/commit/6171ea2840fb0901a49c0a886c54bf048ff0e8f4) (Jeff Verkoeyen) + +### Dialogs + +* [Fixed typo in API doc.](https://github.com/material-components/material-components-ios/commit/bcf4760ceba9933de3aa771b1e58cc9e97d7fbed) (Randall Li) + +### FlexibleHeader + +* [Redefine topSafeAreaGuide as a UIView.](https://github.com/material-components/material-components-ios/commit/22cb5afa87d9fedc134ae64002e48a3c227b2798) (Randall Li) + +### ProgressView + +* [Add snapshot and unit tests.](https://github.com/material-components/material-components-ios/commit/fdb53be95e6923b7175e5fcd09e850ae0bf69252) (Alyssa Weiss) +* [Remove generics from ProgressView's progressTintColors](https://github.com/material-components/material-components-ios/commit/c7a70ce81893c97656f8aec6c824fc44066dad88) (Andrew Overton) + +### Tabs + +* [Optimizing imports](https://github.com/material-components/material-components-ios/commit/6028ffe8792402eb137f9197e0521439bdf999b9) (Cody Weaver) + +## Multi-component changes + +* [Clean up markdown formatting.](https://github.com/material-components/material-components-ios/commit/d0ac5f2c8396ba7c5cd278b7892330effe7aa093) (Nobody) +* [Expose density on text fields and text areas](https://github.com/material-components/material-components-ios/commit/73e404888d1e98e930e62b68f864b60e264c32f3) (Andrew Overton) +* [Optimizing imports](https://github.com/material-components/material-components-ios/commit/25c9049d5a4ee13ed9085ca01a92ed3b25867989) (Jeff Verkoeyen) +* [Optimizing imports](https://github.com/material-components/material-components-ios/commit/39c20e15f82a89c5ea7311f708c8360671efea5a) (Jeff Verkoeyen) +* [Optimizing imports](https://github.com/material-components/material-components-ios/commit/63988b35da1fa5281b4260abd8a075817b19d155) (Jeff Verkoeyen) +* [Optimizing imports](https://github.com/material-components/material-components-ios/commit/9f9b452b3aeb357ed46977d3c86d40d29e63200f) (Jeff Verkoeyen) +* [Optimizing imports](https://github.com/material-components/material-components-ios/commit/b3fa42005b31417c687f8a96aa9c4df568182506) (Jeff Verkoeyen) + +--- + # 121.0.1 In this patch release we made some internal improvements to our imports and refined our deprecation policy. From 5fb34577a9e789b695356bc9f73f27878080ecdd Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Fri, 12 Feb 2021 09:10:07 -0500 Subject: [PATCH 20/24] Add missing podspec dependencies that were causing linker failures in MDCCatalog. --- MaterialComponentsExamples.podspec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MaterialComponentsExamples.podspec b/MaterialComponentsExamples.podspec index 20cfe8c6e17..1be0b878d66 100644 --- a/MaterialComponentsExamples.podspec +++ b/MaterialComponentsExamples.podspec @@ -13,5 +13,7 @@ Pod::Spec.new do |s| s.resources = ['components/*/examples/resources/*', 'components/private/*/examples/resources/*', 'components/schemes/*/examples/resources/*'] s.dependency 'MaterialComponents' + s.dependency 'MDFInternationalization' + s.dependency 'MDFTextAccessibility' s.public_header_files = ['components/*/examples/*.h', 'components/*/examples/supplemental/*.h', 'components/private/*/examples/*.h', 'components/schemes/*/examples/*.h'] end From ba7d7d01932e1a1d7a8cc693663d8806cfcc350f Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Fri, 12 Feb 2021 09:13:33 -0500 Subject: [PATCH 21/24] Write release notes. --- CHANGELOG.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7946aa77a1d..dbbd1a30082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,15 +1,13 @@ -# #develop# +# 122.0.0 + +In this major release, we have made some API-breaking changes and landed some bug fixes and test +improvements. -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 +- FlexibleHeader's topSafeAreaGuide is now a UIView. +- We've removed generics annotations from ProgressView's progressTintColors. -Replace this text with links to deprecation guides. -## New features - -Replace this text with example code for each new feature. ## API changes ## Component changes From fb731e7b6a0bb1bbc8ff31b7de89ade5182df020 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Fri, 12 Feb 2021 09:13:59 -0500 Subject: [PATCH 22/24] Bump the release. --- MaterialComponents.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 +- 11 files changed, 13 insertions(+), 13 deletions(-) diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index c6116117867..491e5a8d57c 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 = "121.0.1" + mdc.version = "122.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/MaterialComponentsEarlGreyTests.podspec b/MaterialComponentsEarlGreyTests.podspec index 7b6796d7e72..baa836c4a96 100644 --- a/MaterialComponentsEarlGreyTests.podspec +++ b/MaterialComponentsEarlGreyTests.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MaterialComponentsEarlGreyTests" - s.version = "121.0.1" + s.version = "122.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 1be0b878d66..da94178e9c4 100644 --- a/MaterialComponentsExamples.podspec +++ b/MaterialComponentsExamples.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MaterialComponentsExamples" - s.version = "121.0.1" + s.version = "122.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 a8824d74fec..0baf9c3e521 100644 --- a/MaterialComponentsSnapshotTests.podspec +++ b/MaterialComponentsSnapshotTests.podspec @@ -53,7 +53,7 @@ end Pod::Spec.new do |s| s.name = "MaterialComponentsSnapshotTests" - s.version = "121.0.1" + s.version = "122.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 6529f0010e2..2fbda770d1f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -121.0.1 +122.0.0 diff --git a/catalog/MDCCatalog/Info.plist b/catalog/MDCCatalog/Info.plist index dca3de28c52..dfc071f07a7 100644 --- a/catalog/MDCCatalog/Info.plist +++ b/catalog/MDCCatalog/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 121.0.1 + 122.0.0 CFBundleSignature ???? CFBundleVersion - 121.0.1 + 122.0.0 LSRequiresIPhoneOS UIAppFonts diff --git a/catalog/MDCDragons/Info.plist b/catalog/MDCDragons/Info.plist index edba32531e1..277b070f470 100644 --- a/catalog/MDCDragons/Info.plist +++ b/catalog/MDCDragons/Info.plist @@ -15,9 +15,9 @@ CFBundlePackageType APPL CFBundleShortVersionString - 121.0.1 + 122.0.0 CFBundleVersion - 121.0.1 + 122.0.0 LSRequiresIPhoneOS UILaunchStoryboardName diff --git a/catalog/MaterialCatalog/MaterialCatalog.podspec b/catalog/MaterialCatalog/MaterialCatalog.podspec index f660776b56b..c629cff2a02 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 = "121.0.1" + s.version = "122.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 4a8c4dacc7a..9c8aa178200 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 kMDCLibraryInfoVersionString = @"121.0.1"; +static NSString* const kMDCLibraryInfoVersionString = @"122.0.0"; @implementation MDCLibraryInfo diff --git a/components/LibraryInfo/tests/unit/LibraryInfoTests.m b/components/LibraryInfo/tests/unit/LibraryInfoTests.m index db03008f064..e1b17237f91 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: "121.0.1", etc. + // Accept: "122.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 15128313ccb..ebe5cb8f9bf 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 = "121.0.1" + s.version = "122.0.0" s.summary = "A helper image class for the MDC demos." s.description = "This spec is made for use in the MDC demos. It gets images via url." s.homepage = "https://github.com/material-components/material-components-ios" From e4545c73837ba525a5f4b015c7db1510e02e496c Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Fri, 12 Feb 2021 09:36:18 -0500 Subject: [PATCH 23/24] Minor changelog updates. --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbbd1a30082..42295f2b902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,15 @@ # 122.0.0 -In this major release, we have made some API-breaking changes and landed some bug fixes and test -improvements. +In this major release, we have made some API-breaking changes and landed some bug fixes and test improvements. ## Breaking changes +### FlexibleHeader + - FlexibleHeader's topSafeAreaGuide is now a UIView. + +### ProgressView + - We've removed generics annotations from ProgressView's progressTintColors. ## API changes From 558eb9eb7f78d913627e6faf52be07d53644fb13 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Fri, 12 Feb 2021 10:35:01 -0500 Subject: [PATCH 24/24] Remove API changes. --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42295f2b902..094976347d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,8 +12,6 @@ In this major release, we have made some API-breaking changes and landed some bu - We've removed generics annotations from ProgressView's progressTintColors. -## API changes - ## Component changes ### AppBar