Add listener to the AVDC

At the same, merge AVDC and VDC samples into one. Replace make with
gradle build for sample code.

Test: Added new tests, and new demo.
fix:b/34850683

Change-Id: I3fb6532dd1f754ce7b7f2acd51cdb23b901d0780
diff --git a/api/current.txt b/api/current.txt
index fc4faf9..b4d02d8 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -942,16 +942,34 @@
 
 package android.support.graphics.drawable {
 
-  public class AnimatedVectorDrawableCompat extends android.support.graphics.drawable.VectorDrawableCommon {
+  public abstract interface Animatable2Compat {
+    method public abstract void clearAnimationCallbacks();
+    method public abstract void registerAnimationCallback(android.support.graphics.drawable.Animatable2Compat.AnimationCallback);
+    method public abstract boolean unregisterAnimationCallback(android.support.graphics.drawable.Animatable2Compat.AnimationCallback);
+  }
+
+  public static abstract class Animatable2Compat.AnimationCallback {
+    ctor public Animatable2Compat.AnimationCallback();
+    method public void onAnimationEnd(android.graphics.drawable.Drawable);
+    method public void onAnimationStart(android.graphics.drawable.Drawable);
+  }
+
+  public class AnimatedVectorDrawableCompat extends android.support.graphics.drawable.VectorDrawableCommon implements android.support.graphics.drawable.Animatable2Compat {
+    method public void clearAnimationCallbacks();
+    method public static void clearAnimationCallbacks(android.graphics.drawable.Drawable);
     method public static android.support.graphics.drawable.AnimatedVectorDrawableCompat create(android.content.Context, int);
     method public static android.support.graphics.drawable.AnimatedVectorDrawableCompat createFromXmlInner(android.content.Context, android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.util.AttributeSet, android.content.res.Resources.Theme) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
     method public void draw(android.graphics.Canvas);
     method public int getOpacity();
     method public boolean isRunning();
+    method public void registerAnimationCallback(android.support.graphics.drawable.Animatable2Compat.AnimationCallback);
+    method public static void registerAnimationCallback(android.graphics.drawable.Drawable, android.support.graphics.drawable.Animatable2Compat.AnimationCallback);
     method public void setAlpha(int);
     method public void setColorFilter(android.graphics.ColorFilter);
     method public void start();
     method public void stop();
+    method public boolean unregisterAnimationCallback(android.support.graphics.drawable.Animatable2Compat.AnimationCallback);
+    method public static boolean unregisterAnimationCallback(android.graphics.drawable.Drawable, android.support.graphics.drawable.Animatable2Compat.AnimationCallback);
   }
 
    abstract class VectorDrawableCommon extends android.graphics.drawable.Drawable {
diff --git a/graphics/drawable/animated/src/android/support/graphics/drawable/Animatable2Compat.java b/graphics/drawable/animated/src/android/support/graphics/drawable/Animatable2Compat.java
new file mode 100644
index 0000000..d9d0f36
--- /dev/null
+++ b/graphics/drawable/animated/src/android/support/graphics/drawable/Animatable2Compat.java
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.support.graphics.drawable;
+
+import static android.os.Build.VERSION_CODES.M;
+
+import android.graphics.drawable.Animatable;
+import android.graphics.drawable.Animatable2;
+import android.graphics.drawable.Drawable;
+import android.support.annotation.NonNull;
+import android.support.annotation.RequiresApi;
+
+/**
+ * Abstract class that drawables supporting animations and callbacks should extend in support lib.
+ */
+public interface Animatable2Compat extends Animatable {
+
+    /**
+     * Adds a callback to listen to the animation events.
+     *
+     * @param callback Callback to add.
+     */
+    void registerAnimationCallback(@NonNull AnimationCallback callback);
+
+    /**
+     * Removes the specified animation callback.
+     *
+     * @param callback Callback to remove.
+     * @return {@code false} if callback didn't exist in the call back list, or {@code true} if
+     *         callback has been removed successfully.
+     */
+    boolean unregisterAnimationCallback(@NonNull AnimationCallback callback);
+
+    /**
+     * Removes all existing animation callbacks.
+     */
+    void clearAnimationCallbacks();
+
+    /**
+     * Animation callback interface. Used to notify animation events.
+     */
+    abstract class AnimationCallback {
+        /**
+         * Called when the animation starts.
+         *
+         * @param drawable The drawable started the animation.
+         */
+        public void onAnimationStart(Drawable drawable) {};
+        /**
+         * Called when the animation ends.
+         *
+         * @param drawable The drawable finished the animation.
+         */
+        public void onAnimationEnd(Drawable drawable) {};
+
+        // Only when passing this Animatable2Compat.AnimationCallback to a frameworks' AVD, we need
+        // to bridge this compat version callback with the frameworks' callback.
+        Animatable2.AnimationCallback mPlatformCallback;
+
+        @RequiresApi(M)
+        Animatable2.AnimationCallback getPlatformCallback() {
+            if (mPlatformCallback == null) {
+                mPlatformCallback = new Animatable2.AnimationCallback() {
+                    @Override
+                    public void onAnimationStart(Drawable drawable) {
+                        AnimationCallback.this.onAnimationStart(drawable);
+                    }
+
+                    @Override
+                    public void onAnimationEnd(Drawable drawable) {
+                        AnimationCallback.this.onAnimationEnd(drawable);
+                    }
+                };
+            }
+            return mPlatformCallback;
+        }
+    }
+}
diff --git a/graphics/drawable/animated/src/android/support/graphics/drawable/AnimatedVectorDrawableCompat.java b/graphics/drawable/animated/src/android/support/graphics/drawable/AnimatedVectorDrawableCompat.java
index fe60272..f3896d7 100644
--- a/graphics/drawable/animated/src/android/support/graphics/drawable/AnimatedVectorDrawableCompat.java
+++ b/graphics/drawable/animated/src/android/support/graphics/drawable/AnimatedVectorDrawableCompat.java
@@ -16,6 +16,7 @@
 
 import android.animation.Animator;
 import android.animation.AnimatorInflater;
+import android.animation.AnimatorListenerAdapter;
 import android.animation.AnimatorSet;
 import android.animation.ArgbEvaluator;
 import android.animation.ObjectAnimator;
@@ -51,19 +52,22 @@
 import java.util.List;
 
 /**
- * For API 24 and above, this class is delegating to the framework's {@link AnimatedVectorDrawable}.
+ * For API 24 and above, this class is delegating to the framework's {@link
+ * AnimatedVectorDrawable}.
  * For older API version, this class uses {@link android.animation.ObjectAnimator} and
  * {@link android.animation.AnimatorSet} to animate the properties of a
  * {@link VectorDrawableCompat} to create an animated drawable.
  * <p>
- * AnimatedVectorDrawableCompat are defined in the same XML format as {@link AnimatedVectorDrawable}.
+ * AnimatedVectorDrawableCompat are defined in the same XML format as {@link
+ * AnimatedVectorDrawable}.
  * </p>
  * You can always create a AnimatedVectorDrawableCompat object and use it as a Drawable by the Java
  * API. In order to refer to AnimatedVectorDrawableCompat inside a XML file, you can use
  * app:srcCompat attribute in AppCompat library's ImageButton or ImageView.
  */
 @SuppressLint("NewApi")
-public class AnimatedVectorDrawableCompat extends VectorDrawableCommon implements Animatable {
+public class AnimatedVectorDrawableCompat extends VectorDrawableCommon
+        implements Animatable2Compat {
     private static final String LOGTAG = "AnimatedVDCompat";
 
     private static final String ANIMATED_VECTOR = "animated-vector";
@@ -79,6 +83,13 @@
 
     AnimatedVectorDrawableDelegateState mCachedConstantStateDelegate;
 
+    // Use internal listener to support AVDC's callback.
+    private Animator.AnimatorListener mAnimatorListener = null;
+
+    // Use an array to keep track of multiple call back associated with one drawable.
+    private ArrayList<Animatable2Compat.AnimationCallback> mAnimationCallbacks = null;
+
+
     AnimatedVectorDrawableCompat() {
         this(null, null, null);
     }
@@ -88,8 +99,8 @@
     }
 
     private AnimatedVectorDrawableCompat(@Nullable Context context,
-                                         @Nullable AnimatedVectorDrawableCompatState state,
-                                         @Nullable Resources res) {
+            @Nullable AnimatedVectorDrawableCompatState state,
+            @Nullable Resources res) {
         mContext = context;
         if (state != null) {
             mAnimatedVectorState = state;
@@ -123,7 +134,7 @@
      */
     @Nullable
     public static AnimatedVectorDrawableCompat create(@NonNull Context context,
-                                                      @DrawableRes int resId) {
+            @DrawableRes int resId) {
         if (Build.VERSION.SDK_INT >= 24) {
             final AnimatedVectorDrawableCompat drawable = new AnimatedVectorDrawableCompat(context);
             drawable.mDelegateDrawable = ResourcesCompat.getDrawable(context.getResources(), resId,
@@ -200,7 +211,7 @@
             return;
         }
         mAnimatedVectorState.mVectorDrawable.draw(canvas);
-        if (isStarted()) {
+        if (mAnimatedVectorState.mAnimatorSet.isStarted()) {
             invalidateSelf();
         }
     }
@@ -405,9 +416,10 @@
                     a.recycle();
                 }
             }
-
             eventType = parser.next();
         }
+
+        mAnimatedVectorState.setupAnimatorSet();
     }
 
     @Override
@@ -488,7 +500,9 @@
     private static class AnimatedVectorDrawableCompatState extends ConstantState {
         int mChangingConfigurations;
         VectorDrawableCompat mVectorDrawable;
-        ArrayList<Animator> mAnimators;
+        // Combining the array of Animators into a single AnimatorSet to hook up listener easier.
+        AnimatorSet mAnimatorSet;
+        private ArrayList<Animator> mAnimators;
         ArrayMap<Animator, String> mTargetNameMap;
 
         public AnimatedVectorDrawableCompatState(Context context,
@@ -520,6 +534,7 @@
                         mAnimators.add(animClone);
                         mTargetNameMap.put(animClone, targetName);
                     }
+                    setupAnimatorSet();
                 }
             }
         }
@@ -538,6 +553,13 @@
         public int getChangingConfigurations() {
             return mChangingConfigurations;
         }
+
+        public void setupAnimatorSet() {
+            if (mAnimatorSet == null) {
+                mAnimatorSet = new AnimatorSet();
+            }
+            mAnimatorSet.playTogether(mAnimators);
+        }
     }
 
     /**
@@ -588,30 +610,7 @@
         if (mDelegateDrawable != null) {
             return ((AnimatedVectorDrawable) mDelegateDrawable).isRunning();
         }
-        final ArrayList<Animator> animators = mAnimatedVectorState.mAnimators;
-        final int size = animators.size();
-        for (int i = 0; i < size; i++) {
-            final Animator animator = animators.get(i);
-            if (animator.isRunning()) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    private boolean isStarted() {
-        final ArrayList<Animator> animators = mAnimatedVectorState.mAnimators;
-        if (animators == null) {
-            return false;
-        }
-        final int size = animators.size();
-        for (int i = 0; i < size; i++) {
-            final Animator animator = animators.get(i);
-            if (animator.isRunning()) {
-                return true;
-            }
-        }
-        return false;
+        return mAnimatedVectorState.mAnimatorSet.isRunning();
     }
 
     @Override
@@ -621,16 +620,11 @@
             return;
         }
         // If any one of the animator has not ended, do nothing.
-        if (isStarted()) {
+        if (mAnimatedVectorState.mAnimatorSet.isStarted()) {
             return;
         }
-        // Otherwise, kick off every animator.
-        final ArrayList<Animator> animators = mAnimatedVectorState.mAnimators;
-        final int size = animators.size();
-        for (int i = 0; i < size; i++) {
-            final Animator animator = animators.get(i);
-            animator.start();
-        }
+        // Otherwise, kick off animatorSet.
+        mAnimatedVectorState.mAnimatorSet.start();
         invalidateSelf();
     }
 
@@ -640,12 +634,7 @@
             ((AnimatedVectorDrawable) mDelegateDrawable).stop();
             return;
         }
-        final ArrayList<Animator> animators = mAnimatedVectorState.mAnimators;
-        final int size = animators.size();
-        for (int i = 0; i < size; i++) {
-            final Animator animator = animators.get(i);
-            animator.end();
-        }
+        mAnimatedVectorState.mAnimatorSet.end();
     }
 
     final Callback mCallback = new Callback() {
@@ -664,4 +653,180 @@
             unscheduleSelf(what);
         }
     };
+
+    /**
+     * A helper function to unregister the Animatable2Compat callback from the platform's
+     * Animatable2 callback, while keeping the internal array of callback up to date.
+     */
+    private static boolean unregisterPlatformCallback(AnimatedVectorDrawable dr,
+            Animatable2Compat.AnimationCallback callback) {
+        return dr.unregisterAnimationCallback(callback.getPlatformCallback());
+    }
+
+    @Override
+    public void registerAnimationCallback(@NonNull Animatable2Compat.AnimationCallback
+            callback) {
+        if (mDelegateDrawable != null) {
+            registerPlatformCallback((AnimatedVectorDrawable) mDelegateDrawable, callback);
+            return;
+        }
+
+        if (callback == null) {
+            return;
+        }
+
+        // Add listener accordingly.
+        if (mAnimationCallbacks == null) {
+            mAnimationCallbacks = new ArrayList<>();
+        }
+
+        if (mAnimationCallbacks.contains(callback)) {
+            // If this call back is already in, then don't need to append another copy.
+            return;
+        }
+
+        mAnimationCallbacks.add(callback);
+
+        if (mAnimatorListener == null) {
+            // Create a animator listener and trigger the callback events when listener is
+            // triggered.
+            mAnimatorListener = new AnimatorListenerAdapter() {
+                @Override
+                public void onAnimationStart(Animator animation) {
+                    ArrayList<Animatable2Compat.AnimationCallback> tmpCallbacks =
+                            new ArrayList<>(mAnimationCallbacks);
+                    int size = tmpCallbacks.size();
+                    for (int i = 0; i < size; i++) {
+                        tmpCallbacks.get(i).onAnimationStart(AnimatedVectorDrawableCompat.this);
+                    }
+                }
+
+                @Override
+                public void onAnimationEnd(Animator animation) {
+                    ArrayList<Animatable2Compat.AnimationCallback> tmpCallbacks =
+                            new ArrayList<>(mAnimationCallbacks);
+                    int size = tmpCallbacks.size();
+                    for (int i = 0; i < size; i++) {
+                        tmpCallbacks.get(i).onAnimationEnd(AnimatedVectorDrawableCompat.this);
+                    }
+                }
+            };
+        }
+        mAnimatedVectorState.mAnimatorSet.addListener(mAnimatorListener);
+    }
+
+    /**
+     * A helper function to register the Animatable2Compat callback on the platform's Animatable2
+     * callback.
+     */
+    private static void registerPlatformCallback(@NonNull AnimatedVectorDrawable avd,
+            @NonNull final Animatable2Compat.AnimationCallback callback) {
+        avd.registerAnimationCallback(callback.getPlatformCallback());
+    }
+
+    /**
+     * A helper function to clean up the animator listener in the mAnimatorSet.
+     */
+    private void removeAnimatorSetListener() {
+        if (mAnimatorListener != null) {
+            mAnimatedVectorState.mAnimatorSet.removeListener(mAnimatorListener);
+            mAnimatorListener = null;
+        }
+    }
+
+    @Override
+    public boolean unregisterAnimationCallback(
+            @NonNull Animatable2Compat.AnimationCallback callback) {
+        if (mDelegateDrawable != null) {
+            unregisterPlatformCallback((AnimatedVectorDrawable) mDelegateDrawable, callback);
+        }
+
+        if (mAnimationCallbacks == null || callback == null) {
+            // Nothing to be removed.
+            return false;
+        }
+        boolean removed = mAnimationCallbacks.remove(callback);
+
+        //  When the last call back unregistered, remove the listener accordingly.
+        if (mAnimationCallbacks.size() == 0) {
+            removeAnimatorSetListener();
+        }
+        return removed;
+    }
+
+    @Override
+    public void clearAnimationCallbacks() {
+        if (mDelegateDrawable != null) {
+            ((AnimatedVectorDrawable) mDelegateDrawable).clearAnimationCallbacks();
+            return;
+        }
+        removeAnimatorSetListener();
+        if (mAnimationCallbacks == null) {
+            return;
+        }
+
+        mAnimationCallbacks.clear();
+    }
+
+    /**
+     * Utility function to register callback to Drawable, when the drawable is created from XML and
+     * referred in Java code, e.g: ImageView.getDrawable().
+     * From API 24 on, the drawable is treated as an AnimatedVectorDrawable.
+     * Otherwise, it is treated as AnimatedVectorDrawableCompat.
+     */
+    public static void registerAnimationCallback(Drawable dr,
+            Animatable2Compat.AnimationCallback callback) {
+        if (dr == null || callback == null) {
+            return;
+        }
+        if (!(dr instanceof Animatable)) {
+            return;
+        }
+
+        if (Build.VERSION.SDK_INT >= 24) {
+            registerPlatformCallback((AnimatedVectorDrawable) dr, callback);
+        } else {
+            ((AnimatedVectorDrawableCompat) dr).registerAnimationCallback(callback);
+        }
+    }
+
+    /**
+     * Utility function to unregister animation callback from Drawable, when the drawable is
+     * created from XML and referred in Java code, e.g: ImageView.getDrawable().
+     * From API 24 on, the drawable is treated as an AnimatedVectorDrawable.
+     * Otherwise, it is treated as AnimatedVectorDrawableCompat.
+     */
+    public static boolean unregisterAnimationCallback(Drawable dr,
+            Animatable2Compat.AnimationCallback callback) {
+        if (dr == null || callback == null) {
+            return false;
+        }
+        if (!(dr instanceof Animatable)) {
+            return false;
+        }
+
+        if (Build.VERSION.SDK_INT >= 24) {
+            return unregisterPlatformCallback((AnimatedVectorDrawable) dr, callback);
+        } else {
+            return ((AnimatedVectorDrawableCompat) dr).unregisterAnimationCallback(callback);
+        }
+    }
+
+    /**
+     * Utility function to clear animation callbacks from Drawable, when the drawable is
+     * created from XML and referred in Java code, e.g: ImageView.getDrawable().
+     * From API 24 on, the drawable is treated as an AnimatedVectorDrawable.
+     * Otherwise, it is treated as AnimatedVectorDrawableCompat.
+     */
+    public static void clearAnimationCallbacks(Drawable dr) {
+        if (dr == null || !(dr instanceof Animatable)) {
+            return;
+        }
+        if (Build.VERSION.SDK_INT >= 24) {
+            ((AnimatedVectorDrawable) dr).clearAnimationCallbacks();
+        } else {
+            ((AnimatedVectorDrawableCompat) dr).clearAnimationCallbacks();
+        }
+
+    }
 }
diff --git a/graphics/drawable/animated/tests/src/android/support/graphics/drawable/tests/AnimatedVectorDrawableTest.java b/graphics/drawable/animated/tests/src/android/support/graphics/drawable/tests/AnimatedVectorDrawableTest.java
index 5b44b2a..7cae5e8 100644
--- a/graphics/drawable/animated/tests/src/android/support/graphics/drawable/tests/AnimatedVectorDrawableTest.java
+++ b/graphics/drawable/animated/tests/src/android/support/graphics/drawable/tests/AnimatedVectorDrawableTest.java
@@ -17,6 +17,7 @@
 package android.support.graphics.drawable.tests;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
@@ -28,8 +29,10 @@
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
 import android.graphics.Color;
+import android.graphics.drawable.Drawable;
 import android.graphics.drawable.Drawable.ConstantState;
 import android.support.annotation.DrawableRes;
+import android.support.graphics.drawable.Animatable2Compat;
 import android.support.graphics.drawable.AnimatedVectorDrawableCompat;
 import android.support.graphics.drawable.animated.test.R;
 import android.support.test.InstrumentationRegistry;
@@ -69,8 +72,9 @@
 
     private static final int IMAGE_WIDTH = 64;
     private static final int IMAGE_HEIGHT = 64;
-    private static final @DrawableRes int DRAWABLE_RES_ID =
-            R.drawable.animation_vector_drawable_grouping_1;
+
+    @DrawableRes
+    private static final int DRAWABLE_RES_ID = R.drawable.animation_vector_drawable_grouping_1;
 
     private Context mContext;
     private Resources mResources;
@@ -79,6 +83,26 @@
     private Canvas mCanvas;
     private static final boolean DBG_DUMP_PNG = false;
 
+    // States to check for animation callback tests.
+    private boolean mAnimationStarted = false;
+    private boolean mAnimationEnded = false;
+
+    // Animation callback used for all callback related tests.
+    private Animatable2Compat.AnimationCallback mAnimationCallback =
+            new Animatable2Compat.AnimationCallback() {
+                @Override
+                public void onAnimationStart(
+                        Drawable drawable) {
+                    mAnimationStarted = true;
+                }
+
+                @Override
+                public void onAnimationEnd(
+                        Drawable drawable) {
+                    mAnimationEnded = true;
+                }
+            };
+
     public AnimatedVectorDrawableTest() {
         mActivityTestRule = new ActivityTestRule<>(DrawableStubActivity.class);
     }
@@ -389,4 +413,81 @@
             assertEquals(d1.mutate(), d1);
         }
     }
+
+    /**
+     * A helper function to setup the AVDC for callback tests.
+     */
+    private AnimatedVectorDrawableCompat setupAnimatedVectorDrawableCompat() {
+        final ImageButton imageButton =
+                (ImageButton) mActivityTestRule.getActivity().findViewById(R.id.imageButton);
+        mAnimationStarted = false;
+        mAnimationEnded = false;
+
+        AnimatedVectorDrawableCompat avd = AnimatedVectorDrawableCompat.create(mContext,
+                R.drawable.animation_vector_drawable_grouping_1); // Duration is 50 ms.
+        ViewCompat.setBackground(imageButton, avd);
+        return avd;
+    }
+
+    @Test
+    /**
+     * Test show that callback is successfully registered.
+     * Note that this test requires screen is on.
+     */
+    public void testRegisterCallback() throws Throwable {
+        InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
+            @Override
+            public void run() {
+                AnimatedVectorDrawableCompat avd = setupAnimatedVectorDrawableCompat();
+                avd.registerAnimationCallback(mAnimationCallback);
+                avd.start();
+            }
+        });
+        Thread.sleep(500);
+        assertTrue(mAnimationStarted);
+        assertTrue(mAnimationEnded);
+    }
+
+    @Test
+    /**
+     * Test show that callback is successfully removed.
+     * Note that this test requires screen is on.
+     */
+    public void testClearCallback() throws Throwable {
+        InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
+            @Override
+            public void run() {
+                AnimatedVectorDrawableCompat avd =
+                        setupAnimatedVectorDrawableCompat();
+                avd.registerAnimationCallback(mAnimationCallback);
+                avd.clearAnimationCallbacks();
+                avd.start();
+            }
+        });
+        Thread.sleep(500);
+        assertFalse(mAnimationStarted);
+        assertFalse(mAnimationEnded);
+    }
+
+    @Test
+    /**
+     * Test show that callback is successfully unregistered.
+     * Note that this test requires screen is on.
+     */
+    public void testUnregisterCallback() throws Throwable {
+        InstrumentationRegistry.getInstrumentation().runOnMainSync(new Runnable() {
+            @Override
+            public void run() {
+                AnimatedVectorDrawableCompat avd =
+                        setupAnimatedVectorDrawableCompat();
+
+                avd.registerAnimationCallback(mAnimationCallback);
+                avd.unregisterAnimationCallback(mAnimationCallback);
+                avd.start();
+            }
+        });
+        Thread.sleep(500);
+        assertFalse(mAnimationStarted);
+        assertFalse(mAnimationEnded);
+    }
 }
diff --git a/samples/SupportVectorDrawable/animated/AndroidManifest.xml b/samples/SupportVectorDrawable/animated/AndroidManifest.xml
deleted file mode 100644
index 55d6bc6..0000000
--- a/samples/SupportVectorDrawable/animated/AndroidManifest.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     Copyright (C) 2015 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.android.support.vectordrawable" >
-
-    <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="23"/>
-
-    <application android:icon="@drawable/app_sample_code" android:label="AnimatedVectorDrawableCompatTest" >
-        <activity android:name="com.example.android.support.vectordrawable.app.AnimatedButtonBackground" />
-        <intent-filter>
-            <action android:name="android.intent.action.MAIN" />
-
-            <category android:name="android.intent.category.LAUNCHER" />
-        </intent-filter>
-    </application>
-
-</manifest>
\ No newline at end of file
diff --git a/samples/SupportVectorDrawable/animated/res/drawable/app_sample_code.png b/samples/SupportVectorDrawable/animated/res/drawable/app_sample_code.png
deleted file mode 100755
index 66a1984..0000000
--- a/samples/SupportVectorDrawable/animated/res/drawable/app_sample_code.png
+++ /dev/null
Binary files differ
diff --git a/samples/SupportVectorDrawable/animated/res/values/strings.xml b/samples/SupportVectorDrawable/animated/res/values/strings.xml
deleted file mode 100644
index c5451c8..0000000
--- a/samples/SupportVectorDrawable/animated/res/values/strings.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     Copyright (C) 2015 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-
-<resources>
-
-    <string name="twoLinePathData">"M 0,0 v 100 M 0,0 h 100"</string>
-    <string name="triangle"> "M300,70 l 0,-70 70,70 0,0   -70,70z"</string>
-    <string name="rectangle">"M300,70 l 0,-70 70,0  0,140 -70,0 z"</string>
-    <string name="rectangle2">"M300,70 l 0,-70 70,0  0,70z M300,70  l 70,0 0,70 -70,0z"</string>
-    <string name="equal2">    "M300,35 l 0,-35 70,0  0,35z M300,105 l 70,0 0,35 -70,0z"</string>
-    <string name="round_box">"m2.10001,-6c-1.9551,0 -0.5,0.02499 -2.10001,0.02499c-1.575,0 0.0031,-0.02499 -1.95,-0.02499c-2.543,0 -4,2.2816 -4,4.85001c0,3.52929 0.25,6.25 5.95,6.25c5.7,0 6,-2.72071 6,-6.25c0,-2.56841 -1.35699,-4.85001 -3.89999,-4.85001"</string>
-    <string name="heart">    "m4.5,-7c-1.95509,0 -3.83009,1.26759 -4.5,3c-0.66991,-1.73241 -2.54691,-3 -4.5,-3c-2.543,0 -4.5,1.93159 -4.5,4.5c0,3.5293 3.793,6.2578 9,11.5c5.207,-5.2422 9,-7.9707 9,-11.5c0,-2.56841 -1.957,-4.5 -4.5,-4.5"</string>
-    <string name="rectangle200">"M 0,0 l 200,0 l 0, 200 l -200, 0 z"</string>
-</resources>
\ No newline at end of file
diff --git a/samples/SupportVectorDrawable/animated/rundemo.sh b/samples/SupportVectorDrawable/animated/rundemo.sh
deleted file mode 100755
index e5972f7..0000000
--- a/samples/SupportVectorDrawable/animated/rundemo.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-. $ANDROID_BUILD_TOP/build/envsetup.sh && \
-mmm -j20 . && \
-adb install -r $OUT/data/app/SupportAnimatedVectorDrawable/SupportAnimatedVectorDrawable.apk && \
-adb shell am start -n com.example.android.support.vectordrawable/com.example.android.support.vectordrawable.app.AnimatedButtonBackground
-
-
diff --git a/samples/SupportVectorDrawable/static/Android.mk b/samples/SupportVectorDrawable/static/Android.mk
deleted file mode 100644
index bdc102a..0000000
--- a/samples/SupportVectorDrawable/static/Android.mk
+++ /dev/null
@@ -1,25 +0,0 @@
-LOCAL_PATH:= $(call my-dir)
-include $(CLEAR_VARS)
-
-LOCAL_USE_AAPT2 := true
-
-LOCAL_MODULE_TAGS := samples tests
-
-LOCAL_SRC_FILES := $(call all-java-files-under, src)
-
-LOCAL_PACKAGE_NAME := SupportVectorDrawable
-
-LOCAL_STATIC_ANDROID_LIBRARIES := android-support-vectordrawable android-support-v4
-
-LOCAL_SDK_VERSION := current
-
-LOCAL_MIN_SDK_VERSION := 7
-
-LOCAL_AAPT_FLAGS += --no-version-vectors
-
-include $(BUILD_PACKAGE)
-
-LOCAL_PROGUARD_FLAG_FILES := proguard.flags
-
-# Use the following include to make our test apk.
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/samples/SupportVectorDrawable/static/AndroidManifest.xml b/samples/SupportVectorDrawable/static/AndroidManifest.xml
deleted file mode 100644
index 53fc9c2..0000000
--- a/samples/SupportVectorDrawable/static/AndroidManifest.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-     Copyright (C) 2015 The Android Open Source Project
-
-     Licensed under the Apache License, Version 2.0 (the "License");
-     you may not use this file except in compliance with the License.
-     You may obtain a copy of the License at
-
-          http://www.apache.org/licenses/LICENSE-2.0
-
-     Unless required by applicable law or agreed to in writing, software
-     distributed under the License is distributed on an "AS IS" BASIS,
-     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-     See the License for the specific language governing permissions and
-     limitations under the License.
--->
-<manifest xmlns:android="http://schemas.android.com/apk/res/android"
-    package="com.example.android.support.vectordrawable" >
-
-    <uses-sdk android:minSdkVersion="7" android:targetSdkVersion="23"/>
-
-    <application android:icon="@drawable/app_sample_code" android:label="VectorDrawableCompatTest" >
-        <activity android:name=".app.SimpleButtonBackground" />
-
-        <intent-filter>
-            <action android:name="android.intent.action.MAIN" />
-
-            <category android:name="android.intent.category.LAUNCHER" />
-        </intent-filter>
-    </application>
-
-</manifest>
diff --git a/samples/SupportVectorDrawable/static/rundemo.sh b/samples/SupportVectorDrawable/static/rundemo.sh
deleted file mode 100755
index 2695b53..0000000
--- a/samples/SupportVectorDrawable/static/rundemo.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-. $ANDROID_BUILD_TOP/build/envsetup.sh && \
-mmm -j20 . && \
-adb install -r $OUT/data/app/SupportVectorDrawable/SupportVectorDrawable.apk && \
-adb shell am start -n com.example.android.support.vectordrawable/com.example.android.support.vectordrawable.app.SimpleButtonBackground
-
-
diff --git a/samples/SupportVectorDrawable/animated/Android.mk b/samples/SupportVectorDrawableDemos/Android.mk
similarity index 88%
rename from samples/SupportVectorDrawable/animated/Android.mk
rename to samples/SupportVectorDrawableDemos/Android.mk
index ae01691..376f841 100644
--- a/samples/SupportVectorDrawable/animated/Android.mk
+++ b/samples/SupportVectorDrawableDemos/Android.mk
@@ -18,17 +18,18 @@
 
 LOCAL_USE_AAPT2 := true
 
-LOCAL_MODULE_TAGS := tests
+LOCAL_MODULE_TAGS := samples tests
 
 LOCAL_SDK_VERSION := current
 
-LOCAL_MIN_SDK_VERSION := 11
+LOCAL_MIN_SDK_VERSION := 14
 
 LOCAL_SRC_FILES := $(call all-java-files-under, src)
 
-LOCAL_PACKAGE_NAME := SupportAnimatedVectorDrawable
+LOCAL_PACKAGE_NAME := SupportVectorDrawableDemos
 
 LOCAL_STATIC_ANDROID_LIBRARIES := \
+        android-support-v7-appcompat \
         android-support-animatedvectordrawable \
         android-support-vectordrawable \
         android-support-v4
diff --git a/samples/SupportVectorDrawableDemos/AndroidManifest.xml b/samples/SupportVectorDrawableDemos/AndroidManifest.xml
new file mode 100644
index 0000000..1de3a5f
--- /dev/null
+++ b/samples/SupportVectorDrawableDemos/AndroidManifest.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+     Copyright (C) 2015 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.example.android.support.vectordrawable" >
+
+    <uses-sdk android:minSdkVersion="11" android:targetSdkVersion="23"/>
+
+    <application android:icon="@drawable/app_sample_code" android:label="SupportVectorDrawableDemos" >
+        <activity android:name="com.example.android.support.vectordrawable.app.SupportVectorDrawableDemos">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="com.example.android.support.vectordrawable.app.SimpleAnimatedVectorDrawable"
+                  android:label="SimpleAnimatedVectorDrawable">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="com.example.android.support.vectordrawable.app.SimpleStaticVectorDrawable"
+                  android:label="SimpleVectorDrawable">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="com.example.android.support.vectordrawable.app.AVDCListenerDemo"
+                  android:label="AnimatedVectorDrawableCompatListener"
+                  android:theme="@style/Theme.AppCompat.Light">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.SAMPLE_CODE" />
+            </intent-filter>
+        </activity>
+    </application>
+
+</manifest>
\ No newline at end of file
diff --git a/samples/SupportVectorDrawableDemos/build.gradle b/samples/SupportVectorDrawableDemos/build.gradle
new file mode 100644
index 0000000..8557c6b
--- /dev/null
+++ b/samples/SupportVectorDrawableDemos/build.gradle
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+apply plugin: 'com.android.application'
+
+dependencies {
+    compile project(':support-vector-drawable')
+    compile project(':support-animated-vector-drawable')
+    compile project(':support-appcompat-v7')
+}
+
+android {
+    compileSdkVersion project.ext.currentSdk
+
+    defaultConfig {
+        minSdkVersion 14
+        vectorDrawables.useSupportLibrary = true
+    }
+
+    sourceSets {
+        main.manifest.srcFile 'AndroidManifest.xml'
+        main.java.srcDirs = ['src']
+        main.aidl.srcDirs = ['src']
+        main.res.srcDirs = ['res']
+    }
+
+    lintOptions {
+        abortOnError false
+    }
+
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_7
+        targetCompatibility JavaVersion.VERSION_1_7
+    }
+}
+
diff --git a/samples/SupportVectorDrawable/animated/res/anim/alpha_animation_progress_bar.xml b/samples/SupportVectorDrawableDemos/res/anim/alpha_animation_progress_bar.xml
similarity index 100%
rename from samples/SupportVectorDrawable/animated/res/anim/alpha_animation_progress_bar.xml
rename to samples/SupportVectorDrawableDemos/res/anim/alpha_animation_progress_bar.xml
diff --git a/samples/SupportVectorDrawable/animated/res/anim/animation_grouping_1_01.xml b/samples/SupportVectorDrawableDemos/res/anim/animation_grouping_1_01.xml
similarity index 75%
rename from samples/SupportVectorDrawable/animated/res/anim/animation_grouping_1_01.xml
rename to samples/SupportVectorDrawableDemos/res/anim/animation_grouping_1_01.xml
index 36c297f..9a89d63 100644
--- a/samples/SupportVectorDrawable/animated/res/anim/animation_grouping_1_01.xml
+++ b/samples/SupportVectorDrawableDemos/res/anim/animation_grouping_1_01.xml
@@ -16,7 +16,8 @@
 -->
 
 <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
-    android:duration="3300"
-    android:propertyName="rotation"
-    android:valueFrom="0"
-    android:valueTo="450" />
+                android:duration="3300"
+                android:interpolator="@android:anim/linear_interpolator"
+                android:propertyName="rotation"
+                android:valueFrom="0"
+                android:valueTo="450"/>
diff --git a/samples/SupportVectorDrawable/animated/res/anim/trim_path_animation_progress_bar.xml b/samples/SupportVectorDrawableDemos/res/anim/trim_path_animation_progress_bar.xml
similarity index 100%
rename from samples/SupportVectorDrawable/animated/res/anim/trim_path_animation_progress_bar.xml
rename to samples/SupportVectorDrawableDemos/res/anim/trim_path_animation_progress_bar.xml
diff --git a/samples/SupportVectorDrawable/animated/res/drawable/animation_vector_drawable_grouping_1.xml b/samples/SupportVectorDrawableDemos/res/drawable/animation_vector_drawable_grouping_1.xml
similarity index 100%
rename from samples/SupportVectorDrawable/animated/res/drawable/animation_vector_drawable_grouping_1.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/animation_vector_drawable_grouping_1.xml
diff --git a/samples/SupportVectorDrawable/animated/res/drawable/animation_vector_progress_bar.xml b/samples/SupportVectorDrawableDemos/res/drawable/animation_vector_progress_bar.xml
similarity index 100%
rename from samples/SupportVectorDrawable/animated/res/drawable/animation_vector_progress_bar.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/animation_vector_progress_bar.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/app_sample_code.png b/samples/SupportVectorDrawableDemos/res/drawable/app_sample_code.png
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/app_sample_code.png
rename to samples/SupportVectorDrawableDemos/res/drawable/app_sample_code.png
Binary files differ
diff --git a/samples/SupportVectorDrawable/animated/res/drawable/btn_radio_on_to_off_bundle.xml b/samples/SupportVectorDrawableDemos/res/drawable/btn_radio_on_to_off_bundle.xml
similarity index 100%
rename from samples/SupportVectorDrawable/animated/res/drawable/btn_radio_on_to_off_bundle.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/btn_radio_on_to_off_bundle.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable01.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable01.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable01.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable01.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable02.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable02.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable02.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable02.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable03.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable03.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable03.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable03.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable04.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable04.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable04.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable04.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable05.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable05.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable05.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable05.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable06.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable06.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable06.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable06.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable07.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable07.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable07.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable07.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable08.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable08.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable08.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable08.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable09.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable09.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable09.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable09.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable10.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable10.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable10.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable10.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable11.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable11.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable11.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable11.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable12.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable12.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable12.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable12.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable13.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable13.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable13.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable13.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable14.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable14.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable14.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable14.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable15.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable15.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable15.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable15.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable16.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable16.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable16.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable16.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable17.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable17.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable17.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable17.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable18.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable18.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable18.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable18.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable19.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable19.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable19.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable19.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable20.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable20.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable20.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable20.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable21.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable21.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable21.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable21.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable22.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable22.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable22.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable22.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable23.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable23.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable23.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable23.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable24.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable24.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable24.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable24.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable25.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable25.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable25.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable25.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable26.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable26.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable26.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable26.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable27.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable27.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable27.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable27.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable28.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable28.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable28.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable28.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable29.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable29.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable29.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable29.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable30.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable30.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable30.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable30.xml
diff --git a/samples/SupportVectorDrawable/animated/res/drawable/vector_drawable_grouping_1.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable_grouping_1.xml
similarity index 100%
rename from samples/SupportVectorDrawable/animated/res/drawable/vector_drawable_grouping_1.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable_grouping_1.xml
diff --git a/samples/SupportVectorDrawable/animated/res/drawable/vector_drawable_progress_bar.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable_progress_bar.xml
similarity index 100%
rename from samples/SupportVectorDrawable/animated/res/drawable/vector_drawable_progress_bar.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable_progress_bar.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable_scale0.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable_scale0.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable_scale0.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable_scale0.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable_scale1.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable_scale1.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable_scale1.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable_scale1.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable_scale2.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable_scale2.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable_scale2.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable_scale2.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_drawable_scale3.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_drawable_scale3.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_drawable_scale3.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_drawable_scale3.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_test01.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_test01.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_test01.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_test01.xml
diff --git a/samples/SupportVectorDrawable/static/res/drawable/vector_test02.xml b/samples/SupportVectorDrawableDemos/res/drawable/vector_test02.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/drawable/vector_test02.xml
rename to samples/SupportVectorDrawableDemos/res/drawable/vector_test02.xml
diff --git a/samples/SupportVectorDrawableDemos/res/layout/avdc_listener.xml b/samples/SupportVectorDrawableDemos/res/layout/avdc_listener.xml
new file mode 100644
index 0000000..279a7cf
--- /dev/null
+++ b/samples/SupportVectorDrawableDemos/res/layout/avdc_listener.xml
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2017 The Android Open Source Project
+  ~
+  ~ Licensed under the Apache License, Version 2.0 (the "License");
+  ~ you may not use this file except in compliance with the License.
+  ~ You may obtain a copy of the License at
+  ~
+  ~      http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing, software
+  ~ distributed under the License is distributed on an "AS IS" BASIS,
+  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~ See the License for the specific language governing permissions and
+  ~ limitations under the License.
+  -->
+
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+              xmlns:app="http://schemas.android.com/apk/res-auto"
+              android:orientation="vertical"
+              android:layout_width="match_parent"
+              android:layout_height="match_parent" android:weightSum="1">
+
+    <android.support.v7.widget.AppCompatImageView
+        app:srcCompat="@drawable/animation_vector_drawable_grouping_1"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" android:id="@+id/imageView"/>
+    <TextView
+        android:text="TextView"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" android:id="@+id/textView"/>
+    <TextView
+        android:text="TextView"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" android:id="@+id/textView2"/>
+    <android.support.v7.widget.AppCompatImageView
+        app:srcCompat="@drawable/btn_radio_on_to_off_bundle"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" android:id="@+id/imageView2"/>
+    <TextView
+        android:text="TextView"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" android:id="@+id/textView3"/>
+    <TextView
+        android:text="TextView"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content" android:id="@+id/textView4"/>
+</LinearLayout>
\ No newline at end of file
diff --git a/samples/SupportVectorDrawable/static/res/raw/vector_drawable01.xml b/samples/SupportVectorDrawableDemos/res/raw/vector_drawable01.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/raw/vector_drawable01.xml
rename to samples/SupportVectorDrawableDemos/res/raw/vector_drawable01.xml
diff --git a/samples/SupportVectorDrawable/static/res/values/colors.xml b/samples/SupportVectorDrawableDemos/res/values/colors.xml
similarity index 100%
rename from samples/SupportVectorDrawable/static/res/values/colors.xml
rename to samples/SupportVectorDrawableDemos/res/values/colors.xml
diff --git a/samples/SupportVectorDrawable/static/res/values/strings.xml b/samples/SupportVectorDrawableDemos/res/values/strings.xml
similarity index 99%
rename from samples/SupportVectorDrawable/static/res/values/strings.xml
rename to samples/SupportVectorDrawableDemos/res/values/strings.xml
index 065e7d9..a59ad14 100644
--- a/samples/SupportVectorDrawable/static/res/values/strings.xml
+++ b/samples/SupportVectorDrawableDemos/res/values/strings.xml
@@ -16,7 +16,6 @@
 -->
 
 <resources>
-
     <string name="twoLinePathData">"M 0,0 v 100 M 0,0 h 100"</string>
     <string name="triangle"> "M300,70 l 0,-70 70,70 0,0   -70,70z"</string>
     <string name="rectangle">"M300,70 l 0,-70 70,0  0,140 -70,0 z"</string>
@@ -26,4 +25,4 @@
     <string name="heart">    "m4.5,-7c-1.95509,0 -3.83009,1.26759 -4.5,3c-0.66991,-1.73241 -2.54691,-3 -4.5,-3c-2.543,0 -4.5,1.93159 -4.5,4.5c0,3.5293 3.793,6.2578 9,11.5c5.207,-5.2422 9,-7.9707 9,-11.5c0,-2.56841 -1.957,-4.5 -4.5,-4.5"</string>
     <string name="rectangle200">"M 0,0 l 200,0 l 0, 200 l -200, 0 z"</string>
     <string name="triangle100">"M 100, 0 l 0, 100, -100, 0 z"</string>
-</resources>
+</resources>
\ No newline at end of file
diff --git a/samples/SupportVectorDrawableDemos/src/com/example/android/support/vectordrawable/app/AVDCListenerDemo.java b/samples/SupportVectorDrawableDemos/src/com/example/android/support/vectordrawable/app/AVDCListenerDemo.java
new file mode 100644
index 0000000..f228a43
--- /dev/null
+++ b/samples/SupportVectorDrawableDemos/src/com/example/android/support/vectordrawable/app/AVDCListenerDemo.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.support.vectordrawable.app;
+
+import android.graphics.drawable.Animatable;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.support.graphics.drawable.Animatable2Compat;
+import android.support.graphics.drawable.AnimatedVectorDrawableCompat;
+import android.support.v7.app.AppCompatActivity;
+import android.support.v7.widget.AppCompatImageView;
+import android.view.MotionEvent;
+import android.view.View;
+import android.widget.TextView;
+
+import com.example.android.support.vectordrawable.R;
+
+/**
+ * A demo for AnimatedVectorDrawableCompat's listener support.
+ */
+public class AVDCListenerDemo extends AppCompatActivity {
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.avdc_listener);
+        final AppCompatImageView imageView1 = (AppCompatImageView) findViewById(R.id.imageView);
+        final AppCompatImageView imageView2 = (AppCompatImageView) findViewById(R.id.imageView2);
+
+        final TextView textView1 = (TextView) findViewById(R.id.textView);
+        textView1.setText("Should show start / end for first AVD");
+        final TextView textView2 = (TextView) findViewById(R.id.textView2);
+        textView2.setText("Not affected by AVD, b/c removed after register");
+        final TextView textView3 = (TextView) findViewById(R.id.textView3);
+        textView3.setText("Should show start / end for second AVD");
+        final TextView textView4 = (TextView) findViewById(R.id.textView4);
+        textView4.setText("Not affected by AVD, b/c unregistered after register");
+
+        final Drawable drawable1 = imageView1.getDrawable();
+        final Drawable drawable2 = imageView2.getDrawable();
+
+        Animatable2Compat.AnimationCallback textView1Callback = new
+                Animatable2Compat.AnimationCallback() {
+                    @Override
+                    public void onAnimationStart(Drawable drawable) {
+                        textView1.setText("AVD 1 started");
+                    }
+
+                    @Override
+                    public void onAnimationEnd(Drawable drawable) {
+                        textView1.setText("AVD 1 Ended");
+                    }
+                };
+        Animatable2Compat.AnimationCallback textView2Callback = new
+                Animatable2Compat.AnimationCallback() {
+                    @Override
+                    public void onAnimationStart(Drawable drawable) {
+                        textView2.setText("AVD 1 started");
+                    }
+
+                    @Override
+                    public void onAnimationEnd(Drawable drawable) {
+                        textView2.setText("AVD 1 Ended");
+                    }
+                };
+        AnimatedVectorDrawableCompat.registerAnimationCallback(drawable1, textView1Callback);
+        AnimatedVectorDrawableCompat.registerAnimationCallback(drawable1, textView2Callback);
+        AnimatedVectorDrawableCompat.clearAnimationCallbacks(drawable1);
+        AnimatedVectorDrawableCompat.registerAnimationCallback(drawable1, textView1Callback);
+
+        AnimatedVectorDrawableCompat.registerAnimationCallback(drawable2,
+                new Animatable2Compat.AnimationCallback() {
+                    @Override
+                    public void onAnimationStart(Drawable drawable) {
+                        textView3.setText("AVD 2 started");
+                    }
+
+                    @Override
+                    public void onAnimationEnd(Drawable drawable) {
+                        textView3.setText("AVD 2 Ended");
+                    }
+                });
+
+        Animatable2Compat.AnimationCallback textView4Callback = new
+                Animatable2Compat.AnimationCallback() {
+                    @Override
+                    public void onAnimationStart(Drawable drawable) {
+                        textView4.setText("AVD 2 started");
+                    }
+
+                    @Override
+                    public void onAnimationEnd(Drawable drawable) {
+                        textView4.setText("AVD 2 Ended");
+                    }
+                };
+
+        AnimatedVectorDrawableCompat.registerAnimationCallback(drawable2, textView4Callback);
+        AnimatedVectorDrawableCompat.unregisterAnimationCallback(drawable2, textView4Callback);
+
+        // Touch the imageView will run the AVD.
+        imageView1.setOnTouchListener(new View.OnTouchListener() {
+            @Override
+            public boolean onTouch(View v, MotionEvent event) {
+                if (!((Animatable) drawable1).isRunning()) {
+                    ((Animatable) drawable1).start();
+                }
+                return true;
+            }
+        });
+
+        imageView2.setOnTouchListener(new View.OnTouchListener() {
+            @Override
+            public boolean onTouch(View v, MotionEvent event) {
+                if (!((Animatable) drawable2).isRunning()) {
+                    ((Animatable) drawable2).start();
+                }
+                return true;
+            }
+        });
+    }
+}
diff --git a/samples/SupportVectorDrawable/animated/src/com/example/android/support/vectordrawable/app/AnimatedButtonBackground.java b/samples/SupportVectorDrawableDemos/src/com/example/android/support/vectordrawable/app/SimpleAnimatedVectorDrawable.java
similarity index 79%
rename from samples/SupportVectorDrawable/animated/src/com/example/android/support/vectordrawable/app/AnimatedButtonBackground.java
rename to samples/SupportVectorDrawableDemos/src/com/example/android/support/vectordrawable/app/SimpleAnimatedVectorDrawable.java
index d8381d1..76f6770 100644
--- a/samples/SupportVectorDrawable/animated/src/com/example/android/support/vectordrawable/app/AnimatedButtonBackground.java
+++ b/samples/SupportVectorDrawableDemos/src/com/example/android/support/vectordrawable/app/SimpleAnimatedVectorDrawable.java
@@ -16,7 +16,6 @@
 
 package com.example.android.support.vectordrawable.app;
 
-import android.animation.ObjectAnimator;
 import android.app.Activity;
 import android.content.res.Resources;
 import android.os.Bundle;
@@ -26,24 +25,26 @@
 import android.widget.LinearLayout;
 import android.widget.ScrollView;
 import android.widget.TextView;
+
 import com.example.android.support.vectordrawable.R;
 
 import java.text.DecimalFormat;
 
-public class AnimatedButtonBackground extends Activity implements View.OnClickListener{
+/**
+ * Simple demo for AnimatedVectorDrawableCompat.
+ */
+public class SimpleAnimatedVectorDrawable extends Activity implements View.OnClickListener {
     private static final String LOG_TAG = "TestActivity";
 
     private static final String LOGCAT = "VectorDrawable1";
-    protected int[] icon = {
-        R.drawable.animation_vector_drawable_grouping_1,
-        R.drawable.animation_vector_progress_bar,
-        R.drawable.btn_radio_on_to_off_bundle,
+    protected int[] mIcons = {
+            R.drawable.animation_vector_drawable_grouping_1,
+            R.drawable.animation_vector_progress_bar,
+            R.drawable.btn_radio_on_to_off_bundle,
     };
 
-
     @Override
     protected void onCreate(Bundle savedInstanceState) {
-        ObjectAnimator oa = new ObjectAnimator();
         super.onCreate(savedInstanceState);
         ScrollView scrollView = new ScrollView(this);
         LinearLayout container = new LinearLayout(this);
@@ -51,15 +52,15 @@
         container.setOrientation(LinearLayout.VERTICAL);
         Resources res = this.getResources();
         container.setBackgroundColor(0xFF888888);
-        AnimatedVectorDrawableCompat []d = new AnimatedVectorDrawableCompat[icon.length];
-        long time =  android.os.SystemClock.currentThreadTimeMillis();
-        for (int i = 0; i < icon.length; i++) {
-             d[i] = AnimatedVectorDrawableCompat.create(this, icon[i]);
+        AnimatedVectorDrawableCompat[] d = new AnimatedVectorDrawableCompat[mIcons.length];
+        long time = android.os.SystemClock.currentThreadTimeMillis();
+        for (int i = 0; i < mIcons.length; i++) {
+            d[i] = AnimatedVectorDrawableCompat.create(this, mIcons[i]);
         }
-        time =  android.os.SystemClock.currentThreadTimeMillis()-time;
+        time = android.os.SystemClock.currentThreadTimeMillis() - time;
         TextView t = new TextView(this);
         DecimalFormat df = new DecimalFormat("#.##");
-        t.setText("avgL=" + df.format(time / (icon.length)) + " ms");
+        t.setText("avgL=" + df.format(time / (mIcons.length)) + " ms");
         container.addView(t);
 
         addDrawableButtons(container, d);
diff --git a/samples/SupportVectorDrawable/static/src/com/example/android/support/vectordrawable/app/SimpleButtonBackground.java b/samples/SupportVectorDrawableDemos/src/com/example/android/support/vectordrawable/app/SimpleStaticVectorDrawable.java
similarity index 86%
rename from samples/SupportVectorDrawable/static/src/com/example/android/support/vectordrawable/app/SimpleButtonBackground.java
rename to samples/SupportVectorDrawableDemos/src/com/example/android/support/vectordrawable/app/SimpleStaticVectorDrawable.java
index 79a51ac..deee6c6 100644
--- a/samples/SupportVectorDrawable/static/src/com/example/android/support/vectordrawable/app/SimpleButtonBackground.java
+++ b/samples/SupportVectorDrawableDemos/src/com/example/android/support/vectordrawable/app/SimpleStaticVectorDrawable.java
@@ -26,15 +26,18 @@
 import android.widget.LinearLayout;
 import android.widget.ScrollView;
 import android.widget.TextView;
+
 import com.example.android.support.vectordrawable.R;
 
 import java.text.DecimalFormat;
 
-public class SimpleButtonBackground extends Activity {
-    private static final String LOG_TAG = "SimpleButtonBackground";
+/**
+ * Simple demo for VectorDrawableCompat.
+ */
+public class SimpleStaticVectorDrawable extends Activity {
+    private static final String LOG_TAG = "SimpleStaticVectorDrawable";
 
-    private static final String LOGCAT = "VectorDrawable1";
-    protected int[] icon = {
+    protected int[] mIcons = {
             R.drawable.vector_drawable_scale0,
             R.drawable.vector_drawable_scale1,
             R.drawable.vector_drawable_scale2,
@@ -84,12 +87,12 @@
         container.setOrientation(LinearLayout.VERTICAL);
         Resources res = this.getResources();
         container.setBackgroundColor(0xFF888888);
-        VectorDrawableCompat []d = new VectorDrawableCompat[icon.length];
-        long time =  android.os.SystemClock.currentThreadTimeMillis();
-        for (int i = 0; i < icon.length; i++) {
-             d[i] = VectorDrawableCompat.create(res, icon[i], getTheme());
+        VectorDrawableCompat[] d = new VectorDrawableCompat[mIcons.length];
+        long time = android.os.SystemClock.currentThreadTimeMillis();
+        for (int i = 0; i < mIcons.length; i++) {
+            d[i] = VectorDrawableCompat.create(res, mIcons[i], getTheme());
         }
-        time =  android.os.SystemClock.currentThreadTimeMillis()-time;
+        time = android.os.SystemClock.currentThreadTimeMillis() - time;
 
         // Testing Tint on one particular case.
         if (d.length > 3) {
@@ -99,7 +102,7 @@
 
         // Testing Constant State like operation by creating the first 2 icons
         // from the 3rd one's constant state.
-        VectorDrawableCompat []extras = new VectorDrawableCompat[EXTRA_TESTS];
+        VectorDrawableCompat[] extras = new VectorDrawableCompat[EXTRA_TESTS];
         ConstantState state = d[0].getConstantState();
         extras[0] = (VectorDrawableCompat) state.newDrawable();
         extras[1] = (VectorDrawableCompat) state.newDrawable();
@@ -113,7 +116,7 @@
         // Just show the average create time as the first view.
         TextView t = new TextView(this);
         DecimalFormat df = new DecimalFormat("#.##");
-        t.setText("avgL=" + df.format(time / (icon.length)) + " ms");
+        t.setText("avgL=" + df.format(time / (mIcons.length)) + " ms");
         container.addView(t);
 
         addDrawableButtons(container, extras);
diff --git a/samples/SupportVectorDrawableDemos/src/com/example/android/support/vectordrawable/app/SupportVectorDrawableDemos.java b/samples/SupportVectorDrawableDemos/src/com/example/android/support/vectordrawable/app/SupportVectorDrawableDemos.java
new file mode 100644
index 0000000..1bb3377
--- /dev/null
+++ b/samples/SupportVectorDrawableDemos/src/com/example/android/support/vectordrawable/app/SupportVectorDrawableDemos.java
@@ -0,0 +1,155 @@
+/*
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.example.android.support.vectordrawable.app;
+
+import android.app.ListActivity;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ListView;
+import android.widget.SimpleAdapter;
+
+import java.text.Collator;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The root level activity for this demo. Showing a list of sub demos.
+ */
+public class SupportVectorDrawableDemos extends ListActivity {
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        Intent intent = getIntent();
+        String path = intent.getStringExtra("com.example.android.apis.Path");
+
+        if (path == null) {
+            path = "";
+        }
+
+        setListAdapter(new SimpleAdapter(this, getData(path),
+                android.R.layout.simple_list_item_1, new String[]{"title"},
+                new int[]{android.R.id.text1}));
+        getListView().setTextFilterEnabled(true);
+    }
+
+    protected List<Map<String, Object>> getData(String prefix) {
+        List<Map<String, Object>> myData = new ArrayList<Map<String, Object>>();
+
+        Intent mainIntent = new Intent(Intent.ACTION_MAIN, null);
+        mainIntent.addCategory("android.intent.category.SAMPLE_CODE");
+
+        PackageManager pm = getPackageManager();
+        List<ResolveInfo> list = pm.queryIntentActivities(mainIntent, 0);
+
+        if (null == list) {
+            return myData;
+        }
+
+        String[] prefixPath;
+        String prefixWithSlash = prefix;
+
+        if (prefix.equals("")) {
+            prefixPath = null;
+        } else {
+            prefixPath = prefix.split("/");
+            prefixWithSlash = prefix + "/";
+        }
+
+        int len = list.size();
+
+        Map<String, Boolean> entries = new HashMap<String, Boolean>();
+
+        for (int i = 0; i < len; i++) {
+            ResolveInfo info = list.get(i);
+            CharSequence labelSeq = info.loadLabel(pm);
+            String label = labelSeq != null
+                    ? labelSeq.toString()
+                    : info.activityInfo.name;
+
+            if (prefixWithSlash.length() == 0 || label.startsWith(prefixWithSlash)) {
+
+                String[] labelPath = label.split("/");
+
+                String nextLabel = prefixPath == null ? labelPath[0] : labelPath[prefixPath.length];
+
+                if ((prefixPath != null ? prefixPath.length : 0) == labelPath.length - 1) {
+                    addItem(myData, nextLabel, activityIntent(
+                            info.activityInfo.applicationInfo.packageName,
+                            info.activityInfo.name));
+                } else {
+                    if (entries.get(nextLabel) == null) {
+                        addItem(myData, nextLabel, browseIntent(
+                                prefix.equals("") ? nextLabel : prefix + "/" + nextLabel));
+                        entries.put(nextLabel, true);
+                    }
+                }
+            }
+        }
+
+        Collections.sort(myData, sDisplayNameComparator);
+
+        return myData;
+    }
+
+    private static final Comparator<Map<String, Object>> sDisplayNameComparator =
+            new Comparator<Map<String, Object>>() {
+                private final Collator mCollator = Collator.getInstance();
+
+                @Override
+                public int compare(Map<String, Object> map1, Map<String, Object> map2) {
+                    return mCollator.compare(map1.get("title"), map2.get("title"));
+                }
+            };
+
+    protected Intent activityIntent(String pkg, String componentName) {
+        Intent result = new Intent();
+        result.setClassName(pkg, componentName);
+        return result;
+    }
+
+    protected Intent browseIntent(String path) {
+        Intent result = new Intent();
+        result.setClass(this, SupportVectorDrawableDemos.class);
+        result.putExtra("com.example.android.apis.Path", path);
+        return result;
+    }
+
+    protected void addItem(List<Map<String, Object>> data, String name, Intent intent) {
+        Map<String, Object> temp = new HashMap<String, Object>();
+        temp.put("title", name);
+        temp.put("intent", intent);
+        data.add(temp);
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    protected void onListItemClick(ListView l, View v, int position, long id) {
+        Map<String, Object> map = (Map<String, Object>) l.getItemAtPosition(position);
+
+        Intent intent = (Intent) map.get("intent");
+        startActivity(intent);
+    }
+}
diff --git a/settings.gradle b/settings.gradle
index 0b3b3d8..580e049 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -121,6 +121,9 @@
 include ':support-v13-demos'
 project(':support-v13-demos').projectDir = new File(samplesRoot, 'Support13Demos')
 
+include ':support-vector-drawable-demos'
+project(':support-vector-drawable-demos').projectDir = new File(samplesRoot, 'SupportVectorDrawableDemos')
+
 /////////////////////////////
 //
 // External