| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef IOS_CHROME_BROWSER_UI_ANIMATION_UTIL_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_ANIMATION_UTIL_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 // Animations returned by these utility methods use kCAFillModeBoth and aren't |
| 11 // automatically removed from the layer when finished. Remove the animations |
| 12 // by calling |RemoveAnimationsFromLayers| in CATransaction completion blocks. |
| 13 // This is done so the effects of animations that finish earlier persist until |
| 14 // all animations in the transaction are finished. |
| 15 |
| 16 // Returns an animation that will animate |layer| from |beginFrame| to |
| 17 // |endFrame|. |
| 18 CAAnimation* FrameAnimationMake(CALayer* layer, |
| 19 CGRect beginFrame, |
| 20 CGRect endFrame); |
| 21 |
| 22 // Returns an animation that will animate the "opacity" property of a layer from |
| 23 // |beginOpacity| to |endOpacity|. |
| 24 CAAnimation* OpacityAnimationMake(CGFloat beginOpacity, CGFloat endOpacity); |
| 25 |
| 26 // Returns an animation group containing the animations in |animations| that has |
| 27 // the shortest duration necessary for all the animations to finish. |
| 28 CAAnimation* AnimationGroupMake(NSArray* animations); |
| 29 |
| 30 // Returns an animation that performs |animation| after |delay|. |
| 31 CAAnimation* DelayedAnimationMake(CAAnimation* animation, CFTimeInterval delay); |
| 32 |
| 33 // If |animation| is a CAAnimationGroup, searches its animations for a |
| 34 // CABasicAnimation for |keyPath|. If |animation| is a CABasicAnimation, it |
| 35 // will check its keyPath against |keyPath|. |
| 36 CABasicAnimation* FindAnimationForKeyPath(NSString* keyPath, |
| 37 CAAnimation* animation); |
| 38 |
| 39 // Removes the animation for |key| from each CALayer in |layers|. |
| 40 void RemoveAnimationForKeyFromLayers(NSString* key, NSArray* layers); |
| 41 |
| 42 #endif // IOS_CHROME_BROWSER_UI_ANIMATION_UTIL_H_ |
| OLD | NEW |