diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a55055868f..bbc81c06e14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,37 @@ +# 16.3.0 + +## API diffs + +### Snackbar + +- [new] [`MDCSnackbar setPresentationHostView:`](https://github.com/google/material-components-ios/commit/ee84a40885724453da69ca90bfa6a874008dc0b0) + +## Component changes + +### CollectionCells + +#### Changes + +* [[CollectionViewCell] Call |layoutSubviews| when editing (#798)](https://github.com/google/material-components-ios/commit/393d6214e08b1ff5bc359a1cfc6f816abe7b2e67) (Gauthier Ambard) + +### Collections + +#### Changes + +* [Change layout invalidation in MDCCollectionViewStyler (#790)](https://github.com/google/material-components-ios/commit/82f7758bad9d4573f49d3656816df128642a8968) (Gauthier Ambard) + +### FeatureHighlight + +#### Changes + +* [Convert CGFloats to float for 32 bit compilation (#834)](https://github.com/google/material-components-ios/commit/28f1d43595cd2a3fa109acb275214e50c810e94d) (Sam Morrison) + +### Snackbar + +#### Changes + +* [[MDCSnackbar]! Add presentationHostView property to snackbar (#784)](https://github.com/google/material-components-ios/commit/ee84a40885724453da69ca90bfa6a874008dc0b0) (Sam Morrison) + # 16.2.0 ## API diffs @@ -147,7 +181,7 @@ ### Palettes -- [new] [`MDCPalette.paletteGeneratedFromColor](https://github.com/google/material-components-ios/blob/fad8519b6a1ba5c29a0368fb470cca3c6da74431/components/Palettes/src/MDCPalettes.h#L137) +- [new] [`MDCPalette.paletteGeneratedFromColor`](https://github.com/google/material-components-ios/blob/fad8519b6a1ba5c29a0368fb470cca3c6da74431/components/Palettes/src/MDCPalettes.h#L137) ## Component changes diff --git a/MaterialComponents.podspec b/MaterialComponents.podspec index 2967740532c..ab98220f824 100644 --- a/MaterialComponents.podspec +++ b/MaterialComponents.podspec @@ -2,7 +2,7 @@ load 'scripts/generated/icons.rb' Pod::Spec.new do |s| s.name = "MaterialComponents" - s.version = "16.2.0" + s.version = "16.3.0" s.authors = { 'Apple platform engineering at Google' => 'appleplatforms@google.com' } s.summary = "A collection of stand-alone production-ready UI libraries focused on design details." s.homepage = "https://github.com/google/material-components-ios" diff --git a/MaterialComponentsCatalog.podspec b/MaterialComponentsCatalog.podspec index 7190c8313a5..b6ccd89572a 100644 --- a/MaterialComponentsCatalog.podspec +++ b/MaterialComponentsCatalog.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MaterialComponentsCatalog" - s.version = "16.2.0" + s.version = "16.3.0" s.authors = { 'Apple platform engineering at Google' => 'appleplatforms@google.com' } s.summary = "A collection of stand-alone production-ready UI libraries focused on design details." s.homepage = "https://github.com/google/material-components-ios" diff --git a/MaterialComponentsUnitTests.podspec b/MaterialComponentsUnitTests.podspec index ec7db1269cf..1c33cc9ec0d 100644 --- a/MaterialComponentsUnitTests.podspec +++ b/MaterialComponentsUnitTests.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MaterialComponentsUnitTests" - s.version = "16.2.0" + s.version = "16.3.0" s.authors = { 'Apple platform engineering at Google' => 'appleplatforms@google.com' } s.summary = "A collection of stand-alone production-ready UI libraries focused on design details." s.homepage = "https://github.com/google/material-components-ios" diff --git a/catalog/Podfile.lock b/catalog/Podfile.lock index 43ee9bf25e9..c39bd3a82c6 100644 --- a/catalog/Podfile.lock +++ b/catalog/Podfile.lock @@ -1,39 +1,39 @@ PODS: - CatalogByConvention (2.0.0) - EarlGrey (1.4.0) - - MaterialComponents (16.2.0): - - MaterialComponents/ActivityIndicator (= 16.2.0) - - MaterialComponents/AnimationTiming (= 16.2.0) - - MaterialComponents/AppBar (= 16.2.0) - - MaterialComponents/ButtonBar (= 16.2.0) - - MaterialComponents/Buttons (= 16.2.0) - - MaterialComponents/CollectionCells (= 16.2.0) - - MaterialComponents/CollectionLayoutAttributes (= 16.2.0) - - MaterialComponents/Collections (= 16.2.0) - - MaterialComponents/Dialogs (= 16.2.0) - - MaterialComponents/FeatureHighlight (= 16.2.0) - - MaterialComponents/FlexibleHeader (= 16.2.0) - - MaterialComponents/FontDiskLoader (= 16.2.0) - - MaterialComponents/HeaderStackView (= 16.2.0) - - MaterialComponents/Ink (= 16.2.0) - - MaterialComponents/NavigationBar (= 16.2.0) - - MaterialComponents/OverlayWindow (= 16.2.0) - - MaterialComponents/PageControl (= 16.2.0) - - MaterialComponents/Palettes (= 16.2.0) - - MaterialComponents/private (= 16.2.0) - - MaterialComponents/ProgressView (= 16.2.0) - - MaterialComponents/RobotoFontLoader (= 16.2.0) - - MaterialComponents/ShadowElevations (= 16.2.0) - - MaterialComponents/ShadowLayer (= 16.2.0) - - MaterialComponents/Slider (= 16.2.0) - - MaterialComponents/Snackbar (= 16.2.0) - - MaterialComponents/SpritedAnimationView (= 16.2.0) - - MaterialComponents/Switch (= 16.2.0) - - MaterialComponents/Typography (= 16.2.0) - - MaterialComponents/ActivityIndicator (16.2.0): + - MaterialComponents (16.3.0): + - MaterialComponents/ActivityIndicator (= 16.3.0) + - MaterialComponents/AnimationTiming (= 16.3.0) + - MaterialComponents/AppBar (= 16.3.0) + - MaterialComponents/ButtonBar (= 16.3.0) + - MaterialComponents/Buttons (= 16.3.0) + - MaterialComponents/CollectionCells (= 16.3.0) + - MaterialComponents/CollectionLayoutAttributes (= 16.3.0) + - MaterialComponents/Collections (= 16.3.0) + - MaterialComponents/Dialogs (= 16.3.0) + - MaterialComponents/FeatureHighlight (= 16.3.0) + - MaterialComponents/FlexibleHeader (= 16.3.0) + - MaterialComponents/FontDiskLoader (= 16.3.0) + - MaterialComponents/HeaderStackView (= 16.3.0) + - MaterialComponents/Ink (= 16.3.0) + - MaterialComponents/NavigationBar (= 16.3.0) + - MaterialComponents/OverlayWindow (= 16.3.0) + - MaterialComponents/PageControl (= 16.3.0) + - MaterialComponents/Palettes (= 16.3.0) + - MaterialComponents/private (= 16.3.0) + - MaterialComponents/ProgressView (= 16.3.0) + - MaterialComponents/RobotoFontLoader (= 16.3.0) + - MaterialComponents/ShadowElevations (= 16.3.0) + - MaterialComponents/ShadowLayer (= 16.3.0) + - MaterialComponents/Slider (= 16.3.0) + - MaterialComponents/Snackbar (= 16.3.0) + - MaterialComponents/SpritedAnimationView (= 16.3.0) + - MaterialComponents/Switch (= 16.3.0) + - MaterialComponents/Typography (= 16.3.0) + - MaterialComponents/ActivityIndicator (16.3.0): - MaterialComponents/private/RTL - - MaterialComponents/AnimationTiming (16.2.0) - - MaterialComponents/AppBar (16.2.0): + - MaterialComponents/AnimationTiming (16.3.0) + - MaterialComponents/AppBar (16.3.0): - MaterialComponents/FlexibleHeader - MaterialComponents/HeaderStackView - MaterialComponents/NavigationBar @@ -42,16 +42,16 @@ PODS: - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - - MaterialComponents/ButtonBar (16.2.0): + - MaterialComponents/ButtonBar (16.3.0): - MaterialComponents/Buttons - MaterialComponents/private/RTL - - MaterialComponents/Buttons (16.2.0): + - MaterialComponents/Buttons (16.3.0): - MaterialComponents/Ink - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - MDFTextAccessibility - - MaterialComponents/CollectionCells (16.2.0): + - MaterialComponents/CollectionCells (16.3.0): - MaterialComponents/CollectionLayoutAttributes - MaterialComponents/Ink - MaterialComponents/private/Icons/ic_check @@ -62,96 +62,98 @@ PODS: - MaterialComponents/private/Icons/ic_reorder - MaterialComponents/private/RTL - MaterialComponents/Typography - - MaterialComponents/CollectionLayoutAttributes (16.2.0) - - MaterialComponents/Collections (16.2.0): + - MaterialComponents/CollectionLayoutAttributes (16.3.0) + - MaterialComponents/Collections (16.3.0): - MaterialComponents/CollectionCells - MaterialComponents/CollectionLayoutAttributes - MaterialComponents/Ink - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - - MaterialComponents/Dialogs (16.2.0): + - MaterialComponents/Dialogs (16.3.0): - MaterialComponents/Buttons - MaterialComponents/private/KeyboardWatcher - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - - MaterialComponents/FeatureHighlight (16.2.0) - - MaterialComponents/FlexibleHeader (16.2.0): + - MaterialComponents/FeatureHighlight (16.3.0): + - MaterialComponents/Typography + - MDFTextAccessibility + - MaterialComponents/FlexibleHeader (16.3.0): - MDFTextAccessibility - - MaterialComponents/FontDiskLoader (16.2.0) - - MaterialComponents/HeaderStackView (16.2.0) - - MaterialComponents/Ink (16.2.0) - - MaterialComponents/NavigationBar (16.2.0): + - MaterialComponents/FontDiskLoader (16.3.0) + - MaterialComponents/HeaderStackView (16.3.0) + - MaterialComponents/Ink (16.3.0) + - MaterialComponents/NavigationBar (16.3.0): - MaterialComponents/ButtonBar - MaterialComponents/private/RTL - MaterialComponents/Typography - - MaterialComponents/OverlayWindow (16.2.0) - - MaterialComponents/PageControl (16.2.0) - - MaterialComponents/Palettes (16.2.0) - - MaterialComponents/private (16.2.0): - - MaterialComponents/private/Color (= 16.2.0) - - MaterialComponents/private/Icons (= 16.2.0) - - MaterialComponents/private/KeyboardWatcher (= 16.2.0) - - MaterialComponents/private/Overlay (= 16.2.0) - - MaterialComponents/private/RTL (= 16.2.0) - - MaterialComponents/private/ThumbTrack (= 16.2.0) - - MaterialComponents/private/Color (16.2.0) - - MaterialComponents/private/Icons (16.2.0): - - MaterialComponents/private/Icons/Base (= 16.2.0) - - MaterialComponents/private/Icons/ic_arrow_back (= 16.2.0) - - MaterialComponents/private/Icons/ic_check (= 16.2.0) - - MaterialComponents/private/Icons/ic_check_circle (= 16.2.0) - - MaterialComponents/private/Icons/ic_chevron_right (= 16.2.0) - - MaterialComponents/private/Icons/ic_info (= 16.2.0) - - MaterialComponents/private/Icons/ic_radio_button_unchecked (= 16.2.0) - - MaterialComponents/private/Icons/ic_reorder (= 16.2.0) - - MaterialComponents/private/Icons/Base (16.2.0) - - MaterialComponents/private/Icons/ic_arrow_back (16.2.0): + - MaterialComponents/OverlayWindow (16.3.0) + - MaterialComponents/PageControl (16.3.0) + - MaterialComponents/Palettes (16.3.0) + - MaterialComponents/private (16.3.0): + - MaterialComponents/private/Color (= 16.3.0) + - MaterialComponents/private/Icons (= 16.3.0) + - MaterialComponents/private/KeyboardWatcher (= 16.3.0) + - MaterialComponents/private/Overlay (= 16.3.0) + - MaterialComponents/private/RTL (= 16.3.0) + - MaterialComponents/private/ThumbTrack (= 16.3.0) + - MaterialComponents/private/Color (16.3.0) + - MaterialComponents/private/Icons (16.3.0): + - MaterialComponents/private/Icons/Base (= 16.3.0) + - MaterialComponents/private/Icons/ic_arrow_back (= 16.3.0) + - MaterialComponents/private/Icons/ic_check (= 16.3.0) + - MaterialComponents/private/Icons/ic_check_circle (= 16.3.0) + - MaterialComponents/private/Icons/ic_chevron_right (= 16.3.0) + - MaterialComponents/private/Icons/ic_info (= 16.3.0) + - MaterialComponents/private/Icons/ic_radio_button_unchecked (= 16.3.0) + - MaterialComponents/private/Icons/ic_reorder (= 16.3.0) + - MaterialComponents/private/Icons/Base (16.3.0) + - MaterialComponents/private/Icons/ic_arrow_back (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_check (16.2.0): + - MaterialComponents/private/Icons/ic_check (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_check_circle (16.2.0): + - MaterialComponents/private/Icons/ic_check_circle (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_chevron_right (16.2.0): + - MaterialComponents/private/Icons/ic_chevron_right (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_info (16.2.0): + - MaterialComponents/private/Icons/ic_info (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_radio_button_unchecked (16.2.0): + - MaterialComponents/private/Icons/ic_radio_button_unchecked (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_reorder (16.2.0): + - MaterialComponents/private/Icons/ic_reorder (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/KeyboardWatcher (16.2.0) - - MaterialComponents/private/Overlay (16.2.0) - - MaterialComponents/private/RTL (16.2.0) - - MaterialComponents/private/ThumbTrack (16.2.0): + - MaterialComponents/private/KeyboardWatcher (16.3.0) + - MaterialComponents/private/Overlay (16.3.0) + - MaterialComponents/private/RTL (16.3.0) + - MaterialComponents/private/ThumbTrack (16.3.0): - MaterialComponents/Ink - MaterialComponents/private/Color - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - - MaterialComponents/ProgressView (16.2.0): + - MaterialComponents/ProgressView (16.3.0): - MaterialComponents/private/RTL - - MaterialComponents/RobotoFontLoader (16.2.0): + - MaterialComponents/RobotoFontLoader (16.3.0): - MaterialComponents/FontDiskLoader - MaterialComponents/Typography - - MaterialComponents/ShadowElevations (16.2.0) - - MaterialComponents/ShadowLayer (16.2.0) - - MaterialComponents/Slider (16.2.0): + - MaterialComponents/ShadowElevations (16.3.0) + - MaterialComponents/ShadowLayer (16.3.0) + - MaterialComponents/Slider (16.3.0): - MaterialComponents/private/ThumbTrack - - MaterialComponents/Snackbar (16.2.0): + - MaterialComponents/Snackbar (16.3.0): - MaterialComponents/AnimationTiming - MaterialComponents/Buttons - MaterialComponents/OverlayWindow - MaterialComponents/private/KeyboardWatcher - MaterialComponents/private/Overlay - - MaterialComponents/SpritedAnimationView (16.2.0) - - MaterialComponents/Switch (16.2.0): + - MaterialComponents/SpritedAnimationView (16.3.0) + - MaterialComponents/Switch (16.3.0): - MaterialComponents/private/RTL - MaterialComponents/private/ThumbTrack - - MaterialComponents/Typography (16.2.0) - - MaterialComponentsCatalog (16.2.0): + - MaterialComponents/Typography (16.3.0) + - MaterialComponentsCatalog (16.3.0): - MaterialComponents - - MaterialComponentsUnitTests (16.2.0): + - MaterialComponentsUnitTests (16.3.0): - MaterialComponents - MDFTextAccessibility - MDFTextAccessibility (1.1.3) @@ -174,9 +176,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: CatalogByConvention: be55c2263132e4f9f59299ac8a528ee8715b3275 EarlGrey: 763d04569f96d910cf17e4fe5aa0d3842e07c0b4 - MaterialComponents: 4c676a55ac7ac303bc9df78ffe9598f848a3ee46 - MaterialComponentsCatalog: c66a111e2a412232c67b36b333c14f6cf746dcf5 - MaterialComponentsUnitTests: 9bdcf1262f7a911c832b1b9787133480f52015f4 + MaterialComponents: 1db6dde6f468cb24d5ed3f2d857a15b5942a3d27 + MaterialComponentsCatalog: 51e6b7852dc8a679c8d7ff434b45421a8b676472 + MaterialComponentsUnitTests: c548a83a7973727c70516c337e6b016518fff4f7 MDFTextAccessibility: f05246cc165f78733bfad535365807ec6fef9601 PODFILE CHECKSUM: 522d8a942cbc2d1a94e939e565f528cc83468b01 diff --git a/components/CollectionCells/src/MDCCollectionViewCell.m b/components/CollectionCells/src/MDCCollectionViewCell.m index 2d2ba085fe0..91eb5b85ee0 100644 --- a/components/CollectionCells/src/MDCCollectionViewCell.m +++ b/components/CollectionCells/src/MDCCollectionViewCell.m @@ -318,7 +318,8 @@ - (void)setEditing:(BOOL)editing animated:(BOOL)animated { } _shouldAnimateEditingViews = animated; _editing = editing; - [self updateInterfaceForEditing]; + [self setNeedsLayout]; + [self layoutIfNeeded]; } - (void)updateInterfaceForEditing { diff --git a/components/Collections/src/private/MDCCollectionViewStyler.m b/components/Collections/src/private/MDCCollectionViewStyler.m index 0abd513f25c..0263bb2a7d0 100644 --- a/components/Collections/src/private/MDCCollectionViewStyler.m +++ b/components/Collections/src/private/MDCCollectionViewStyler.m @@ -405,12 +405,15 @@ - (void)updateLayoutAnimated:(BOOL)animated { - (void)updateLayoutAnimated:(BOOL)animated completion:(void (^)(BOOL finished))completion { if (animated) { // Invalidate current layout while allowing animation to new layout. - [_collectionView performBatchUpdates:nil - completion:^(BOOL finished) { - if (completion) { - completion(finished); - } - }]; + [UIView animateWithDuration:0 + animations:^{ + [_collectionView.collectionViewLayout invalidateLayout]; + } + completion:^(BOOL finished) { + if (completion) { + completion(finished); + } + }]; } else { _shouldInvalidateLayout = YES; diff --git a/components/FeatureHighlight/src/MDCFeatureHighlightViewController.m b/components/FeatureHighlight/src/MDCFeatureHighlightViewController.m index 911765af476..738e7c2fdfd 100644 --- a/components/FeatureHighlight/src/MDCFeatureHighlightViewController.m +++ b/components/FeatureHighlight/src/MDCFeatureHighlightViewController.m @@ -19,9 +19,9 @@ #import "private/MDCFeatureHighlightAnimationController.h" #import "private/MDCFeatureHighlightView.h" -const CGFloat kMDCFeatureHighlightOuterHighlightAlpha = 0.96; +const CGFloat kMDCFeatureHighlightOuterHighlightAlpha = 0.96f; -static const CGFloat kMDCFeatureHighlightPulseAnimationInterval = 1.5; +static const CGFloat kMDCFeatureHighlightPulseAnimationInterval = 1.5f; @interface MDCFeatureHighlightViewController () @end diff --git a/components/FeatureHighlight/src/private/MDCFeatureHighlightAnimationController.m b/components/FeatureHighlight/src/private/MDCFeatureHighlightAnimationController.m index 2fb1d83d455..7e2e6878e50 100644 --- a/components/FeatureHighlight/src/private/MDCFeatureHighlightAnimationController.m +++ b/components/FeatureHighlight/src/private/MDCFeatureHighlightAnimationController.m @@ -18,8 +18,8 @@ #import "MDCFeatureHighlightView.h" -const CGFloat kMDCFeatureHighlightPresentationDuration = 0.35; -const CGFloat kMDCFeatureHighlightDismissalDuration = 0.2; +const NSTimeInterval kMDCFeatureHighlightPresentationDuration = 0.35f; +const NSTimeInterval kMDCFeatureHighlightDismissalDuration = 0.2f; @implementation MDCFeatureHighlightAnimationController diff --git a/components/FeatureHighlight/src/private/MDCFeatureHighlightView.h b/components/FeatureHighlight/src/private/MDCFeatureHighlightView.h index 1547460c314..ae7acd90b79 100644 --- a/components/FeatureHighlight/src/private/MDCFeatureHighlightView.h +++ b/components/FeatureHighlight/src/private/MDCFeatureHighlightView.h @@ -32,9 +32,9 @@ typedef void(^MDCFeatureHighlightInteractionBlock)(BOOL accepted); - (void)layoutAppearing; - (void)layoutDisappearing; -- (void)animateDiscover:(CGFloat)duration; -- (void)animateAccepted:(CGFloat)duration; -- (void)animateRejected:(CGFloat)duration; +- (void)animateDiscover:(NSTimeInterval)duration; +- (void)animateAccepted:(NSTimeInterval)duration; +- (void)animateRejected:(NSTimeInterval)duration; - (void)animatePulse; @end diff --git a/components/FeatureHighlight/src/private/MDCFeatureHighlightView.m b/components/FeatureHighlight/src/private/MDCFeatureHighlightView.m index 6cc833180ad..07ee1c463b0 100644 --- a/components/FeatureHighlight/src/private/MDCFeatureHighlightView.m +++ b/components/FeatureHighlight/src/private/MDCFeatureHighlightView.m @@ -20,20 +20,20 @@ #import "MDCFeatureHighlightLayer.h" #import "MDFTextAccessibility.h" -const CGFloat kMDCFeatureHighlightInnerRadius = 44.0; -const CGFloat kMDCFeatureHighlightInnerPadding = 20.0; -const CGFloat kMDCFeatureHighlightTextPadding = 40.0; -const CGFloat kMDCFeatureHighlightTextMaxWidth = 300.0; -const CGFloat kMDCFeatureHighlightConcentricBound = 88.0; -const CGFloat kMDCFeatureHighlightNonconcentricOffset = 20.0; -const CGFloat kMDCFeatureHighlightMaxTextHeight = 1000.0; -const CGFloat kMDCFeatureHighlightTitleFontSize = 20.0; +const CGFloat kMDCFeatureHighlightInnerRadius = 44.0f; +const CGFloat kMDCFeatureHighlightInnerPadding = 20.0f; +const CGFloat kMDCFeatureHighlightTextPadding = 40.0f; +const CGFloat kMDCFeatureHighlightTextMaxWidth = 300.0f; +const CGFloat kMDCFeatureHighlightConcentricBound = 88.0f; +const CGFloat kMDCFeatureHighlightNonconcentricOffset = 20.0f; +const CGFloat kMDCFeatureHighlightMaxTextHeight = 1000.0f; +const CGFloat kMDCFeatureHighlightTitleFontSize = 20.0f; // Animation consts -const CGFloat kMDCFeatureHighlightInnerRadiusFactor = 1.1; -const CGFloat kMDCFeatureHighlightOuterRadiusFactor = 1.125; -const CGFloat kMDCFeatureHighlightPulseRadiusFactor = 2.0; -const CGFloat kMDCFeatureHighlightPulseStartAlpha = 0.54; +const CGFloat kMDCFeatureHighlightInnerRadiusFactor = 1.1f; +const CGFloat kMDCFeatureHighlightOuterRadiusFactor = 1.125f; +const CGFloat kMDCFeatureHighlightPulseRadiusFactor = 2.0f; +const CGFloat kMDCFeatureHighlightPulseStartAlpha = 0.54f; @implementation MDCFeatureHighlightView { BOOL _forceConcentricLayout; @@ -156,7 +156,7 @@ - (void)setHighlightPoint:(CGPoint)highlightPoint { [self layoutIfNeeded]; } -- (void)animateDiscover:(CGFloat)duration { +- (void)animateDiscover:(NSTimeInterval)duration { [_innerLayer setFillColor:[_innerHighlightColor colorWithAlphaComponent:0].CGColor]; [_outerLayer setFillColor:[_outerHighlightColor colorWithAlphaComponent:0].CGColor]; @@ -204,7 +204,7 @@ - (void)animatePulse { [CATransaction commit]; } -- (void)animateAccepted:(CGFloat)duration { +- (void)animateAccepted:(NSTimeInterval)duration { CGPoint displayMaskCenter = CGPointMake(_displayedView.frame.size.width/2, _displayedView.frame.size.height/2); @@ -223,7 +223,7 @@ - (void)animateAccepted:(CGFloat)duration { _forceConcentricLayout = YES; } -- (void)animateRejected:(CGFloat)duration { +- (void)animateRejected:(NSTimeInterval)duration { CGPoint displayMaskCenter = CGPointMake(_displayedView.frame.size.width/2, _displayedView.frame.size.height/2); @@ -315,12 +315,13 @@ - (void)layoutSubviews { CGRect textFrames = CGRectUnion(_titleLabel.frame, _bodyLabel.frame); CGFloat distX = ABS(CGRectGetMidX(textFrames) - _highlightCenter.x) + textFrames.size.width/2; CGFloat distY = ABS(CGRectGetMidY(textFrames) - _highlightCenter.y) + textFrames.size.height/2; - _outerRadius = sqrt(distX * distX + distY * distY) + kMDCFeatureHighlightTextPadding; + _outerRadius = (float)sqrt(distX * distX + distY * distY) + kMDCFeatureHighlightTextPadding; } - (void)didTapView:(UITapGestureRecognizer *)tapGestureRecognizer { CGPoint pos = [tapGestureRecognizer locationInView:self]; - CGFloat dist = sqrt(pow(pos.x - _highlightPoint.x, 2) + pow(pos.y - _highlightPoint.y, 2)); + CGFloat dist = + (float)(sqrt(pow(pos.x - _highlightPoint.x, 2) + pow(pos.y - _highlightPoint.y, 2))); BOOL accepted = dist <= kMDCFeatureHighlightInnerRadius; if (self.interactionBlock) { diff --git a/components/Snackbar/src/MDCSnackbarManager.h b/components/Snackbar/src/MDCSnackbarManager.h index 76a9a8523e8..c925120db1d 100644 --- a/components/Snackbar/src/MDCSnackbarManager.h +++ b/components/Snackbar/src/MDCSnackbarManager.h @@ -41,6 +41,21 @@ */ + (void)showMessage:(MDCSnackbarMessage *)message; +/** + MDCSnackbarManager will display the messages in this view. + + Call this method to choose where in the view hierarchy snackbar messages will be presented. It is + only necessary to provide a host view if the default behavior is unable to find one on it's own, + most commonly when using MDCSnackbarManager inside an application extension. By default, if you use + MDCSnackbarManager without calling @c setPresentationHostView, the manager will attempt to find a + suitable view by stepping through the application windows. Explicitly providing a host view is only + required if you need to manually manage the view hierarchy, or are inside a UIApplication extension. + + @note This method must be called from the main thread. + @note Calling setPresentationHostView will not change the parent of the currently visible message. + */ ++ (void)setPresentationHostView:(UIView *)hostView; + /** Bypasses showing the messages of the given @c category. diff --git a/components/Snackbar/src/MDCSnackbarManager.m b/components/Snackbar/src/MDCSnackbarManager.m index 1e431bc8011..5f92073f0b0 100644 --- a/components/Snackbar/src/MDCSnackbarManager.m +++ b/components/Snackbar/src/MDCSnackbarManager.m @@ -53,6 +53,11 @@ @interface MDCSnackbarManagerInternal : NSObject */ @property(nonatomic) MDCSnackbarOverlayView *overlayView; +/** + The view which contains the overlayView. + */ +@property(nonatomic) UIView *presentationHostView; + /** The currently-showing snackbar. */ @@ -286,10 +291,13 @@ - (BOOL)isSnackbarTransient:(MDCSnackbarMessageView *)snackbarView { - (void)activateOverlay:(UIView *)overlay { UIWindow *window = [self bestGuessWindow]; + UIView *targetView = nil; - // If the application's window is an overlay window, take advantage of it. Otherwise, just add our - // overlay view into the main view controller's hierarchy. - if ([window isKindOfClass:[MDCOverlayWindow class]]) { + if (self.presentationHostView) { + targetView = self.presentationHostView; + } else if ([window isKindOfClass:[MDCOverlayWindow class]]) { + // If the application's window is an overlay window, take advantage of it. Otherwise, just add + // our overlay view into the main view controller's hierarchy. MDCOverlayWindow *overlayWindow = (MDCOverlayWindow *)window; [overlayWindow activateOverlay:overlay withLevel:UIWindowLevelNormal]; } else { @@ -298,8 +306,10 @@ - (void)activateOverlay:(UIView *)overlay { while ([topViewController presentedViewController]) { topViewController = [topViewController presentedViewController]; } - UIView *targetView = [topViewController view]; + targetView = [topViewController view]; + } + if (targetView) { overlay.frame = targetView.bounds; overlay.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); overlay.translatesAutoresizingMaskIntoConstraints = YES; @@ -473,6 +483,13 @@ + (void)showMessage:(MDCSnackbarMessage *)inputMessage { }); } ++ (void)setPresentationHostView:(UIView *)hostView { + NSAssert([NSThread isMainThread], @"setPresentationHostView must be called on main thread."); + + MDCSnackbarManagerInternal *manager = [MDCSnackbarManagerInternal sharedInstance]; + manager.presentationHostView = hostView; +} + + (void)dismissAndCallCompletionBlocksWithCategory:(NSString *)category { // Snag a copy now, we'll use that internally. NSString *categoryToDismiss = [category copy]; @@ -485,7 +502,7 @@ + (void)dismissAndCallCompletionBlocksWithCategory:(NSString *)category { } + (void)setBottomOffset:(CGFloat)offset { - NSParameterAssert([NSThread isMainThread]); + NSAssert([NSThread isMainThread], @"setBottomOffset must be called on main thread."); MDCSnackbarManagerInternal *manager = [MDCSnackbarManagerInternal sharedInstance]; manager.overlayView.bottomOffset = offset; diff --git a/demos/Bare/Podfile.lock b/demos/Bare/Podfile.lock index 3481c4a1107..1614fa49f7c 100644 --- a/demos/Bare/Podfile.lock +++ b/demos/Bare/Podfile.lock @@ -1,37 +1,37 @@ PODS: - - MaterialComponents (16.2.0): - - MaterialComponents/ActivityIndicator (= 16.2.0) - - MaterialComponents/AnimationTiming (= 16.2.0) - - MaterialComponents/AppBar (= 16.2.0) - - MaterialComponents/ButtonBar (= 16.2.0) - - MaterialComponents/Buttons (= 16.2.0) - - MaterialComponents/CollectionCells (= 16.2.0) - - MaterialComponents/CollectionLayoutAttributes (= 16.2.0) - - MaterialComponents/Collections (= 16.2.0) - - MaterialComponents/Dialogs (= 16.2.0) - - MaterialComponents/FeatureHighlight (= 16.2.0) - - MaterialComponents/FlexibleHeader (= 16.2.0) - - MaterialComponents/FontDiskLoader (= 16.2.0) - - MaterialComponents/HeaderStackView (= 16.2.0) - - MaterialComponents/Ink (= 16.2.0) - - MaterialComponents/NavigationBar (= 16.2.0) - - MaterialComponents/OverlayWindow (= 16.2.0) - - MaterialComponents/PageControl (= 16.2.0) - - MaterialComponents/Palettes (= 16.2.0) - - MaterialComponents/private (= 16.2.0) - - MaterialComponents/ProgressView (= 16.2.0) - - MaterialComponents/RobotoFontLoader (= 16.2.0) - - MaterialComponents/ShadowElevations (= 16.2.0) - - MaterialComponents/ShadowLayer (= 16.2.0) - - MaterialComponents/Slider (= 16.2.0) - - MaterialComponents/Snackbar (= 16.2.0) - - MaterialComponents/SpritedAnimationView (= 16.2.0) - - MaterialComponents/Switch (= 16.2.0) - - MaterialComponents/Typography (= 16.2.0) - - MaterialComponents/ActivityIndicator (16.2.0): + - MaterialComponents (16.3.0): + - MaterialComponents/ActivityIndicator (= 16.3.0) + - MaterialComponents/AnimationTiming (= 16.3.0) + - MaterialComponents/AppBar (= 16.3.0) + - MaterialComponents/ButtonBar (= 16.3.0) + - MaterialComponents/Buttons (= 16.3.0) + - MaterialComponents/CollectionCells (= 16.3.0) + - MaterialComponents/CollectionLayoutAttributes (= 16.3.0) + - MaterialComponents/Collections (= 16.3.0) + - MaterialComponents/Dialogs (= 16.3.0) + - MaterialComponents/FeatureHighlight (= 16.3.0) + - MaterialComponents/FlexibleHeader (= 16.3.0) + - MaterialComponents/FontDiskLoader (= 16.3.0) + - MaterialComponents/HeaderStackView (= 16.3.0) + - MaterialComponents/Ink (= 16.3.0) + - MaterialComponents/NavigationBar (= 16.3.0) + - MaterialComponents/OverlayWindow (= 16.3.0) + - MaterialComponents/PageControl (= 16.3.0) + - MaterialComponents/Palettes (= 16.3.0) + - MaterialComponents/private (= 16.3.0) + - MaterialComponents/ProgressView (= 16.3.0) + - MaterialComponents/RobotoFontLoader (= 16.3.0) + - MaterialComponents/ShadowElevations (= 16.3.0) + - MaterialComponents/ShadowLayer (= 16.3.0) + - MaterialComponents/Slider (= 16.3.0) + - MaterialComponents/Snackbar (= 16.3.0) + - MaterialComponents/SpritedAnimationView (= 16.3.0) + - MaterialComponents/Switch (= 16.3.0) + - MaterialComponents/Typography (= 16.3.0) + - MaterialComponents/ActivityIndicator (16.3.0): - MaterialComponents/private/RTL - - MaterialComponents/AnimationTiming (16.2.0) - - MaterialComponents/AppBar (16.2.0): + - MaterialComponents/AnimationTiming (16.3.0) + - MaterialComponents/AppBar (16.3.0): - MaterialComponents/FlexibleHeader - MaterialComponents/HeaderStackView - MaterialComponents/NavigationBar @@ -40,16 +40,16 @@ PODS: - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - - MaterialComponents/ButtonBar (16.2.0): + - MaterialComponents/ButtonBar (16.3.0): - MaterialComponents/Buttons - MaterialComponents/private/RTL - - MaterialComponents/Buttons (16.2.0): + - MaterialComponents/Buttons (16.3.0): - MaterialComponents/Ink - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - MDFTextAccessibility - - MaterialComponents/CollectionCells (16.2.0): + - MaterialComponents/CollectionCells (16.3.0): - MaterialComponents/CollectionLayoutAttributes - MaterialComponents/Ink - MaterialComponents/private/Icons/ic_check @@ -60,93 +60,95 @@ PODS: - MaterialComponents/private/Icons/ic_reorder - MaterialComponents/private/RTL - MaterialComponents/Typography - - MaterialComponents/CollectionLayoutAttributes (16.2.0) - - MaterialComponents/Collections (16.2.0): + - MaterialComponents/CollectionLayoutAttributes (16.3.0) + - MaterialComponents/Collections (16.3.0): - MaterialComponents/CollectionCells - MaterialComponents/CollectionLayoutAttributes - MaterialComponents/Ink - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - - MaterialComponents/Dialogs (16.2.0): + - MaterialComponents/Dialogs (16.3.0): - MaterialComponents/Buttons - MaterialComponents/private/KeyboardWatcher - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - - MaterialComponents/FeatureHighlight (16.2.0) - - MaterialComponents/FlexibleHeader (16.2.0): + - MaterialComponents/FeatureHighlight (16.3.0): + - MaterialComponents/Typography + - MDFTextAccessibility + - MaterialComponents/FlexibleHeader (16.3.0): - MDFTextAccessibility - - MaterialComponents/FontDiskLoader (16.2.0) - - MaterialComponents/HeaderStackView (16.2.0) - - MaterialComponents/Ink (16.2.0) - - MaterialComponents/NavigationBar (16.2.0): + - MaterialComponents/FontDiskLoader (16.3.0) + - MaterialComponents/HeaderStackView (16.3.0) + - MaterialComponents/Ink (16.3.0) + - MaterialComponents/NavigationBar (16.3.0): - MaterialComponents/ButtonBar - MaterialComponents/private/RTL - MaterialComponents/Typography - - MaterialComponents/OverlayWindow (16.2.0) - - MaterialComponents/PageControl (16.2.0) - - MaterialComponents/Palettes (16.2.0) - - MaterialComponents/private (16.2.0): - - MaterialComponents/private/Color (= 16.2.0) - - MaterialComponents/private/Icons (= 16.2.0) - - MaterialComponents/private/KeyboardWatcher (= 16.2.0) - - MaterialComponents/private/Overlay (= 16.2.0) - - MaterialComponents/private/RTL (= 16.2.0) - - MaterialComponents/private/ThumbTrack (= 16.2.0) - - MaterialComponents/private/Color (16.2.0) - - MaterialComponents/private/Icons (16.2.0): - - MaterialComponents/private/Icons/Base (= 16.2.0) - - MaterialComponents/private/Icons/ic_arrow_back (= 16.2.0) - - MaterialComponents/private/Icons/ic_check (= 16.2.0) - - MaterialComponents/private/Icons/ic_check_circle (= 16.2.0) - - MaterialComponents/private/Icons/ic_chevron_right (= 16.2.0) - - MaterialComponents/private/Icons/ic_info (= 16.2.0) - - MaterialComponents/private/Icons/ic_radio_button_unchecked (= 16.2.0) - - MaterialComponents/private/Icons/ic_reorder (= 16.2.0) - - MaterialComponents/private/Icons/Base (16.2.0) - - MaterialComponents/private/Icons/ic_arrow_back (16.2.0): + - MaterialComponents/OverlayWindow (16.3.0) + - MaterialComponents/PageControl (16.3.0) + - MaterialComponents/Palettes (16.3.0) + - MaterialComponents/private (16.3.0): + - MaterialComponents/private/Color (= 16.3.0) + - MaterialComponents/private/Icons (= 16.3.0) + - MaterialComponents/private/KeyboardWatcher (= 16.3.0) + - MaterialComponents/private/Overlay (= 16.3.0) + - MaterialComponents/private/RTL (= 16.3.0) + - MaterialComponents/private/ThumbTrack (= 16.3.0) + - MaterialComponents/private/Color (16.3.0) + - MaterialComponents/private/Icons (16.3.0): + - MaterialComponents/private/Icons/Base (= 16.3.0) + - MaterialComponents/private/Icons/ic_arrow_back (= 16.3.0) + - MaterialComponents/private/Icons/ic_check (= 16.3.0) + - MaterialComponents/private/Icons/ic_check_circle (= 16.3.0) + - MaterialComponents/private/Icons/ic_chevron_right (= 16.3.0) + - MaterialComponents/private/Icons/ic_info (= 16.3.0) + - MaterialComponents/private/Icons/ic_radio_button_unchecked (= 16.3.0) + - MaterialComponents/private/Icons/ic_reorder (= 16.3.0) + - MaterialComponents/private/Icons/Base (16.3.0) + - MaterialComponents/private/Icons/ic_arrow_back (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_check (16.2.0): + - MaterialComponents/private/Icons/ic_check (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_check_circle (16.2.0): + - MaterialComponents/private/Icons/ic_check_circle (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_chevron_right (16.2.0): + - MaterialComponents/private/Icons/ic_chevron_right (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_info (16.2.0): + - MaterialComponents/private/Icons/ic_info (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_radio_button_unchecked (16.2.0): + - MaterialComponents/private/Icons/ic_radio_button_unchecked (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_reorder (16.2.0): + - MaterialComponents/private/Icons/ic_reorder (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/KeyboardWatcher (16.2.0) - - MaterialComponents/private/Overlay (16.2.0) - - MaterialComponents/private/RTL (16.2.0) - - MaterialComponents/private/ThumbTrack (16.2.0): + - MaterialComponents/private/KeyboardWatcher (16.3.0) + - MaterialComponents/private/Overlay (16.3.0) + - MaterialComponents/private/RTL (16.3.0) + - MaterialComponents/private/ThumbTrack (16.3.0): - MaterialComponents/Ink - MaterialComponents/private/Color - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - - MaterialComponents/ProgressView (16.2.0): + - MaterialComponents/ProgressView (16.3.0): - MaterialComponents/private/RTL - - MaterialComponents/RobotoFontLoader (16.2.0): + - MaterialComponents/RobotoFontLoader (16.3.0): - MaterialComponents/FontDiskLoader - MaterialComponents/Typography - - MaterialComponents/ShadowElevations (16.2.0) - - MaterialComponents/ShadowLayer (16.2.0) - - MaterialComponents/Slider (16.2.0): + - MaterialComponents/ShadowElevations (16.3.0) + - MaterialComponents/ShadowLayer (16.3.0) + - MaterialComponents/Slider (16.3.0): - MaterialComponents/private/ThumbTrack - - MaterialComponents/Snackbar (16.2.0): + - MaterialComponents/Snackbar (16.3.0): - MaterialComponents/AnimationTiming - MaterialComponents/Buttons - MaterialComponents/OverlayWindow - MaterialComponents/private/KeyboardWatcher - MaterialComponents/private/Overlay - - MaterialComponents/SpritedAnimationView (16.2.0) - - MaterialComponents/Switch (16.2.0): + - MaterialComponents/SpritedAnimationView (16.3.0) + - MaterialComponents/Switch (16.3.0): - MaterialComponents/private/RTL - MaterialComponents/private/ThumbTrack - - MaterialComponents/Typography (16.2.0) + - MaterialComponents/Typography (16.3.0) - MDFTextAccessibility (1.1.3) DEPENDENCIES: @@ -157,7 +159,7 @@ EXTERNAL SOURCES: :path: "../../" SPEC CHECKSUMS: - MaterialComponents: 4c676a55ac7ac303bc9df78ffe9598f848a3ee46 + MaterialComponents: 1db6dde6f468cb24d5ed3f2d857a15b5942a3d27 MDFTextAccessibility: f05246cc165f78733bfad535365807ec6fef9601 PODFILE CHECKSUM: 44e7c616a05bb4ce24db557c3de4bfbe915c2f56 diff --git a/demos/Pesto/Podfile.lock b/demos/Pesto/Podfile.lock index 09d016d54dc..cb9a9a13820 100644 --- a/demos/Pesto/Podfile.lock +++ b/demos/Pesto/Podfile.lock @@ -1,6 +1,6 @@ PODS: - - MaterialComponents/AnimationTiming (16.2.0) - - MaterialComponents/AppBar (16.2.0): + - MaterialComponents/AnimationTiming (16.3.0) + - MaterialComponents/AppBar (16.3.0): - MaterialComponents/FlexibleHeader - MaterialComponents/HeaderStackView - MaterialComponents/NavigationBar @@ -9,16 +9,16 @@ PODS: - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - - MaterialComponents/ButtonBar (16.2.0): + - MaterialComponents/ButtonBar (16.3.0): - MaterialComponents/Buttons - MaterialComponents/private/RTL - - MaterialComponents/Buttons (16.2.0): + - MaterialComponents/Buttons (16.3.0): - MaterialComponents/Ink - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - MDFTextAccessibility - - MaterialComponents/CollectionCells (16.2.0): + - MaterialComponents/CollectionCells (16.3.0): - MaterialComponents/CollectionLayoutAttributes - MaterialComponents/Ink - MaterialComponents/private/Icons/ic_check @@ -29,56 +29,56 @@ PODS: - MaterialComponents/private/Icons/ic_reorder - MaterialComponents/private/RTL - MaterialComponents/Typography - - MaterialComponents/CollectionLayoutAttributes (16.2.0) - - MaterialComponents/Collections (16.2.0): + - MaterialComponents/CollectionLayoutAttributes (16.3.0) + - MaterialComponents/Collections (16.3.0): - MaterialComponents/CollectionCells - MaterialComponents/CollectionLayoutAttributes - MaterialComponents/Ink - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - - MaterialComponents/FlexibleHeader (16.2.0): + - MaterialComponents/FlexibleHeader (16.3.0): - MDFTextAccessibility - - MaterialComponents/FontDiskLoader (16.2.0) - - MaterialComponents/HeaderStackView (16.2.0) - - MaterialComponents/Ink (16.2.0) - - MaterialComponents/NavigationBar (16.2.0): + - MaterialComponents/FontDiskLoader (16.3.0) + - MaterialComponents/HeaderStackView (16.3.0) + - MaterialComponents/Ink (16.3.0) + - MaterialComponents/NavigationBar (16.3.0): - MaterialComponents/ButtonBar - MaterialComponents/private/RTL - MaterialComponents/Typography - - MaterialComponents/private/Color (16.2.0) - - MaterialComponents/private/Icons/Base (16.2.0) - - MaterialComponents/private/Icons/ic_arrow_back (16.2.0): + - MaterialComponents/private/Color (16.3.0) + - MaterialComponents/private/Icons/Base (16.3.0) + - MaterialComponents/private/Icons/ic_arrow_back (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_check (16.2.0): + - MaterialComponents/private/Icons/ic_check (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_check_circle (16.2.0): + - MaterialComponents/private/Icons/ic_check_circle (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_chevron_right (16.2.0): + - MaterialComponents/private/Icons/ic_chevron_right (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_info (16.2.0): + - MaterialComponents/private/Icons/ic_info (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_radio_button_unchecked (16.2.0): + - MaterialComponents/private/Icons/ic_radio_button_unchecked (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_reorder (16.2.0): + - MaterialComponents/private/Icons/ic_reorder (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/RTL (16.2.0) - - MaterialComponents/private/ThumbTrack (16.2.0): + - MaterialComponents/private/RTL (16.3.0) + - MaterialComponents/private/ThumbTrack (16.3.0): - MaterialComponents/Ink - MaterialComponents/private/Color - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - - MaterialComponents/RobotoFontLoader (16.2.0): + - MaterialComponents/RobotoFontLoader (16.3.0): - MaterialComponents/FontDiskLoader - MaterialComponents/Typography - - MaterialComponents/ShadowElevations (16.2.0) - - MaterialComponents/ShadowLayer (16.2.0) - - MaterialComponents/SpritedAnimationView (16.2.0) - - MaterialComponents/Switch (16.2.0): + - MaterialComponents/ShadowElevations (16.3.0) + - MaterialComponents/ShadowLayer (16.3.0) + - MaterialComponents/SpritedAnimationView (16.3.0) + - MaterialComponents/Switch (16.3.0): - MaterialComponents/private/RTL - MaterialComponents/private/ThumbTrack - - MaterialComponents/Typography (16.2.0) + - MaterialComponents/Typography (16.3.0) - MDFTextAccessibility (1.1.3) DEPENDENCIES: @@ -99,7 +99,7 @@ EXTERNAL SOURCES: :path: "../../" SPEC CHECKSUMS: - MaterialComponents: 4c676a55ac7ac303bc9df78ffe9598f848a3ee46 + MaterialComponents: 1db6dde6f468cb24d5ed3f2d857a15b5942a3d27 MDFTextAccessibility: f05246cc165f78733bfad535365807ec6fef9601 PODFILE CHECKSUM: efdcd579d4fc62b798baaefabe7ac086d4413386 diff --git a/demos/Shrine/Podfile.lock b/demos/Shrine/Podfile.lock index f10b8374728..e02ecacdbf5 100644 --- a/demos/Shrine/Podfile.lock +++ b/demos/Shrine/Podfile.lock @@ -1,37 +1,37 @@ PODS: - - MaterialComponents (16.2.0): - - MaterialComponents/ActivityIndicator (= 16.2.0) - - MaterialComponents/AnimationTiming (= 16.2.0) - - MaterialComponents/AppBar (= 16.2.0) - - MaterialComponents/ButtonBar (= 16.2.0) - - MaterialComponents/Buttons (= 16.2.0) - - MaterialComponents/CollectionCells (= 16.2.0) - - MaterialComponents/CollectionLayoutAttributes (= 16.2.0) - - MaterialComponents/Collections (= 16.2.0) - - MaterialComponents/Dialogs (= 16.2.0) - - MaterialComponents/FeatureHighlight (= 16.2.0) - - MaterialComponents/FlexibleHeader (= 16.2.0) - - MaterialComponents/FontDiskLoader (= 16.2.0) - - MaterialComponents/HeaderStackView (= 16.2.0) - - MaterialComponents/Ink (= 16.2.0) - - MaterialComponents/NavigationBar (= 16.2.0) - - MaterialComponents/OverlayWindow (= 16.2.0) - - MaterialComponents/PageControl (= 16.2.0) - - MaterialComponents/Palettes (= 16.2.0) - - MaterialComponents/private (= 16.2.0) - - MaterialComponents/ProgressView (= 16.2.0) - - MaterialComponents/RobotoFontLoader (= 16.2.0) - - MaterialComponents/ShadowElevations (= 16.2.0) - - MaterialComponents/ShadowLayer (= 16.2.0) - - MaterialComponents/Slider (= 16.2.0) - - MaterialComponents/Snackbar (= 16.2.0) - - MaterialComponents/SpritedAnimationView (= 16.2.0) - - MaterialComponents/Switch (= 16.2.0) - - MaterialComponents/Typography (= 16.2.0) - - MaterialComponents/ActivityIndicator (16.2.0): + - MaterialComponents (16.3.0): + - MaterialComponents/ActivityIndicator (= 16.3.0) + - MaterialComponents/AnimationTiming (= 16.3.0) + - MaterialComponents/AppBar (= 16.3.0) + - MaterialComponents/ButtonBar (= 16.3.0) + - MaterialComponents/Buttons (= 16.3.0) + - MaterialComponents/CollectionCells (= 16.3.0) + - MaterialComponents/CollectionLayoutAttributes (= 16.3.0) + - MaterialComponents/Collections (= 16.3.0) + - MaterialComponents/Dialogs (= 16.3.0) + - MaterialComponents/FeatureHighlight (= 16.3.0) + - MaterialComponents/FlexibleHeader (= 16.3.0) + - MaterialComponents/FontDiskLoader (= 16.3.0) + - MaterialComponents/HeaderStackView (= 16.3.0) + - MaterialComponents/Ink (= 16.3.0) + - MaterialComponents/NavigationBar (= 16.3.0) + - MaterialComponents/OverlayWindow (= 16.3.0) + - MaterialComponents/PageControl (= 16.3.0) + - MaterialComponents/Palettes (= 16.3.0) + - MaterialComponents/private (= 16.3.0) + - MaterialComponents/ProgressView (= 16.3.0) + - MaterialComponents/RobotoFontLoader (= 16.3.0) + - MaterialComponents/ShadowElevations (= 16.3.0) + - MaterialComponents/ShadowLayer (= 16.3.0) + - MaterialComponents/Slider (= 16.3.0) + - MaterialComponents/Snackbar (= 16.3.0) + - MaterialComponents/SpritedAnimationView (= 16.3.0) + - MaterialComponents/Switch (= 16.3.0) + - MaterialComponents/Typography (= 16.3.0) + - MaterialComponents/ActivityIndicator (16.3.0): - MaterialComponents/private/RTL - - MaterialComponents/AnimationTiming (16.2.0) - - MaterialComponents/AppBar (16.2.0): + - MaterialComponents/AnimationTiming (16.3.0) + - MaterialComponents/AppBar (16.3.0): - MaterialComponents/FlexibleHeader - MaterialComponents/HeaderStackView - MaterialComponents/NavigationBar @@ -40,16 +40,16 @@ PODS: - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - - MaterialComponents/ButtonBar (16.2.0): + - MaterialComponents/ButtonBar (16.3.0): - MaterialComponents/Buttons - MaterialComponents/private/RTL - - MaterialComponents/Buttons (16.2.0): + - MaterialComponents/Buttons (16.3.0): - MaterialComponents/Ink - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - MDFTextAccessibility - - MaterialComponents/CollectionCells (16.2.0): + - MaterialComponents/CollectionCells (16.3.0): - MaterialComponents/CollectionLayoutAttributes - MaterialComponents/Ink - MaterialComponents/private/Icons/ic_check @@ -60,93 +60,95 @@ PODS: - MaterialComponents/private/Icons/ic_reorder - MaterialComponents/private/RTL - MaterialComponents/Typography - - MaterialComponents/CollectionLayoutAttributes (16.2.0) - - MaterialComponents/Collections (16.2.0): + - MaterialComponents/CollectionLayoutAttributes (16.3.0) + - MaterialComponents/Collections (16.3.0): - MaterialComponents/CollectionCells - MaterialComponents/CollectionLayoutAttributes - MaterialComponents/Ink - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - - MaterialComponents/Dialogs (16.2.0): + - MaterialComponents/Dialogs (16.3.0): - MaterialComponents/Buttons - MaterialComponents/private/KeyboardWatcher - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - - MaterialComponents/FeatureHighlight (16.2.0) - - MaterialComponents/FlexibleHeader (16.2.0): + - MaterialComponents/FeatureHighlight (16.3.0): + - MaterialComponents/Typography + - MDFTextAccessibility + - MaterialComponents/FlexibleHeader (16.3.0): - MDFTextAccessibility - - MaterialComponents/FontDiskLoader (16.2.0) - - MaterialComponents/HeaderStackView (16.2.0) - - MaterialComponents/Ink (16.2.0) - - MaterialComponents/NavigationBar (16.2.0): + - MaterialComponents/FontDiskLoader (16.3.0) + - MaterialComponents/HeaderStackView (16.3.0) + - MaterialComponents/Ink (16.3.0) + - MaterialComponents/NavigationBar (16.3.0): - MaterialComponents/ButtonBar - MaterialComponents/private/RTL - MaterialComponents/Typography - - MaterialComponents/OverlayWindow (16.2.0) - - MaterialComponents/PageControl (16.2.0) - - MaterialComponents/Palettes (16.2.0) - - MaterialComponents/private (16.2.0): - - MaterialComponents/private/Color (= 16.2.0) - - MaterialComponents/private/Icons (= 16.2.0) - - MaterialComponents/private/KeyboardWatcher (= 16.2.0) - - MaterialComponents/private/Overlay (= 16.2.0) - - MaterialComponents/private/RTL (= 16.2.0) - - MaterialComponents/private/ThumbTrack (= 16.2.0) - - MaterialComponents/private/Color (16.2.0) - - MaterialComponents/private/Icons (16.2.0): - - MaterialComponents/private/Icons/Base (= 16.2.0) - - MaterialComponents/private/Icons/ic_arrow_back (= 16.2.0) - - MaterialComponents/private/Icons/ic_check (= 16.2.0) - - MaterialComponents/private/Icons/ic_check_circle (= 16.2.0) - - MaterialComponents/private/Icons/ic_chevron_right (= 16.2.0) - - MaterialComponents/private/Icons/ic_info (= 16.2.0) - - MaterialComponents/private/Icons/ic_radio_button_unchecked (= 16.2.0) - - MaterialComponents/private/Icons/ic_reorder (= 16.2.0) - - MaterialComponents/private/Icons/Base (16.2.0) - - MaterialComponents/private/Icons/ic_arrow_back (16.2.0): + - MaterialComponents/OverlayWindow (16.3.0) + - MaterialComponents/PageControl (16.3.0) + - MaterialComponents/Palettes (16.3.0) + - MaterialComponents/private (16.3.0): + - MaterialComponents/private/Color (= 16.3.0) + - MaterialComponents/private/Icons (= 16.3.0) + - MaterialComponents/private/KeyboardWatcher (= 16.3.0) + - MaterialComponents/private/Overlay (= 16.3.0) + - MaterialComponents/private/RTL (= 16.3.0) + - MaterialComponents/private/ThumbTrack (= 16.3.0) + - MaterialComponents/private/Color (16.3.0) + - MaterialComponents/private/Icons (16.3.0): + - MaterialComponents/private/Icons/Base (= 16.3.0) + - MaterialComponents/private/Icons/ic_arrow_back (= 16.3.0) + - MaterialComponents/private/Icons/ic_check (= 16.3.0) + - MaterialComponents/private/Icons/ic_check_circle (= 16.3.0) + - MaterialComponents/private/Icons/ic_chevron_right (= 16.3.0) + - MaterialComponents/private/Icons/ic_info (= 16.3.0) + - MaterialComponents/private/Icons/ic_radio_button_unchecked (= 16.3.0) + - MaterialComponents/private/Icons/ic_reorder (= 16.3.0) + - MaterialComponents/private/Icons/Base (16.3.0) + - MaterialComponents/private/Icons/ic_arrow_back (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_check (16.2.0): + - MaterialComponents/private/Icons/ic_check (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_check_circle (16.2.0): + - MaterialComponents/private/Icons/ic_check_circle (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_chevron_right (16.2.0): + - MaterialComponents/private/Icons/ic_chevron_right (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_info (16.2.0): + - MaterialComponents/private/Icons/ic_info (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_radio_button_unchecked (16.2.0): + - MaterialComponents/private/Icons/ic_radio_button_unchecked (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/Icons/ic_reorder (16.2.0): + - MaterialComponents/private/Icons/ic_reorder (16.3.0): - MaterialComponents/private/Icons/Base - - MaterialComponents/private/KeyboardWatcher (16.2.0) - - MaterialComponents/private/Overlay (16.2.0) - - MaterialComponents/private/RTL (16.2.0) - - MaterialComponents/private/ThumbTrack (16.2.0): + - MaterialComponents/private/KeyboardWatcher (16.3.0) + - MaterialComponents/private/Overlay (16.3.0) + - MaterialComponents/private/RTL (16.3.0) + - MaterialComponents/private/ThumbTrack (16.3.0): - MaterialComponents/Ink - MaterialComponents/private/Color - MaterialComponents/ShadowElevations - MaterialComponents/ShadowLayer - MaterialComponents/Typography - - MaterialComponents/ProgressView (16.2.0): + - MaterialComponents/ProgressView (16.3.0): - MaterialComponents/private/RTL - - MaterialComponents/RobotoFontLoader (16.2.0): + - MaterialComponents/RobotoFontLoader (16.3.0): - MaterialComponents/FontDiskLoader - MaterialComponents/Typography - - MaterialComponents/ShadowElevations (16.2.0) - - MaterialComponents/ShadowLayer (16.2.0) - - MaterialComponents/Slider (16.2.0): + - MaterialComponents/ShadowElevations (16.3.0) + - MaterialComponents/ShadowLayer (16.3.0) + - MaterialComponents/Slider (16.3.0): - MaterialComponents/private/ThumbTrack - - MaterialComponents/Snackbar (16.2.0): + - MaterialComponents/Snackbar (16.3.0): - MaterialComponents/AnimationTiming - MaterialComponents/Buttons - MaterialComponents/OverlayWindow - MaterialComponents/private/KeyboardWatcher - MaterialComponents/private/Overlay - - MaterialComponents/SpritedAnimationView (16.2.0) - - MaterialComponents/Switch (16.2.0): + - MaterialComponents/SpritedAnimationView (16.3.0) + - MaterialComponents/Switch (16.3.0): - MaterialComponents/private/RTL - MaterialComponents/private/ThumbTrack - - MaterialComponents/Typography (16.2.0) + - MaterialComponents/Typography (16.3.0) - MDFTextAccessibility (1.1.3) DEPENDENCIES: @@ -157,7 +159,7 @@ EXTERNAL SOURCES: :path: "../../" SPEC CHECKSUMS: - MaterialComponents: 4c676a55ac7ac303bc9df78ffe9598f848a3ee46 + MaterialComponents: 1db6dde6f468cb24d5ed3f2d857a15b5942a3d27 MDFTextAccessibility: f05246cc165f78733bfad535365807ec6fef9601 PODFILE CHECKSUM: a99960e6ab1c7128ff71f25989ec0d58da87580e diff --git a/demos/Shrine/Shrine/AppDelegate.swift b/demos/Shrine/Shrine/AppDelegate.swift index ebfe0bf9af5..c1c8748d34f 100644 --- a/demos/Shrine/Shrine/AppDelegate.swift +++ b/demos/Shrine/Shrine/AppDelegate.swift @@ -15,7 +15,7 @@ */ import UIKit -import MaterialComponents +import MaterialComponents.MaterialIcons_ic_arrow_back @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { diff --git a/demos/Shrine/Shrine/ShrineCollectionViewCell.swift b/demos/Shrine/Shrine/ShrineCollectionViewCell.swift index 50c16da1181..100ea1b171e 100644 --- a/demos/Shrine/Shrine/ShrineCollectionViewCell.swift +++ b/demos/Shrine/Shrine/ShrineCollectionViewCell.swift @@ -15,7 +15,6 @@ */ import UIKit -import MaterialComponents class ShrineCollectionViewCell: UICollectionViewCell { diff --git a/demos/Shrine/Shrine/ShrineCollectionViewController.swift b/demos/Shrine/Shrine/ShrineCollectionViewController.swift index ed32a52aafe..a7821099ff9 100644 --- a/demos/Shrine/Shrine/ShrineCollectionViewController.swift +++ b/demos/Shrine/Shrine/ShrineCollectionViewController.swift @@ -15,7 +15,7 @@ */ import UIKit -import MaterialComponents +import MaterialComponents.MaterialFlexibleHeader class ShrineCollectionViewController: UICollectionViewController { diff --git a/demos/Shrine/Shrine/ShrineDetailViewController.swift b/demos/Shrine/Shrine/ShrineDetailViewController.swift index fbfb50bbf24..f5fedb6e013 100644 --- a/demos/Shrine/Shrine/ShrineDetailViewController.swift +++ b/demos/Shrine/Shrine/ShrineDetailViewController.swift @@ -15,7 +15,9 @@ */ import UIKit -import MaterialComponents +import MaterialComponents.MaterialAppBar +import MaterialComponents.MaterialButtons +import MaterialComponents.MaterialIcons_ic_arrow_back class ShrineDetailView: UIScrollView { diff --git a/demos/Shrine/Shrine/ShrineFlexibleHeaderContainerViewController.swift b/demos/Shrine/Shrine/ShrineFlexibleHeaderContainerViewController.swift index 03e683241f8..cb94f8074e1 100644 --- a/demos/Shrine/Shrine/ShrineFlexibleHeaderContainerViewController.swift +++ b/demos/Shrine/Shrine/ShrineFlexibleHeaderContainerViewController.swift @@ -15,7 +15,7 @@ */ import UIKit -import MaterialComponents +import MaterialComponents.MaterialFlexibleHeader class ShrineFlexibleHeaderContainerViewController: MDCFlexibleHeaderContainerViewController { diff --git a/demos/Shrine/Shrine/ShrineHeaderContentView.swift b/demos/Shrine/Shrine/ShrineHeaderContentView.swift index bb5a45f5168..f923ffd4fba 100644 --- a/demos/Shrine/Shrine/ShrineHeaderContentView.swift +++ b/demos/Shrine/Shrine/ShrineHeaderContentView.swift @@ -15,7 +15,7 @@ */ import UIKit -import MaterialComponents +import MaterialComponents.MaterialPageControl class ShrineHeaderContentView: UIView, UIScrollViewDelegate { diff --git a/demos/Shrine/Shrine/ShrineInkOverlay.swift b/demos/Shrine/Shrine/ShrineInkOverlay.swift index 6332da009f4..0477784d010 100644 --- a/demos/Shrine/Shrine/ShrineInkOverlay.swift +++ b/demos/Shrine/Shrine/ShrineInkOverlay.swift @@ -15,7 +15,7 @@ */ import UIKit -import MaterialComponents +import MaterialComponents.MaterialInk class ShrineInkOverlay: UIView, MDCInkTouchControllerDelegate { diff --git a/howto/tutorial/README.md b/howto/tutorial/README.md index 231d682345a..fa58936f6d0 100644 --- a/howto/tutorial/README.md +++ b/howto/tutorial/README.md @@ -384,7 +384,7 @@ func barButtonDidTap(sender: UIBarButtonItem) { navigationItem.rightBarButtonItem = UIBarButtonItem(title: buttonTitle, style: .plain, target: self, - action: #selector(ViewController.barButtonDidTap(sender:))) + action: #selector(ViewController.barButtonDidTap(_:))) } ~~~ @@ -413,7 +413,7 @@ override func viewDidLoad() { navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Edit", style: .plain, target: self, - action: #selector(ViewController.barButtonDidTap(sender:))) + action: #selector(ViewController.barButtonDidTap(_:))) } ~~~ @@ -534,7 +534,7 @@ override func viewDidLoad() { fab.setTitle("+", for: .normal) fab.setTitle("-", for: .selected) - fab.addTarget(self, action: #selector(ViewController.fabDidTap(sender:)), for: .touchUpInside) + fab.addTarget(self, action: #selector(ViewController.fabDidTap(_:)), for: .touchUpInside) } ~~~ @@ -586,7 +586,7 @@ class ViewController: MDCCollectionViewController { title = "Material Components" - navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Edit", style: .plain, target: self, action: #selector(ViewController.barButtonDidTap(sender:))) + navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Edit", style: .plain, target: self, action: #selector(ViewController.barButtonDidTap(_:))) appBar.navigationBar.tintColor = UIColor.black @@ -597,13 +597,13 @@ class ViewController: MDCCollectionViewController { fab.setTitle("+", for: .normal) fab.setTitle("-", for: .selected) - fab.addTarget(self, action: #selector(ViewController.fabDidTap(sender:)), for: .touchUpInside) + fab.addTarget(self, action: #selector(ViewController.fabDidTap(_:)), for: .touchUpInside) } func barButtonDidTap(sender: UIBarButtonItem) { editor.isEditing = !editor.isEditing - navigationItem.rightBarButtonItem = UIBarButtonItem(title: editor.isEditing ? "Cancel" : "Edit", style: .plain, target: self, action: #selector(ViewController.barButtonDidTap(sender:))) + navigationItem.rightBarButtonItem = UIBarButtonItem(title: editor.isEditing ? "Cancel" : "Edit", style: .plain, target: self, action: #selector(ViewController.barButtonDidTap(_:))) } func fabDidTap(sender: UIButton) { diff --git a/scripts/build-site.sh b/scripts/build_site.sh similarity index 96% rename from scripts/build-site.sh rename to scripts/build_site.sh index 41fc186f332..2e89c60737c 100755 --- a/scripts/build-site.sh +++ b/scripts/build_site.sh @@ -1,3 +1,5 @@ +set -x + #!/bin/bash # # Copyright 2015-present the Material Components for iOS authors. All Rights Reserved. @@ -39,7 +41,7 @@ while test $# -gt 0; do shift 1 ;; "-h" | "--help") - echo "Usage: site-build.sh " + echo "Usage: build_site.sh " echo "" echo "options:" echo "-b, --build=TARGET Specify target to build." @@ -54,7 +56,7 @@ while test $# -gt 0; do exit 0 ;; *) - echo "For available options: site-build.sh -h[--help]." + echo "For available options: build_site.sh -h[--help]." exit 0 ;; esac