Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Unified Diff: ios/chrome/browser/ui/animation_util.h

Issue 802633007: Upstream iOS UI utilities. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove rand() Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/DEPS ('k') | ios/chrome/browser/ui/animation_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/animation_util.h
diff --git a/ios/chrome/browser/ui/animation_util.h b/ios/chrome/browser/ui/animation_util.h
new file mode 100644
index 0000000000000000000000000000000000000000..778cdc5386a4c03be9f2faba24be13aab575e315
--- /dev/null
+++ b/ios/chrome/browser/ui/animation_util.h
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_ANIMATION_UTIL_H_
+#define IOS_CHROME_BROWSER_UI_ANIMATION_UTIL_H_
+
+#import <UIKit/UIKit.h>
+
+// Animations returned by these utility methods use kCAFillModeBoth and aren't
+// automatically removed from the layer when finished. Remove the animations
+// by calling |RemoveAnimationsFromLayers| in CATransaction completion blocks.
+// This is done so the effects of animations that finish earlier persist until
+// all animations in the transaction are finished.
+
+// Returns an animation that will animate |layer| from |beginFrame| to
+// |endFrame|.
+CAAnimation* FrameAnimationMake(CALayer* layer,
+ CGRect beginFrame,
+ CGRect endFrame);
+
+// Returns an animation that will animate the "opacity" property of a layer from
+// |beginOpacity| to |endOpacity|.
+CAAnimation* OpacityAnimationMake(CGFloat beginOpacity, CGFloat endOpacity);
+
+// Returns an animation group containing the animations in |animations| that has
+// the shortest duration necessary for all the animations to finish.
+CAAnimation* AnimationGroupMake(NSArray* animations);
+
+// Returns an animation that performs |animation| after |delay|.
+CAAnimation* DelayedAnimationMake(CAAnimation* animation, CFTimeInterval delay);
+
+// If |animation| is a CAAnimationGroup, searches its animations for a
+// CABasicAnimation for |keyPath|. If |animation| is a CABasicAnimation, it
+// will check its keyPath against |keyPath|.
+CABasicAnimation* FindAnimationForKeyPath(NSString* keyPath,
+ CAAnimation* animation);
+
+// Removes the animation for |key| from each CALayer in |layers|.
+void RemoveAnimationForKeyFromLayers(NSString* key, NSArray* layers);
+
+#endif // IOS_CHROME_BROWSER_UI_ANIMATION_UTIL_H_
« no previous file with comments | « ios/chrome/DEPS ('k') | ios/chrome/browser/ui/animation_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698