Index: ui/views/animation/ink_drop_animation.h |
diff --git a/ui/views/animation/ink_drop_animation.h b/ui/views/animation/ink_drop_animation.h |
index 64f39ca95326c71c18b24dc9a9f8d59de04ea111..b7e1dfa4e021b6bbcaec5f6b1942cafbbb44eb21 100644 |
--- a/ui/views/animation/ink_drop_animation.h |
+++ b/ui/views/animation/ink_drop_animation.h |
@@ -10,6 +10,8 @@ |
#include "base/observer_list.h" |
#include "base/time/time.h" |
#include "ui/compositor/layer_animator.h" |
+#include "ui/gfx/animation/tween.h" |
+#include "ui/gfx/geometry/point.h" |
#include "ui/gfx/geometry/size.h" |
#include "ui/gfx/transform.h" |
#include "ui/views/animation/ink_drop_state.h" |
@@ -56,9 +58,7 @@ class VIEWS_EXPORT InkDropAnimation { |
// Animates from the current |ink_drop_state_| to a new |ink_drop_state|. It |
// is possible to animate from any |ink_drop_state_| to any new |
- // |ink_drop_state|. Note that some state transitions will also perform an |
- // implicit transition to the another state. e.g. AnimateToState(QUICK_ACTION) |
- // will implicitly transition to the HIDDEN state. |
+ // |ink_drop_state|. |
void AnimateToState(InkDropState ink_drop_state); |
// Sets the |center_point| of the ink drop layer relative to its parent Layer. |
@@ -88,15 +88,14 @@ class VIEWS_EXPORT InkDropAnimation { |
void AnimateToStateInternal(InkDropState ink_drop_state, |
ui::LayerAnimationObserver* observer); |
- // Animates all of the painted shape layers to the specified |transforms| and |
- // |opacity|. The animation will use the given |duration| and |
- // |preemption_strategy|, and |observer| will be added to all |
- // LayerAnimationSequences. |
+ // Animates all of the painted shape layers to the specified |transforms|. The |
+ // animation will use the given |duration|, |preemption_strategy|, and |tween| |
+ // and |observer| will be added to all LayerAnimationSequences. |
void AnimateToTransforms( |
const InkDropTransforms transforms, |
- float opacity, |
base::TimeDelta duration, |
ui::LayerAnimator::PreemptionStrategy preemption_strategy, |
+ gfx::Tween::Type tween, |
ui::LayerAnimationObserver* observer); |
// Updates the Transforms and opacity to the HIDDEN state. |
@@ -106,9 +105,22 @@ class VIEWS_EXPORT InkDropAnimation { |
// perform any animation. |
void SetTransforms(const InkDropTransforms transforms); |
+ // Gets the opacity of the ink drop. |
+ float GetCurrentOpacity() const; |
+ |
// Sets the opacity of the ink drop. |
void SetOpacity(float opacity); |
+ // Animates all of the painted shape layers to the specified |opacity|. The |
+ // animation will use the given |duration|, |preemption_strategy|, and |tween| |
+ // and |observer| will be added to all LayerAnimationSequences. |
+ void AnimateToOpacity( |
+ float opacity, |
+ base::TimeDelta duration, |
+ ui::LayerAnimator::PreemptionStrategy preemption_strategy, |
+ gfx::Tween::Type tween, |
+ ui::LayerAnimationObserver* animation_observer); |
+ |
// Updates all of the Transforms in |transforms_out| for a circle of the given |
// |size|. |
void CalculateCircleTransforms(const gfx::Size& size, |
@@ -120,15 +132,21 @@ class VIEWS_EXPORT InkDropAnimation { |
float corner_radius, |
InkDropTransforms* transforms_out) const; |
- // Updates all of the Transforms in |transforms_out| to the current target |
- // Transforms of the Layers. |
- void GetCurrentTansforms(InkDropTransforms* transforms_out) const; |
+ // Updates all of the Transforms in |transforms_out| to the current Transforms |
+ // of the Layers. |
+ void GetCurrentTransforms(InkDropTransforms* transforms_out) const; |
// Adds and configures a new |painted_shape| layer to |painted_layers_|. |
void AddPaintLayer(PaintedShape painted_shape); |
void AbortAllAnimations(); |
+ // Calculates an estimated distance ratio between 0.0 and 1.0 that estimates |
+ // how close the painted shape |transforms| are away from the final |
+ // QUICK_ACTION transforms. |
+ float CalculateDistanceEstimateToQuickAction( |
+ const InkDropTransforms& transforms) const; |
+ |
// The Callback invoked when all of the animation sequences for the specific |
// |ink_drop_state| animation have started. |observer| is the |
// ui::CallbackLayerAnimationObserver which is notifying the callback. |