Skip to content

Commit

Permalink
Internal change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 565513516
  • Loading branch information
Nobody authored and material-automation committed Sep 14, 2023
1 parent 05d4019 commit 58f6375
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

#import "ShadowCornerRadiusAnimationViewController.h"

#import "MaterialAnimationTiming.h"
#import "MaterialButtons+ButtonThemer.h"
#import "MaterialButtons.h"
#import "MaterialShadowLayer.h"
#import "MDCButtonScheme.h"
#import "MDCContainedButtonThemer.h"
#import "MDCButton.h"
#import "MDCShadowLayer.h"

static const CGFloat kStartCornerRadius = (CGFloat)0.001;
static const CGFloat kEndCornerRadius = (CGFloat)25.0;
Expand Down Expand Up @@ -82,7 +82,7 @@ - (void)viewWillLayoutSubviews {

- (void)animateView {
CAMediaTimingFunction *timingFunction =
[CAMediaTimingFunction mdc_functionWithType:MDCAnimationTimingFunctionEaseInOut];
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
if (!_animated) {
[self.customView.shadowLayer animateCornerRadius:kEndCornerRadius
withTimingFunction:timingFunction
Expand Down
12 changes: 6 additions & 6 deletions components/Snackbar/src/private/MDCSnackbarOverlayView.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

#import "../MDCSnackbarError.h"
#import "../MDCSnackbarMessage.h"
#import "MaterialAnimationTiming.h"
#import "MaterialAvailability.h"
#import "CAMediaTimingFunction+MDCAnimationTiming.h"
#import "MDCAvailability.h"
#import "MDCSnackbarAlignment.h"
#import "MDCSnackbarMessageView.h"
#import "MDCSnackbarMessageInternal.h"
#import "MDCSnackbarMessageViewInternal.h"
#import "MaterialApplication.h"
#import "MaterialKeyboardWatcher.h"
#import "MaterialOverlay.h"
#import "UIApplication+MDCAppExtensions.h"
#import "MDCKeyboardWatcher.h"
#import "MDCOverlayImplementor.h"

NSString *const MDCSnackbarOverlayIdentifier = @"MDCSnackbar";

Expand Down Expand Up @@ -589,7 +589,7 @@ - (void)slideMessageView:(MDCSnackbarMessageView *)snackbarView
duration = onscreen ? MDCSnackbarEnterTransitionDuration : MDCSnackbarExitTransitionDuration;
}
CAMediaTimingFunction *timingFunction =
[CAMediaTimingFunction mdc_functionWithType:MDCAnimationTimingFunctionEaseInOut];
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[CATransaction begin];
[CATransaction setAnimationTimingFunction:timingFunction];
[CATransaction setCompletionBlock:completion];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,22 @@

#import <UIKit/UIKit.h>

#import "MaterialActionSheet.h" // ComponentImport
#import "MaterialActionSheet+Theming.h" // SubtargetImport
#import "MaterialAnimationTiming.h" // ComponentImport
#import "MaterialButtons.h"
#import "MaterialButtons+Theming.h" // ComponentImport
#import "MaterialTabs+TabBarView.h"
#import "MDCActionSheetAction.h"
#import "MDCActionSheetController.h"
#import "MDCActionSheetController+MaterialTheming.h"
#import "UIView+MDCTimingFunction.h"
#import "MDCButton.h"
#import "MDCButton+MaterialTheming.h"
#import "MDCTabBarItem.h"
#import "MDCTabBarView.h"
#import "MDCTabBarViewCustomViewable.h"
#import "MDCTabBarViewDelegate.h"
#import "MaterialIcons+ic_check.h" // PrivateSubtargetImport
#import "MaterialIcons+ic_settings.h" // PrivateSubtargetImport
#import "MaterialMath.h" // PrivateImport
#import "MaterialColorScheme.h"
#import "MaterialContainerScheme.h" // SchemeImport
#import "MaterialTypographyScheme+Scheming.h"
#import "MDCMath.h"
#import "MDCSemanticColorScheme.h"
#import "MDCContainerScheme.h"
#import "MDCTypographyScheming.h"

static NSString *const kExampleTitle = @"TabBarView";

Expand Down Expand Up @@ -53,7 +57,7 @@ - (instancetype)init {
if (self) {
_aSwitch = [[UISwitch alloc] init];
_animationTimingFunction =
[CAMediaTimingFunction mdc_functionWithType:MDCAnimationTimingFunctionEaseInOut];
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
}
return self;
}
Expand Down
7 changes: 3 additions & 4 deletions components/Tabs/src/TabBarView/MDCTabBarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#import "private/MDCTabBarViewItemView.h"
#import "private/MDCTabBarViewItemViewDelegate.h"
#import "private/MDCTabBarViewPrivateIndicatorContext.h"
#import "CAMediaTimingFunction+MDCAnimationTiming.h"
#import "MDCAvailability.h"
#import "MDCBadgeAppearance.h"
#import "MDCRippleTouchController.h"
Expand Down Expand Up @@ -185,7 +184,7 @@ - (void)commonMDCTabBarViewInit {
_selectionIndicatorView.tintColor = UIColor.blackColor;
_selectionIndicatorView.indicatorPathAnimationDuration = kSelectionChangeAnimationDuration;
_selectionIndicatorView.indicatorPathTimingFunction =
[CAMediaTimingFunction mdc_functionWithType:MDCAnimationTimingFunctionEaseInOut];
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];

_selectionIndicatorTemplate = [[MDCTabBarViewUnderlineIndicatorTemplate alloc] init];

Expand Down Expand Up @@ -637,7 +636,7 @@ - (CFTimeInterval)selectionChangeAnimationDuration {
}

- (CAMediaTimingFunction *)selectionChangeAnimationTimingFunction {
return [CAMediaTimingFunction mdc_functionWithType:MDCAnimationTimingFunctionEaseInOut];
return [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
}

#pragma mark - Key-Value Observing (KVO)
Expand Down Expand Up @@ -1326,7 +1325,7 @@ - (CGSize)availableSizeForSubviewLayout {

- (void)performAnimationBlockInCATransaction:(void (^)(void))animationBlock {
CAMediaTimingFunction *easeInOutFunction =
[CAMediaTimingFunction mdc_functionWithType:MDCAnimationTimingFunctionEaseInOut];
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
// Wrap in explicit CATransaction to allow layer-based animations with the correct duration.
[CATransaction begin];
[CATransaction setAnimationDuration:self.selectionChangeAnimationDuration];
Expand Down
9 changes: 5 additions & 4 deletions components/Tabs/src/private/MDCItemBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

#import <MDFInternationalization/MDFInternationalization.h>

#import "MaterialAnimationTiming.h"
#import "MDCTabBar.h"
#import "MDCItemBarAlignment.h"

#import "MDCTabBarDisplayDelegate.h"
#import "MDCTabBarIndicatorAttributes.h"
#import "MDCTabBarIndicatorTemplate.h"
#import "MDCTabBarSizeClassDelegate.h"
#import "MDCItemBarCell.h"
Expand Down Expand Up @@ -605,7 +606,7 @@ - (void)didSelectItemAtIndex:(NSInteger)index animateTransition:(BOOL)animate {

if (animate) {
CAMediaTimingFunction *easeInOutFunction =
[CAMediaTimingFunction mdc_functionWithType:MDCAnimationTimingFunctionEaseInOut];
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
// Wrap in explicit CATransaction to allow layer-based animations with the correct duration.
[CATransaction begin];
[CATransaction setAnimationDuration:kDefaultAnimationDuration];
Expand Down Expand Up @@ -707,7 +708,7 @@ - (void)updateFlowLayoutMetricsAnimated:(BOOL)animate {
if (animate) {
[CATransaction begin];
CAMediaTimingFunction *easeInOut =
[CAMediaTimingFunction mdc_functionWithType:MDCAnimationTimingFunctionEaseInOut];
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
[CATransaction setAnimationTimingFunction:easeInOut];
[UIView animateWithDuration:kDefaultAnimationDuration
delay:0
Expand Down
3 changes: 1 addition & 2 deletions components/Tabs/tests/unit/MDCTabBarViewTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#import <XCTest/XCTest.h>

#import "../../src/TabBarView/private/MDCTabBarViewItemView.h"
#import "CAMediaTimingFunction+MDCAnimationTiming.h"
#import "MDCAvailability.h"
#import "MDCRippleTouchController.h"
#import "MDCTabBarItem.h"
Expand Down Expand Up @@ -1356,7 +1355,7 @@ - (void)testDefaultSelectionChangeAnimationDurationValue {
- (void)testDefaultSelectionChangeAnimationTimingFunction {
// Then
CAMediaTimingFunction *expectedFunction =
[CAMediaTimingFunction mdc_functionWithType:MDCAnimationTimingFunctionEaseInOut];
[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
float expectedControlPoint1[2];
float expectedControlPoint2[2];
float expectedControlPoint3[2];
Expand Down
5 changes: 2 additions & 3 deletions components/TextFields/src/MDCTextInputControllerBase.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#import "MDCTextInputControllerBase.h"
#import "private/MDCTextInputControllerBase+Subclassing.h"

#import "CAMediaTimingFunction+MDCAnimationTiming.h"
#import "MDCPalettes.h"
#import "MDCMultilineTextField.h"
#import "MDCTextField.h"
Expand Down Expand Up @@ -1540,7 +1539,7 @@ - (void)textInputDidBeginEditing:(__unused NSNotification *)note {
setAnimationDuration:MDCTextInputControllerBaseDefaultFloatingPlaceholderUpAnimationDuration];
[CATransaction
setAnimationTimingFunction:[CAMediaTimingFunction
mdc_functionWithType:MDCAnimationTimingFunctionEaseInOut]];
functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];

[self updateLayout];

Expand Down Expand Up @@ -1601,7 +1600,7 @@ - (void)textInputDidEndEditing:(__unused NSNotification *)note {
MDCTextInputControllerBaseDefaultFloatingPlaceholderDownAnimationDuration];
[CATransaction
setAnimationTimingFunction:[CAMediaTimingFunction
mdc_functionWithType:MDCAnimationTimingFunctionEaseInOut]];
functionWithName:kCAMediaTimingFunctionEaseInEaseOut]];

[self updateLayout];

Expand Down

0 comments on commit 58f6375

Please sign in to comment.