From 6f6578e81c1df207da47e2e1337382341f271206 Mon Sep 17 00:00:00 2001 From: Chet Haase Date: Fri, 5 Sep 2014 16:53:25 -0700 Subject: Use constant state in AnimatedVectorDrawable Complex animated vector drawables can be expensive to load due to sub-optimal parsing of the String-based pathData. Suffering that penalty every time the same drawable is loaded (such as material-themed ProgressBars) is painful. The new approach caches constant state of both the VectorDrawable (including the pathData geometry) and the animators (which includes potentially expensive path-based interpolators). issue #17366831 Material ProgressBar taking 200+ms to inflate Change-Id: Iba3b541e24cfce8c07f5aa9fe6aa7d7b92b2fe1c --- core/java/android/animation/AnimatorSet.java | 1 + 1 file changed, 1 insertion(+) (limited to 'core/java/android/animation') diff --git a/core/java/android/animation/AnimatorSet.java b/core/java/android/animation/AnimatorSet.java index 7c13dbe..0aa8fdd 100644 --- a/core/java/android/animation/AnimatorSet.java +++ b/core/java/android/animation/AnimatorSet.java @@ -636,6 +636,7 @@ public final class AnimatorSet extends Animator { anim.mNodes = new ArrayList(); anim.mSortedNodes = new ArrayList(); anim.mReversible = mReversible; + anim.mSetListener = null; // Walk through the old nodes list, cloning each node and adding it to the new nodemap. // One problem is that the old node dependencies point to nodes in the old AnimatorSet. -- cgit v1.1