Loading core/res/res/values/attrs.xml +1 −0 Original line number Diff line number Diff line Loading @@ -4556,6 +4556,7 @@ <enum name="state_activated" value="8" /> <enum name="state_window_focused" value="9" /> </attr> <attr name="versionCode" /> </declare-styleable> <!-- Define the virtual size of the drawing surface paths will draw to. --> Loading graphics/java/android/graphics/drawable/VectorDrawable.java +14 −2 Original line number Diff line number Diff line Loading @@ -60,9 +60,11 @@ import java.util.HashSet; * The vector drawable has 6 elements: * <p/> * <dl> * <dt><code><vector></code></dt><dd> * The attribute <code>android:trigger</code> which defines a state change that * <dt><code><vector></code></dt> * <dd> * The attribute <code>android:trigger</code> defines a state change that * will drive the animation </dd> * <dd> * The attribute <code>android:versionCode</code> defines the version of * VectorDrawable </dd> * <dt><code><size></code></dt> * <dd>Used to defined the intrinsic Width Height size of the drawable using * <code>android:width</code> and <code>android:height</code> </dd> Loading Loading @@ -494,6 +496,16 @@ public class VectorDrawable extends Drawable { } else if (SHAPE_VECTOR.equals(tagName)) { TypedArray a = res.obtainAttributes(attrs, R.styleable.VectorDrawable); animatedPath.setTrigger(a.getInteger(R.styleable.VectorDrawable_trigger, 0)); // Parsing the version information. // Right now, we only support version "1". // If the xml didn't specify the version number, the default version is "1". int versionCode = a.getInt(R.styleable.VectorDrawable_versionCode, 1); if (versionCode != 1) { throw new IllegalArgumentException( "So far, VectorDrawable only support version 1"); } a.recycle(); } } Loading tests/DynamicDrawableTest/res/drawable/vector_drawable01.xml +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:trigger="state_checked" > android:trigger="state_checked" android:versionCode="1" > <size android:height="64dp" Loading Loading
core/res/res/values/attrs.xml +1 −0 Original line number Diff line number Diff line Loading @@ -4556,6 +4556,7 @@ <enum name="state_activated" value="8" /> <enum name="state_window_focused" value="9" /> </attr> <attr name="versionCode" /> </declare-styleable> <!-- Define the virtual size of the drawing surface paths will draw to. --> Loading
graphics/java/android/graphics/drawable/VectorDrawable.java +14 −2 Original line number Diff line number Diff line Loading @@ -60,9 +60,11 @@ import java.util.HashSet; * The vector drawable has 6 elements: * <p/> * <dl> * <dt><code><vector></code></dt><dd> * The attribute <code>android:trigger</code> which defines a state change that * <dt><code><vector></code></dt> * <dd> * The attribute <code>android:trigger</code> defines a state change that * will drive the animation </dd> * <dd> * The attribute <code>android:versionCode</code> defines the version of * VectorDrawable </dd> * <dt><code><size></code></dt> * <dd>Used to defined the intrinsic Width Height size of the drawable using * <code>android:width</code> and <code>android:height</code> </dd> Loading Loading @@ -494,6 +496,16 @@ public class VectorDrawable extends Drawable { } else if (SHAPE_VECTOR.equals(tagName)) { TypedArray a = res.obtainAttributes(attrs, R.styleable.VectorDrawable); animatedPath.setTrigger(a.getInteger(R.styleable.VectorDrawable_trigger, 0)); // Parsing the version information. // Right now, we only support version "1". // If the xml didn't specify the version number, the default version is "1". int versionCode = a.getInt(R.styleable.VectorDrawable_versionCode, 1); if (versionCode != 1) { throw new IllegalArgumentException( "So far, VectorDrawable only support version 1"); } a.recycle(); } } Loading
tests/DynamicDrawableTest/res/drawable/vector_drawable01.xml +1 −1 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" android:trigger="state_checked" > android:trigger="state_checked" android:versionCode="1" > <size android:height="64dp" Loading