From 70802d2501dd5607ca0f38d7aa36771d9e0c7b20 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Wed, 16 Apr 2014 16:57:53 -0700 Subject: [PATCH 1/2] Fix VectorDrawable states BUG: 14083130 Change-Id: I8242523d9a4acd499154d2e7b9b9b52a3f1f742d --- .../res/drawable/btn_check_quantum_anim.xml | 42 +++++++++---------- .../graphics/drawable/VectorDrawable.java | 16 ++++--- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/core/res/res/drawable/btn_check_quantum_anim.xml b/core/res/res/drawable/btn_check_quantum_anim.xml index d68d5122bc633..0600522c77636 100644 --- a/core/res/res/drawable/btn_check_quantum_anim.xml +++ b/core/res/res/drawable/btn_check_quantum_anim.xml @@ -25,26 +25,29 @@ android:viewportHeight="320" android:viewportWidth="320" /> - - - + + + + android:name="check" + android:pathData="M 232.1,80.6 L 248.5,92.1 L 145.2,239.5 L 71.5,187.8 L 83,171.5 L 140.3,211.7 z" + android:fill="?attr/colorControlActivated" /> + android:sequence="box1,box2,box3,box4,check" /> diff --git a/graphics/java/android/graphics/drawable/VectorDrawable.java b/graphics/java/android/graphics/drawable/VectorDrawable.java index 736b143921a29..0992717fd4ef9 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; } From dccbe8b02a34a3c78028a31ee158d4d2818c72ba Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Wed, 16 Apr 2014 17:56:29 -0700 Subject: [PATCH 2/2] Fix alert dialog alignment and touch feedback masking BUG: 13905057 Change-Id: Ia2bf4d170370c83f4ea863ecae24fffecc6fc020 --- .../res/drawable/btn_borderless_quantum.xml | 1 + core/res/res/layout/alert_dialog_quantum.xml | 26 +++++++++---------- core/res/res/values/themes_quantum.xml | 4 +-- .../drawable/TouchFeedbackDrawable.java | 4 ++- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/core/res/res/drawable/btn_borderless_quantum.xml b/core/res/res/drawable/btn_borderless_quantum.xml index 2e3c515fcac1a..69a891a67d8bf 100644 --- a/core/res/res/drawable/btn_borderless_quantum.xml +++ b/core/res/res/drawable/btn_borderless_quantum.xml @@ -16,6 +16,7 @@ + diff --git a/core/res/res/layout/alert_dialog_quantum.xml b/core/res/res/layout/alert_dialog_quantum.xml index 98b687973ebdb..537162a109a01 100644 --- a/core/res/res/layout/alert_dialog_quantum.xml +++ b/core/res/res/layout/alert_dialog_quantum.xml @@ -91,32 +91,32 @@ style="?android:attr/buttonBarStyle" android:layout_width="match_parent" android:layout_height="wrap_content" - android:orientation="horizontal" - android:layoutDirection="locale" - android:measureWithLargestChild="true"> + android:layoutDirection="locale">