diff options
author | George Mount <mount@google.com> | 2014-09-08 13:23:36 -0700 |
---|---|---|
committer | George Mount <mount@google.com> | 2014-09-09 17:09:57 -0700 |
commit | fd3c4744f265c5277e6e2641a18d5ec3dff19f6b (patch) | |
tree | 3f3bb4110817cdee515cc134afb9258eb223ed5d /core/java/android/animation/KeyframeSet.java | |
parent | 8232d822aa97e78e982ed154ac618cde34baac2a (diff) | |
download | frameworks_base-fd3c4744f265c5277e6e2641a18d5ec3dff19f6b.zip frameworks_base-fd3c4744f265c5277e6e2641a18d5ec3dff19f6b.tar.gz frameworks_base-fd3c4744f265c5277e6e2641a18d5ec3dff19f6b.tar.bz2 |
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
Diffstat (limited to 'core/java/android/animation/KeyframeSet.java')
-rw-r--r-- | core/java/android/animation/KeyframeSet.java | 4 |
1 files changed, 4 insertions, 0 deletions
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, |