summaryrefslogtreecommitdiffstats
path: root/graphics/java/android
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2014-04-16 16:57:53 -0700
committerAlan Viverette <alanv@google.com>2014-04-16 16:58:58 -0700
commit70802d2501dd5607ca0f38d7aa36771d9e0c7b20 (patch)
tree205266995ff7fcdd92999f68387bd9ccc05c4bbf /graphics/java/android
parent8aa68921a577e1b665fe61cb40d3c929054a0a94 (diff)
downloadframeworks_base-70802d2501dd5607ca0f38d7aa36771d9e0c7b20.zip
frameworks_base-70802d2501dd5607ca0f38d7aa36771d9e0c7b20.tar.gz
frameworks_base-70802d2501dd5607ca0f38d7aa36771d9e0c7b20.tar.bz2
Fix VectorDrawable states
BUG: 14083130 Change-Id: I8242523d9a4acd499154d2e7b9b9b52a3f1f742d
Diffstat (limited to 'graphics/java/android')
-rw-r--r--graphics/java/android/graphics/drawable/VectorDrawable.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java
index 736b143..0992717 100644
--- a/graphics/java/android/graphics/drawable/VectorDrawable.java
+++ b/graphics/java/android/graphics/drawable/VectorDrawable.java
@@ -182,14 +182,14 @@ public class VectorDrawable extends Drawable {
public VectorDrawable() {
mVectorState = new VectorDrawableState(null);
- mVectorState.mBasicAnimator = ObjectAnimator.ofFloat(this, "AnimationFraction", 0, 1);
+ mVectorState.mBasicAnimator = ObjectAnimator.ofFloat(this, "AnimationFraction", 0, 0);
setDuration(DEFAULT_DURATION);
}
private VectorDrawable(VectorDrawableState state, Resources res, Theme theme) {
mVectorState = new VectorDrawableState(state);
- mVectorState.mBasicAnimator = ObjectAnimator.ofFloat(this, "AnimationFraction", 0, 1);
+ mVectorState.mBasicAnimator = ObjectAnimator.ofFloat(this, "AnimationFraction", 0, 0);
if (theme != null && canApplyTheme()) {
applyTheme(theme);
@@ -213,7 +213,7 @@ public class VectorDrawable extends Drawable {
@Override
public void jumpToCurrentState() {
- mVectorState.mBasicAnimator.end();
+ stop();
}
/**
@@ -318,7 +318,7 @@ public class VectorDrawable extends Drawable {
private void animateBackward() {
if (!mVectorState.mBasicAnimator.isStarted()) {
- mVectorState.mBasicAnimator.setFloatValues(.99f, 0);
+ mVectorState.mBasicAnimator.setFloatValues(1, 0);
start();
}
}
@@ -985,7 +985,13 @@ public class VectorDrawable extends Drawable {
for (int j = 0; j < sp.length; j++) {
mSeqMap.add(sp[j].trim());
- VectorDrawable.VPath path = groups.get(j).get(sp[j]);
+
+ final VectorDrawable.VPath path = groups.get(j).get(sp[j]);
+ if (path == null) {
+ throw new XmlPullParserException(a.getPositionDescription()
+ + " missing path with name: " + sp[j]);
+ }
+
path.mAnimated = true;
paths[j] = path;
}