From fd3c4744f265c5277e6e2641a18d5ec3dff19f6b Mon Sep 17 00:00:00 2001 From: George Mount Date: Mon, 8 Sep 2014 13:23:36 -0700 Subject: Use intrinsic size for path animation in AnimatedVectorDrawable Bug 16984007 Animated Vector Drawables were using the viewport dimensions for calculating the allowable animation error. Instead of using viewport dimensions, it is better to use the intrinsic dimensions. Using the viewport dimensions meant that a small viewport (e.g. 1x1) would mean that animation paths within would only have an accuracy of 50% of the dimensions of the drawable. Change-Id: Id0152eabb4effd1e50c644eea7a371b38baeb7c1 --- core/java/android/animation/KeyframeSet.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/java/android/animation/KeyframeSet.java') diff --git a/core/java/android/animation/KeyframeSet.java b/core/java/android/animation/KeyframeSet.java index fc9bbb1..8d15db2 100644 --- a/core/java/android/animation/KeyframeSet.java +++ b/core/java/android/animation/KeyframeSet.java @@ -154,6 +154,10 @@ class KeyframeSet implements Keyframes { return new PathKeyframes(path); } + public static PathKeyframes ofPath(Path path, float error) { + return new PathKeyframes(path, error); + } + /** * Sets the TypeEvaluator to be used when calculating animated values. This object * is required only for KeyframeSets that are not either IntKeyframeSet or FloatKeyframeSet, -- cgit v1.1