diff options
| author | Tenghui Zhu <ztenghui@google.com> | 2015-11-13 22:17:19 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-11-13 22:17:19 +0000 |
| commit | b94fdf773e06d30f03500c8879eb0bb061640470 (patch) | |
| tree | cba1ecb5f749f9a34828682e2420468d8dcf60a5 | |
| parent | 517a5ef1716efc7696a78dc9e0fff0312c47612d (diff) | |
| parent | d85f3e0b931d3e127242a375e0d00c4696bba912 (diff) | |
| download | android_frameworks_support-b94fdf773e06d30f03500c8879eb0bb061640470.tar.gz android_frameworks_support-b94fdf773e06d30f03500c8879eb0bb061640470.tar.bz2 android_frameworks_support-b94fdf773e06d30f03500c8879eb0bb061640470.zip | |
Merge "Use android namespace in (Animated)VectorDrawableCompat." into mnc-ub-dev
52 files changed, 1275 insertions, 774 deletions
diff --git a/graphics/drawable/Android.mk b/graphics/drawable/Android.mk index 63e93b7d01..06d8d6f736 100644 --- a/graphics/drawable/Android.mk +++ b/graphics/drawable/Android.mk @@ -17,8 +17,8 @@ LOCAL_PATH := $(call my-dir) #static vector drawable library include $(CLEAR_VARS) LOCAL_MODULE := android-support-v7-vectordrawable -LOCAL_SDK_VERSION := 7 -LOCAL_SRC_FILES := $(call all-java-files-under, static) +LOCAL_SDK_VERSION := current +LOCAL_SRC_FILES := $(call all-java-files-under, static util) LOCAL_JAVA_LIBRARIES := android-support-v4 @@ -29,8 +29,8 @@ include $(BUILD_STATIC_JAVA_LIBRARY) #Animated vector drawable library include $(CLEAR_VARS) LOCAL_MODULE := android-support-v11-animatedvectordrawable -LOCAL_SDK_VERSION := 11 -LOCAL_SRC_FILES := $(call all-java-files-under, animated) +LOCAL_SDK_VERSION := current +LOCAL_SRC_FILES := $(call all-java-files-under, animated util) LOCAL_JAVA_LIBRARIES := android-support-v4 @@ -38,4 +38,5 @@ LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res \ LOCAL_STATIC_JAVA_LIBRARIES := android-support-v7-vectordrawable +LOCAL_AAPT_FLAGS := --no-version-vectors include $(BUILD_STATIC_JAVA_LIBRARY)
\ No newline at end of file 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 78ef62d1d6..eff9670377 100644 --- a/graphics/drawable/animated/src/android/support/graphics/drawable/AnimatedVectorDrawableCompat.java +++ b/graphics/drawable/animated/src/android/support/graphics/drawable/AnimatedVectorDrawableCompat.java @@ -16,7 +16,6 @@ package android.support.graphics.drawable; import android.animation.Animator; import android.animation.AnimatorInflater; -import android.animation.ObjectAnimator; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.Resources; @@ -45,12 +44,12 @@ import java.util.ArrayList; /** * This class uses {@link android.animation.ObjectAnimator} and * {@link android.animation.AnimatorSet} to animate the properties of a - * {@link android.graphics.drawable.VectorDrawableCompat} to create an animated drawable. + * {@link android.support.graphics.drawable.VectorDrawableCompat} to create an animated drawable. * <p> * AnimatedVectorDrawableCompat are normally defined as 3 separate XML files. * </p> * <p> - * First is the XML file for {@link android.graphics.drawable.VectorDrawableCompat}. Note that we + * First is the XML file for {@link android.support.graphics.drawable.VectorDrawableCompat}. Note that we * allow the animation to happen on the group's attributes and path's attributes, which requires they * are uniquely named in this XML file. Groups and paths without animations do not need names. * </p> @@ -306,9 +305,9 @@ public class AnimatedVectorDrawableCompat extends Drawable implements Animatable } if (ANIMATED_VECTOR.equals(tagName)) { final TypedArray a = - obtainAttributes(res, theme, attrs, R.styleable.AnimatedVectorDrawable); + obtainAttributes(res, theme, attrs, AndroidResources.styleable_AnimatedVectorDrawable); - int drawableRes = a.getResourceId(R.styleable.AnimatedVectorDrawable_drawable, + int drawableRes = a.getResourceId(AndroidResources.styleable_AnimatedVectorDrawable_drawable, 0); if (DBG_ANIMATION_VECTOR_DRAWABLE) { Log.v(LOGTAG, "drawableRes is " + drawableRes); @@ -327,11 +326,11 @@ public class AnimatedVectorDrawableCompat extends Drawable implements Animatable a.recycle(); } else if (TARGET.equals(tagName)) { final TypedArray a = - res.obtainAttributes(attrs, R.styleable.AnimatedVectorDrawableTarget); + res.obtainAttributes(attrs, AndroidResources.styleable_AnimatedVectorDrawableTarget); final String target = a.getString( - R.styleable.AnimatedVectorDrawableTarget_name); + AndroidResources.styleable_AnimatedVectorDrawableTarget_name); - int id = a.getResourceId(R.styleable.AnimatedVectorDrawableTarget_animation, 0); + int id = a.getResourceId(AndroidResources.styleable_AnimatedVectorDrawableTarget_animation, 0); if (id != 0) { Animator objectAnimator = AnimatorInflater.loadAnimator(mContext, id); setupAnimatorsForTarget(target, objectAnimator); diff --git a/graphics/drawable/static/src/android/support/graphics/drawable/PathParser.java b/graphics/drawable/static/src/android/support/graphics/drawable/PathParser.java index a92c3e578d..8503fae0f0 100644 --- a/graphics/drawable/static/src/android/support/graphics/drawable/PathParser.java +++ b/graphics/drawable/static/src/android/support/graphics/drawable/PathParser.java @@ -131,8 +131,8 @@ class PathParser { } for (int i = 0; i < nodesFrom.length; i ++) { - if (nodesFrom[i].mType != nodesTo[i].mType - || nodesFrom[i].mParams.length != nodesTo[i].mParams.length) { + if (nodesFrom[i].type != nodesTo[i].type + || nodesFrom[i].params.length != nodesTo[i].params.length) { return false; } } @@ -148,9 +148,9 @@ class PathParser { */ public static void updateNodes(PathDataNode[] target, PathDataNode[] source) { for (int i = 0; i < source.length; i ++) { - target[i].mType = source[i].mType; - for (int j = 0; j < source[i].mParams.length; j ++) { - target[i].mParams[j] = source[i].mParams[j]; + target[i].type = source[i].type; + for (int j = 0; j < source[i].params.length; j ++) { + target[i].params[j] = source[i].params[j]; } } } @@ -288,17 +288,18 @@ class PathParser { * An array of PathDataNode can represent the whole "d" attribute. */ public static class PathDataNode { - private char mType; - private float[] mParams; + /*package*/ + char type; + float[] params; private PathDataNode(char type, float[] params) { - mType = type; - mParams = params; + this.type = type; + this.params = params; } private PathDataNode(PathDataNode n) { - mType = n.mType; - mParams = copyOfRange(n.mParams, 0, n.mParams.length); + type = n.type; + params = copyOfRange(n.params, 0, n.params.length); } /** @@ -311,8 +312,8 @@ class PathParser { float[] current = new float[6]; char previousCommand = 'm'; for (int i = 0; i < node.length; i++) { - addCommand(path, current, previousCommand, node[i].mType, node[i].mParams); - previousCommand = node[i].mType; + addCommand(path, current, previousCommand, node[i].type, node[i].params); + previousCommand = node[i].type; } } @@ -327,9 +328,9 @@ class PathParser { */ public void interpolatePathDataNode(PathDataNode nodeFrom, PathDataNode nodeTo, float fraction) { - for (int i = 0; i < nodeFrom.mParams.length; i++) { - mParams[i] = nodeFrom.mParams[i] * (1 - fraction) - + nodeTo.mParams[i] * fraction; + for (int i = 0; i < nodeFrom.params.length; i++) { + params[i] = nodeFrom.params[i] * (1 - fraction) + + nodeTo.params[i] * fraction; } } diff --git a/graphics/drawable/static/src/android/support/graphics/drawable/VectorDrawableCompat.java b/graphics/drawable/static/src/android/support/graphics/drawable/VectorDrawableCompat.java index d33c20496c..c0e5b40b9d 100644 --- a/graphics/drawable/static/src/android/support/graphics/drawable/VectorDrawableCompat.java +++ b/graphics/drawable/static/src/android/support/graphics/drawable/VectorDrawableCompat.java @@ -196,7 +196,7 @@ public class VectorDrawableCompat extends Drawable { private static final int LINEJOIN_ROUND = 1; private static final int LINEJOIN_BEVEL = 2; - private static final boolean DBG_VECTOR_DRAWABLE = true; + private static final boolean DBG_VECTOR_DRAWABLE = false; private VectorDrawableState mVectorState; @@ -420,7 +420,6 @@ public class VectorDrawableCompat extends Drawable { final VectorDrawableCompat drawable = new VectorDrawableCompat(); drawable.inflate(res, parser, attrs, theme); - return drawable; } catch (XmlPullParserException e) { Log.e(LOGTAG, "parser error", e); @@ -462,8 +461,9 @@ public class VectorDrawableCompat extends Drawable { final VPathRenderer pathRenderer = new VPathRenderer(); state.mVPathRenderer = pathRenderer; - final TypedArray a = obtainAttributes(res, theme, attrs, R.styleable.VectorDrawable); - updateStateFromTypedArray(a); + final TypedArray a = obtainAttributes(res, theme, attrs, AndroidResources.styleable_VectorDrawableTypeArray); + + updateStateFromTypedArray(a, parser); a.recycle(); state.mChangingConfigurations = getChangingConfigurations(); state.mCacheDirty = true; @@ -472,30 +472,47 @@ public class VectorDrawableCompat extends Drawable { mTintFilter = updateTintFilter(mTintFilter, state.mTint, state.mTintMode); } - private void updateStateFromTypedArray(TypedArray a) throws XmlPullParserException { + + /** + * Parses a {@link android.graphics.PorterDuff.Mode} from a tintMode + * attribute's enum value. + */ + private static PorterDuff.Mode parseTintMode(int value, Mode defaultMode) { + switch (value) { + case 3: return Mode.SRC_OVER; + case 5: return Mode.SRC_IN; + case 9: return Mode.SRC_ATOP; + case 14: return Mode.MULTIPLY; + case 15: return Mode.SCREEN; + case 16: return Mode.ADD; + default: return defaultMode; + } + } + + private void updateStateFromTypedArray(TypedArray a, XmlPullParser parser) throws XmlPullParserException { final VectorDrawableState state = mVectorState; final VPathRenderer pathRenderer = state.mVPathRenderer; // Account for any configuration changes. // state.mChangingConfigurations |= Utils.getChangingConfigurations(a); - final int tintMode = a.getInt(R.styleable.VectorDrawable_tintMode, -1); - // if (tintMode != -1) { - // state.mTintMode = Utils.parseTintMode(tintMode, DEFAULT_TINT_MODE); - // } + final int mode = TypedArrayUtils.getNamedInt(a, parser, "tintMode", + AndroidResources.styleable_VectorDrawable_Mode, -1); + state.mTintMode = parseTintMode(mode, Mode.SRC_IN); - final ColorStateList tint = a.getColorStateList(R.styleable.VectorDrawable_tint); + final ColorStateList tint = a.getColorStateList(AndroidResources.styleable_VectorDrawable_tint); if (tint != null) { state.mTint = tint; } - state.mAutoMirrored = a.getBoolean( - R.styleable.VectorDrawable_autoMirrored, state.mAutoMirrored); + state.mAutoMirrored = TypedArrayUtils.getNamedBoolean(a, parser, "autoMirrored", + AndroidResources.styleable_VectorDrawable_autoMirrored, state.mAutoMirrored); + + pathRenderer.mViewportWidth = TypedArrayUtils.getNamedFloat(a, parser, "viewportWidth", + AndroidResources.styleable_VectorDrawable_viewportWidth, pathRenderer.mViewportWidth); - pathRenderer.mViewportWidth = a.getFloat( - R.styleable.VectorDrawable_viewportWidth, pathRenderer.mViewportWidth); - pathRenderer.mViewportHeight = a.getFloat( - R.styleable.VectorDrawable_viewportHeight, pathRenderer.mViewportHeight); + pathRenderer.mViewportHeight = TypedArrayUtils.getNamedFloat(a, parser, "viewportHeight", + AndroidResources.styleable_VectorDrawable_viewportHeight, pathRenderer.mViewportHeight); if (pathRenderer.mViewportWidth <= 0) { throw new XmlPullParserException(a.getPositionDescription() + @@ -506,10 +523,9 @@ public class VectorDrawableCompat extends Drawable { } pathRenderer.mBaseWidth = a.getDimension( - R.styleable.VectorDrawable_width, pathRenderer.mBaseWidth); + AndroidResources.styleable_VectorDrawable_width, pathRenderer.mBaseWidth); pathRenderer.mBaseHeight = a.getDimension( - R.styleable.VectorDrawable_height, pathRenderer.mBaseHeight); - + AndroidResources.styleable_VectorDrawable_height, pathRenderer.mBaseHeight); if (pathRenderer.mBaseWidth <= 0) { throw new XmlPullParserException(a.getPositionDescription() + "<vector> tag requires width > 0"); @@ -518,11 +534,12 @@ public class VectorDrawableCompat extends Drawable { "<vector> tag requires height > 0"); } - final float alphaInFloat = a.getFloat(R.styleable.VectorDrawable_alpha, - pathRenderer.getAlpha()); + // shown up from API 11. + final float alphaInFloat = TypedArrayUtils.getNamedFloat(a, parser, "alpha", + AndroidResources.styleable_VectorDrawable_alpha, pathRenderer.getAlpha()); pathRenderer.setAlpha(alphaInFloat); - final String name = a.getString(R.styleable.VectorDrawable_name); + final String name = a.getString(AndroidResources.styleable_VectorDrawable_name); if (name != null) { pathRenderer.mRootName = name; pathRenderer.mVGTargetsMap.put(name, pathRenderer); @@ -545,10 +562,9 @@ public class VectorDrawableCompat extends Drawable { if (eventType == XmlPullParser.START_TAG) { final String tagName = parser.getName(); final VGroup currentGroup = groupStack.peek(); - Log.v(LOGTAG, tagName); if (SHAPE_PATH.equals(tagName)) { final VFullPath path = new VFullPath(); - path.inflate(res, attrs, theme); + path.inflate(res, attrs, theme, parser); currentGroup.mChildren.add(path); if (path.getPathName() != null) { pathRenderer.mVGTargetsMap.put(path.getPathName(), path); @@ -557,7 +573,7 @@ public class VectorDrawableCompat extends Drawable { state.mChangingConfigurations |= path.mChangingConfigurations; } else if (SHAPE_CLIP_PATH.equals(tagName)) { final VClipPath path = new VClipPath(); - path.inflate(res, attrs, theme); + path.inflate(res, attrs, theme, parser); currentGroup.mChildren.add(path); if (path.getPathName() != null) { pathRenderer.mVGTargetsMap.put(path.getPathName(), path); @@ -565,7 +581,7 @@ public class VectorDrawableCompat extends Drawable { state.mChangingConfigurations |= path.mChangingConfigurations; } else if (SHAPE_GROUP.equals(tagName)) { VGroup newChildGroup = new VGroup(); - newChildGroup.inflate(res, attrs, theme); + newChildGroup.inflate(res, attrs, theme, parser); currentGroup.mChildren.add(newChildGroup); groupStack.push(newChildGroup); if (newChildGroup.getGroupName() != null) { @@ -614,6 +630,8 @@ public class VectorDrawableCompat extends Drawable { Object child = currentGroup.mChildren.get(i); if (child instanceof VGroup) { printGroupTree((VGroup) child, level + 1); + } else { + ((VPath) child).printVPath(level + 1); } } } @@ -1017,29 +1035,41 @@ public class VectorDrawableCompat extends Drawable { return mLocalMatrix; } - public void inflate(Resources res, AttributeSet attrs, Theme theme) { + public void inflate(Resources res, AttributeSet attrs, Theme theme, XmlPullParser parser) { final TypedArray a = obtainAttributes(res, theme, attrs, - R.styleable.VectorDrawableGroup); - updateStateFromTypedArray(a); + AndroidResources.styleable_VectorDrawableGroup); + updateStateFromTypedArray(a, parser); a.recycle(); } - private void updateStateFromTypedArray(TypedArray a) { + private void updateStateFromTypedArray(TypedArray a, XmlPullParser parser) { // Account for any configuration changes. // mChangingConfigurations |= Utils.getChangingConfigurations(a); // Extract the theme attributes, if any. mThemeAttrs = null; // TODO TINT THEME Not supported yet a.extractThemeAttrs(); - mRotate = a.getFloat(R.styleable.VectorDrawableGroup_rotation, mRotate); - mPivotX = a.getFloat(R.styleable.VectorDrawableGroup_pivotX, mPivotX); - mPivotY = a.getFloat(R.styleable.VectorDrawableGroup_pivotY, mPivotY); - mScaleX = a.getFloat(R.styleable.VectorDrawableGroup_scaleX, mScaleX); - mScaleY = a.getFloat(R.styleable.VectorDrawableGroup_scaleY, mScaleY); - mTranslateX = a.getFloat(R.styleable.VectorDrawableGroup_translateX, mTranslateX); - mTranslateY = a.getFloat(R.styleable.VectorDrawableGroup_translateY, mTranslateY); + // This is added in API 11 + mRotate = TypedArrayUtils.getNamedFloat(a, parser, "rotation", + AndroidResources.styleable_VectorDrawableGroup_rotation, mRotate); + + mPivotX = a.getFloat(AndroidResources.styleable_VectorDrawableGroup_pivotX, mPivotX); + mPivotY = a.getFloat(AndroidResources.styleable_VectorDrawableGroup_pivotY, mPivotY); + + // This is added in API 11 + mScaleX = TypedArrayUtils.getNamedFloat(a, parser, "scaleX", + AndroidResources.styleable_VectorDrawableGroup_scaleX, mScaleX); + + // This is added in API 11 + mScaleY = TypedArrayUtils.getNamedFloat(a, parser, "scaleY", + AndroidResources.styleable_VectorDrawableGroup_scaleY, mScaleY); + + mTranslateX = TypedArrayUtils.getNamedFloat(a, parser, "translateX", + AndroidResources.styleable_VectorDrawableGroup_translateX, mTranslateX); + mTranslateY = TypedArrayUtils.getNamedFloat(a, parser, "translateY", + AndroidResources.styleable_VectorDrawableGroup_translateY, mTranslateY); - final String groupName = a.getString(R.styleable.VectorDrawableGroup_name); + final String groupName = a.getString(AndroidResources.styleable_VectorDrawableGroup_name); if (groupName != null) { mGroupName = groupName; } @@ -1162,6 +1192,28 @@ public class VectorDrawableCompat extends Drawable { // Empty constructor. } + public void printVPath(int level) { + String indent = ""; + for (int i = 0; i < level; i++) { + indent += " "; + } + Log.v(LOGTAG, indent + "current path is :" + mPathName + + " pathData is " + NodesToString(mNodes)); + + } + + public String NodesToString(PathParser.PathDataNode[] nodes) { + String result = " "; + for (int i = 0; i < nodes.length; i++) { + result += nodes[i].type + ":"; + float[] params = nodes[i].params; + for (int j = 0; j < params.length; j++) { + result += params[j] + ","; + } + } + return result; + } + public VPath(VPath copy) { mPathName = copy.mPathName; mChangingConfigurations = copy.mChangingConfigurations; @@ -1219,10 +1271,14 @@ public class VectorDrawableCompat extends Drawable { super(copy); } - public void inflate(Resources r, AttributeSet attrs, Theme theme) { + public void inflate(Resources r, AttributeSet attrs, Theme theme, XmlPullParser parser) { // TODO TINT THEME Not supported yet + final boolean hasPathData = TypedArrayUtils.hasAttribute(parser, "pathData"); + if (!hasPathData) { + return; + } final TypedArray a = obtainAttributes(r, theme, attrs, - R.styleable.VectorDrawableClipPath); + AndroidResources.styleable_VectorDrawableClipPath); updateStateFromTypedArray(a); a.recycle(); } @@ -1231,12 +1287,12 @@ public class VectorDrawableCompat extends Drawable { // Account for any configuration changes. // mChangingConfigurations |= Utils.getChangingConfigurations(a);; - final String pathName = a.getString(R.styleable.VectorDrawableClipPath_name); + final String pathName = a.getString(AndroidResources.styleable_VectorDrawableClipPath_name); if (pathName != null) { mPathName = pathName; } - final String pathData = a.getString(R.styleable.VectorDrawableClipPath_pathData); + final String pathData = a.getString(AndroidResources.styleable_VectorDrawableClipPath_pathData); if (pathData != null) { mNodes = PathParser.createNodesFromPathData(pathData); } @@ -1325,52 +1381,64 @@ public class VectorDrawableCompat extends Drawable { return mThemeAttrs != null; } - public void inflate(Resources r, AttributeSet attrs, Theme theme) { + public void inflate(Resources r, AttributeSet attrs, Theme theme, XmlPullParser parser) { final TypedArray a = obtainAttributes(r, theme, attrs, - R.styleable.VectorDrawablePath); - updateStateFromTypedArray(a); + AndroidResources.styleable_VectorDrawablePath); + updateStateFromTypedArray(a, parser); a.recycle(); } - private void updateStateFromTypedArray(TypedArray a) { + private void updateStateFromTypedArray(TypedArray a, XmlPullParser parser) { // Account for any configuration changes. // mChangingConfigurations |= Utils.getChangingConfigurations(a); // Extract the theme attributes, if any. mThemeAttrs = null; // TODO TINT THEME Not supported yet a.extractThemeAttrs(); - final String pathName = a.getString(R.styleable.VectorDrawablePath_name); + // In order to work around the conflicting id issue, we need to double check the existence + // of the attribute. + // B/c if the attribute existed in the compiled XML, then calling TypedArray will be safe + // since the framework will look up in the XML first. + // Note that each getAttributeValue take roughly 0.03ms, it is a price we have to pay here. + final boolean hasPathData = TypedArrayUtils.hasAttribute(parser, "pathData"); + if (!hasPathData) { + //If there is no pathData in the <path> tag, then this is an empty path, nothing need to be drawn. + return; + } + + final String pathName = a.getString(AndroidResources.styleable_VectorDrawablePath_name); if (pathName != null) { mPathName = pathName; } - - final String pathData = a.getString(R.styleable.VectorDrawablePath_pathData); + final String pathData = a.getString(AndroidResources.styleable_VectorDrawablePath_pathData); if (pathData != null) { mNodes = PathParser.createNodesFromPathData(pathData); } - mFillColor = a.getColor(R.styleable.VectorDrawablePath_fillColor, - mFillColor); - mFillAlpha = a.getFloat(R.styleable.VectorDrawablePath_fillAlpha, - mFillAlpha); - mStrokeLineCap = getStrokeLineCap(a.getInt( - R.styleable.VectorDrawablePath_strokeLineCap, -1), mStrokeLineCap); - mStrokeLineJoin = getStrokeLineJoin(a.getInt( - R.styleable.VectorDrawablePath_strokeLineJoin, -1), mStrokeLineJoin); - mStrokeMiterlimit = a.getFloat( - R.styleable.VectorDrawablePath_strokeMiterLimit, mStrokeMiterlimit); - mStrokeColor = a.getColor(R.styleable.VectorDrawablePath_strokeColor, - mStrokeColor); - mStrokeAlpha = a.getFloat(R.styleable.VectorDrawablePath_strokeAlpha, - mStrokeAlpha); - mStrokeWidth = a.getFloat(R.styleable.VectorDrawablePath_strokeWidth, - mStrokeWidth); - mTrimPathEnd = a.getFloat(R.styleable.VectorDrawablePath_trimPathEnd, - mTrimPathEnd); - mTrimPathOffset = a.getFloat( - R.styleable.VectorDrawablePath_trimPathOffset, mTrimPathOffset); - mTrimPathStart = a.getFloat( - R.styleable.VectorDrawablePath_trimPathStart, mTrimPathStart); + mFillColor = TypedArrayUtils.getNamedColor(a, parser, "fillColor", + AndroidResources.styleable_VectorDrawablePath_fillColor, mFillColor); + mFillAlpha = TypedArrayUtils.getNamedFloat(a, parser, "alpha", + AndroidResources.styleable_VectorDrawablePath_fillAlpha, mFillAlpha); + final int lineCap = TypedArrayUtils.getNamedInt(a, parser, "strokeLineCap", + AndroidResources.styleable_VectorDrawablePath_strokeLineCap, -1); + mStrokeLineCap = getStrokeLineCap(lineCap, mStrokeLineCap); + final int lineJoin = TypedArrayUtils.getNamedInt(a, parser, "strokeLineJoin", + AndroidResources.styleable_VectorDrawablePath_strokeLineJoin, -1); + mStrokeLineJoin = getStrokeLineJoin(lineJoin, mStrokeLineJoin); + mStrokeMiterlimit = TypedArrayUtils.getNamedFloat(a, parser, "strokeMiterLimit", + AndroidResources.styleable_VectorDrawablePath_strokeMiterLimit, mStrokeMiterlimit); + mStrokeColor = TypedArrayUtils.getNamedColor(a, parser, "strokeColor", + AndroidResources.styleable_VectorDrawablePath_strokeColor, mStrokeColor); + mStrokeAlpha = TypedArrayUtils.getNamedFloat(a, parser, "strokeAlpha", + AndroidResources.styleable_VectorDrawablePath_strokeAlpha, mStrokeAlpha); + mStrokeWidth = TypedArrayUtils.getNamedFloat(a, parser, "strokeWidth", + AndroidResources.styleable_VectorDrawablePath_strokeWidth, mStrokeWidth); + mTrimPathEnd = TypedArrayUtils.getNamedFloat(a, parser, "trimPathEnd", + AndroidResources.styleable_VectorDrawablePath_trimPathEnd, mTrimPathEnd); + mTrimPathOffset = TypedArrayUtils.getNamedFloat(a, parser, "trimPathOffset", + AndroidResources.styleable_VectorDrawablePath_trimPathOffset, mTrimPathOffset); + mTrimPathStart = TypedArrayUtils.getNamedFloat(a, parser, "trimPathStart", + AndroidResources.styleable_VectorDrawablePath_trimPathStart, mTrimPathStart); } @Override @@ -1381,7 +1449,7 @@ public class VectorDrawableCompat extends Drawable { /* * TODO TINT THEME Not supported yet final TypedArray a = - * t.resolveAttributes(mThemeAttrs, R.styleable.VectorDrawablePath); + * t.resolveAttributes(mThemeAttrs, styleable_VectorDrawablePath); * updateStateFromTypedArray(a); a.recycle(); */ } diff --git a/graphics/drawable/testanimated/Android.mk b/graphics/drawable/testanimated/Android.mk index c888d9e220..004cddb5d9 100644 --- a/graphics/drawable/testanimated/Android.mk +++ b/graphics/drawable/testanimated/Android.mk @@ -18,7 +18,7 @@ include $(CLEAR_VARS) LOCAL_MODULE_TAGS := tests -LOCAL_SDK_VERSION := 11 +LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := $(call all-java-files-under, src) @@ -30,6 +30,8 @@ LOCAL_PACKAGE_NAME := AndroidAnimatedVectorDrawableTests LOCAL_STATIC_JAVA_LIBRARIES := android-support-v11-animatedvectordrawable android-support-v4 -LOCAL_AAPT_FLAGS += --auto-add-overlay --extra-packages android.support.graphics.drawable +LOCAL_AAPT_FLAGS += --auto-add-overlay \ + --extra-packages android.support.graphics.drawable \ + --no-version-vectors include $(BUILD_PACKAGE) diff --git a/graphics/drawable/testanimated/res/drawable/animation_vector_drawable_grouping_1.xml b/graphics/drawable/testanimated/res/drawable/animation_vector_drawable_grouping_1.xml index 7c3b1de076..dac981bc93 100644 --- a/graphics/drawable/testanimated/res/drawable/animation_vector_drawable_grouping_1.xml +++ b/graphics/drawable/testanimated/res/drawable/animation_vector_drawable_grouping_1.xml @@ -14,14 +14,13 @@ limitations under the License. --> <animated-vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:drawable="@drawable/vector_drawable_grouping_1" > + android:drawable="@drawable/vector_drawable_grouping_1" > <target - auto:name="sun" - auto:animation="@anim/animation_grouping_1_01" /> + android:name="sun" + android:animation="@anim/animation_grouping_1_01" /> <target - auto:name="earth" - auto:animation="@anim/animation_grouping_1_01" /> + android:name="earth" + android:animation="@anim/animation_grouping_1_01" /> </animated-vector>
\ No newline at end of file diff --git a/graphics/drawable/testanimated/res/drawable/animation_vector_progress_bar.xml b/graphics/drawable/testanimated/res/drawable/animation_vector_progress_bar.xml index e37d2a1afe..2944dc2bf1 100644 --- a/graphics/drawable/testanimated/res/drawable/animation_vector_progress_bar.xml +++ b/graphics/drawable/testanimated/res/drawable/animation_vector_progress_bar.xml @@ -14,13 +14,12 @@ limitations under the License. --> <animated-vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:drawable="@drawable/vector_drawable_progress_bar" > + android:drawable="@drawable/vector_drawable_progress_bar" > <target - auto:name="pie1" - auto:animation="@anim/trim_path_animation_progress_bar" /> + android:name="pie1" + android:animation="@anim/trim_path_animation_progress_bar" /> <target - auto:name="root_bar" - auto:animation="@anim/alpha_animation_progress_bar" /> + android:name="root_bar" + android:animation="@anim/alpha_animation_progress_bar" /> </animated-vector>
\ No newline at end of file diff --git a/graphics/drawable/testanimated/res/drawable/vector_drawable_grouping_1.xml b/graphics/drawable/testanimated/res/drawable/vector_drawable_grouping_1.xml index eceda711fa..06f098e3df 100644 --- a/graphics/drawable/testanimated/res/drawable/vector_drawable_grouping_1.xml +++ b/graphics/drawable/testanimated/res/drawable/vector_drawable_grouping_1.xml @@ -14,37 +14,36 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="256" - auto:viewportWidth="256" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="256" + android:viewportWidth="256" > <group - auto:name="shape_layer_1" - auto:translateX="128" - auto:translateY="128" > - <group auto:name="sun" > + android:name="shape_layer_1" + android:translateX="128" + android:translateY="128" > + <group android:name="sun" > <path - auto:name="ellipse_path_1" - auto:fillColor="#ffff8000" - auto:pathData="m -25 0 a 25,25 0 1,0 50,0 a 25,25 0 1,0 -50,0" /> + android:name="ellipse_path_1" + android:fillColor="#ffff8000" + android:pathData="m -25 0 a 25,25 0 1,0 50,0 a 25,25 0 1,0 -50,0" /> <group - auto:name="earth" - auto:translateX="75" > + android:name="earth" + android:translateX="75" > <path - auto:name="ellipse_path_1_1" - auto:fillColor="#ff5656ea" - auto:pathData="m -10 0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0" /> + android:name="ellipse_path_1_1" + android:fillColor="#ff5656ea" + android:pathData="m -10 0 a 10,10 0 1,0 20,0 a 10,10 0 1,0 -20,0" /> <group - auto:name="moon" - auto:translateX="25" > + android:name="moon" + android:translateX="25" > <path - auto:name="ellipse_path_1_2" - auto:fillColor="#ffadadad" - auto:pathData="m -5 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0" /> + android:name="ellipse_path_1_2" + android:fillColor="#ffadadad" + android:pathData="m -5 0 a 5,5 0 1,0 10,0 a 5,5 0 1,0 -10,0" /> </group> </group> </group> diff --git a/graphics/drawable/testanimated/res/drawable/vector_drawable_progress_bar.xml b/graphics/drawable/testanimated/res/drawable/vector_drawable_progress_bar.xml index 0b8884b487..535265e520 100644 --- a/graphics/drawable/testanimated/res/drawable/vector_drawable_progress_bar.xml +++ b/graphics/drawable/testanimated/res/drawable/vector_drawable_progress_bar.xml @@ -14,36 +14,35 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="64" - auto:viewportWidth="64" - auto:name="root_bar" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="64" + android:viewportWidth="64" + android:name="root_bar" > <group - auto:name="root" - auto:pivotX="0.0" - auto:pivotY="0.0" - auto:rotation="0" - auto:translateX="32.0" - auto:translateY="32.0" > + android:name="root" + android:pivotX="0.0" + android:pivotY="0.0" + android:rotation="0" + android:translateX="32.0" + android:translateY="32.0" > <group - auto:name="rotationGroup" - auto:pivotX="0.0" - auto:pivotY="0.0" - auto:rotation="0" > + android:name="rotationGroup" + android:pivotX="0.0" + android:pivotY="0.0" + android:rotation="0" > <path - auto:name="pie1" - auto:fillColor="#00000000" - auto:pathData="M0, 0 m 0, -9.5 a 9.5,9.5 0 1,1 0,19 a 9.5,9.5 0 1,1 0,-19" - auto:strokeColor="#FF00FFFF" - auto:strokeLineCap="round" - auto:strokeLineJoin="miter" - auto:strokeWidth="2" - auto:trimPathEnd="0.1" - auto:trimPathOffset="0" - auto:trimPathStart="0" /> + android:name="pie1" + android:fillColor="#00000000" + android:pathData="M0, 0 m 0, -9.5 a 9.5,9.5 0 1,1 0,19 a 9.5,9.5 0 1,1 0,-19" + android:strokeColor="#FF00FFFF" + android:strokeLineCap="round" + android:strokeLineJoin="miter" + android:strokeWidth="2" + android:trimPathEnd="0.1" + android:trimPathOffset="0" + android:trimPathStart="0" /> </group> </group> diff --git a/graphics/drawable/teststatic/Android.mk b/graphics/drawable/teststatic/Android.mk index d8a0fd743f..4c4a7ba861 100644 --- a/graphics/drawable/teststatic/Android.mk +++ b/graphics/drawable/teststatic/Android.mk @@ -18,7 +18,7 @@ include $(CLEAR_VARS) LOCAL_MODULE_TAGS := tests -LOCAL_SDK_VERSION := 7 +LOCAL_SDK_VERSION := current LOCAL_SRC_FILES := $(call all-java-files-under, src) @@ -32,7 +32,8 @@ LOCAL_STATIC_JAVA_LIBRARIES := android-support-v7-vectordrawable android-support LOCAL_AAPT_FLAGS := \ --auto-add-overlay \ - --extra-packages android.support.graphics.drawable + --extra-packages android.support.graphics.drawable \ + --no-version-vectors include $(BUILD_PACKAGE) diff --git a/graphics/drawable/teststatic/AndroidManifest.xml b/graphics/drawable/teststatic/AndroidManifest.xml index 19586fb5d0..39ac8ba788 100644 --- a/graphics/drawable/teststatic/AndroidManifest.xml +++ b/graphics/drawable/teststatic/AndroidManifest.xml @@ -17,7 +17,7 @@ <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="android.support.test.vectordrawable" > - <uses-sdk android:minSdkVersion="7" /> + <uses-sdk android:minSdkVersion="7"/> <application android:icon="@drawable/app_sample_code" android:label="VectorDrawableCompatTest" > <activity android:name="android.support.test.vectordrawable.TestActivity" /> @@ -29,4 +29,4 @@ </intent-filter> </application> -</manifest>
\ No newline at end of file +</manifest> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable01.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable01.xml index 12357ef442..286b4879cb 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable01.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable01.xml @@ -1,4 +1,3 @@ -<?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2015 The Android Open Source Project @@ -15,20 +14,16 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="48dp" - auto:viewportHeight="480" - auto:viewportWidth="480" - auto:width="48dp" > + android:height="48dp" + android:width="48dp" + android:viewportHeight="480" + android:viewportWidth="480" > <group> <path - auto:name="box1" - auto:fillColor="?android:attr/textColorPrimary" - auto:pathData="m20,200l100,90l180-180l-35-35l-145,145l-60-60l-40,40z" - auto:strokeColor="?android:attr/colorBackground" - auto:strokeLineCap="round" - auto:strokeLineJoin="round" /> + android:name="box1" + android:pathData="m20,200l100,90l180-180l-35-35l-145,145l-60-60l-40,40z" + android:strokeLineCap="round" + android:strokeLineJoin="round" /> </group> - -</vector>
\ No newline at end of file +</vector> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable02.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable02.xml index cb6b9dffbd..7567887ef7 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable02.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable02.xml @@ -1,5 +1,4 @@ -<!-- - Copyright (C) 2015 The Android Open Source Project +<!-- 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. @@ -14,24 +13,20 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:viewportHeight="320" - auto:viewportWidth="320" - auto:width="64dp" > - + android:width="64dp" + android:height="64dp" android:viewportWidth="320" + android:viewportHeight="320"> <group - auto:pivotX="70" - auto:pivotY="120" - auto:rotation="180" > + android:rotation="180" + android:pivotX="70" + android:pivotY="120"> <path - auto:name="house" - auto:fillColor="#ff440000" - auto:pathData="M 130,225 L 130,115 L 130,115 L 70,15 L 10,115 L 10,115 L 10,225 z" - auto:strokeColor="#FF00FF00" - auto:strokeWidth="10" - auto:trimPathEnd=".9" - auto:trimPathStart=".1" /> + android:name="house" + android:pathData="M 130,225 L 130,115 L 130,115 L 70,15 L 10,115 L 10,115 L 10,225 z" + android:fillColor="#ff440000" + android:strokeColor="#FF00FF00" + android:strokeWidth="10" + android:trimPathStart=".1" + android:trimPathEnd=".9"/> </group> - -</vector>
\ No newline at end of file +</vector> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable03.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable03.xml index 37d00863c4..454468a9f3 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable03.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable03.xml @@ -14,51 +14,57 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:viewportHeight="12.25" - auto:viewportWidth="7.30625" - auto:width="64dp" > + android:height="64dp" + android:viewportHeight="12.25" + android:viewportWidth="7.30625" + android:width="64dp" > <group - auto:pivotX="3.65" - auto:pivotY="6.125" - auto:rotation="-30" > + android:pivotX="3.65" + android:pivotY="6.125" + android:rotation="-30" > <clip-path - auto:name="clip1" - auto:pathData=" + android:name="clip1" + android:pathData=" M 0, 6.125 l 7.3, 0 l 0, 12.25 l-7.3, 0 z" /> - </group> - <group> - <path - auto:name="one" - auto:fillColor="#ff88ff" - auto:pathData="M 1.215625,9.5l 1.9375,0.0 0.0-6.671875-2.109375,0.421875 0.0-1.078125 + + <group + android:pivotX="3.65" + android:pivotY="6.125" + android:rotation="30" > + <path + android:name="one" + android:fillColor="#ff88ff" + android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0-6.671875-2.109375,0.421875 0.0-1.078125 l 2.09375-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0 l-5.046875,0.0 0.0-1.0Z" /> + </group> </group> <group - auto:pivotX="3.65" - auto:pivotY="6.125" - auto:rotation="-30" > + android:pivotX="3.65" + android:pivotY="6.125" + android:rotation="-30" > <clip-path - auto:name="clip2" - auto:pathData=" + android:name="clip2" + android:pathData=" M 0, 0 l 7.3, 0 l 0, 6.125 l-7.3, 0 z" /> - </group> - <group> - <path - auto:name="two" - auto:fillColor="#ff88ff" - auto:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0-5.5625,0.0 0.0-1.0q 0.671875-0.6875 1.828125-1.859375 + + <group + android:pivotX="3.65" + android:pivotY="6.125" + android:rotation="30" > + <path + android:name="two" + android:fillColor="#ff88ff" + android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0-5.5625,0.0 0.0-1.0q 0.671875-0.6875 1.828125-1.859375 q 1.1718752-1.1875 1.4687502-1.53125 0.578125-0.625 0.796875-1.0625 q 0.234375-0.453125 0.234375-0.875 0.0-0.703125-0.5-1.140625 q-0.484375-0.4375-1.2656252-0.4375-0.5625,0.0-1.1875,0.1875 @@ -67,6 +73,7 @@ q 0.8125,0.671875 0.8125,1.8125 0.0,0.53125-0.203125,1.015625 q-0.203125,0.484375-0.734375,1.140625-0.15625,0.171875-0.9375,0.984375 q-0.78125024,0.8125-2.2187502,2.265625Z" /> + </group> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable04.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable04.xml index 4e2086f858..e6658a6059 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable04.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable04.xml @@ -13,38 +13,41 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:width="64dp" - auto:height="64dp" - auto:viewportWidth="7.30625" - auto:viewportHeight="12.25" - auto:autoMirrored="true"> + android:autoMirrored="true" + android:height="64dp" + android:viewportHeight="12.25" + android:viewportWidth="7.30625" + android:width="64dp" > <group> <clip-path - auto:name="clip1" - auto:pathData=" + android:name="clip1" + android:pathData=" M 3.65, 6.125 m-.001, 0 a .001,.001 0 1,0 .002,0 - a .001,.001 0 1,0-.002,0z"/> + a .001,.001 0 1,0-.002,0z" /> + <path - auto:name="one" - auto:pathData="M 1.215625,9.5l 1.9375,0.0 0.0-6.671875-2.109375,0.421875 0.0-1.078125 + android:name="one" + android:fillColor="#ff88ff" + android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0-6.671875-2.109375,0.421875 0.0-1.078125 l 2.09375-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0 - l-5.046875,0.0 0.0-1.0Z" - auto:fillColor="#ff88ff"/> - + l-5.046875,0.0 0.0-1.0Z" /> + </group> + <group> <clip-path - auto:name="clip2" - auto:pathData=" + android:name="clip2" + android:pathData=" M 3.65, 6.125 m-6, 0 a 6,6 0 1,0 12,0 - a 6,6 0 1,0-12,0z"/> + a 6,6 0 1,0-12,0z" /> + <path - auto:name="two" - auto:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0-5.5625,0.0 0.0-1.0q 0.671875-0.6875 1.828125-1.859375 + android:name="two" + android:fillColor="#ff88ff" + android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0-5.5625,0.0 0.0-1.0q 0.671875-0.6875 1.828125-1.859375 q 1.1718752-1.1875 1.4687502-1.53125 0.578125-0.625 0.796875-1.0625 q 0.234375-0.453125 0.234375-0.875 0.0-0.703125-0.5-1.140625 q-0.484375-0.4375-1.2656252-0.4375-0.5625,0.0-1.1875,0.1875 @@ -52,7 +55,7 @@ q 0.625-0.15625 1.140625-0.15625 1.3593752,0.0 2.1718752,0.6875 q 0.8125,0.671875 0.8125,1.8125 0.0,0.53125-0.203125,1.015625 q-0.203125,0.484375-0.734375,1.140625-0.15625,0.171875-0.9375,0.984375 - q-0.78125024,0.8125-2.2187502,2.265625Z" - auto:fillColor="#ff88ff"/> + q-0.78125024,0.8125-2.2187502,2.265625Z" /> </group> -</vector> + +</vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable05.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable05.xml index 48801e3232..d1723dc46f 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable05.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable05.xml @@ -14,24 +14,23 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="12.25" - auto:viewportWidth="7.30625" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="12.25" + android:viewportWidth="7.30625" > <group> <path - auto:name="one" - auto:fillColor="#ffff00" - auto:pathData="M 1.215625,9.5l 1.9375,0.0 0.0-6.671875-2.109375,0.421875 0.0-1.078125 + android:name="one" + android:fillColor="#ffff00" + android:pathData="M 1.215625,9.5l 1.9375,0.0 0.0-6.671875-2.109375,0.421875 0.0-1.078125 l 2.09375-0.421875 1.1874998,0.0 0.0,7.75 1.9375,0.0 0.0,1.0 l-5.046875,0.0 0.0-1.0Z" /> <path - auto:name="two" - auto:fillColor="#ffff00" - auto:fillAlpha="0" - auto:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0-5.5625,0.0 0.0-1.0q 0.671875-0.6875 1.828125-1.859375 + android:name="two" + android:fillColor="#ffff00" + android:fillAlpha="0" + android:pathData="M 2.534375,9.6875l 4.140625,0.0 0.0,1.0-5.5625,0.0 0.0-1.0q 0.671875-0.6875 1.828125-1.859375 q 1.1718752-1.1875 1.4687502-1.53125 0.578125-0.625 0.796875-1.0625 q 0.234375-0.453125 0.234375-0.875 0.0-0.703125-0.5-1.140625 q-0.484375-0.4375-1.2656252-0.4375-0.5625,0.0-1.1875,0.1875 diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable06.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable06.xml index 24173e2fc3..4b530fd48d 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable06.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable06.xml @@ -13,37 +13,36 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:width="64dp" - auto:height="64dp" - auto:viewportWidth="700" - auto:viewportHeight="700"> + android:width="64dp" + android:height="64dp" + android:viewportWidth="700" + android:viewportHeight="700"> <group> - <path auto:pathData="M 569.374 461.472L 569.374 160.658L 160.658 160.658L 160.658 461.472L 569.374 461.472z" - auto:name="path2451" - auto:fillColor="#00000000" - auto:strokeColor="#FF000000" - auto:strokeWidth="30.65500000000000"/> - <path auto:pathData="M 365.015 311.066" - auto:name="path2453" - auto:fillColor="#00000000" - auto:strokeColor="#FF000000" - auto:strokeWidth="30.655000000000001"/> - <path auto:pathData="M 164.46 164.49L 340.78 343.158C 353.849 356.328 377.63 356.172 390.423 343.278L 566.622 165.928" - auto:name="path2455" - auto:strokeColor="#FF000000" - auto:fillColor="#FFFFFFFF" - auto:strokeWidth="30.655000000000001"/> - <path auto:pathData="M 170.515 451.566L 305.61 313.46" - auto:name="path2457" - auto:fillColor="#00000000" - auto:strokeColor="#000000" - auto:strokeWidth="30.655000000000001"/> - <path auto:pathData="M 557.968 449.974L 426.515 315.375" - auto:name="path2459" - auto:fillColor="#00000000" - auto:strokeColor="#000000" - auto:strokeWidth="30.655000000000001"/> + <path android:pathData="M 569.374 461.472L 569.374 160.658L 160.658 160.658L 160.658 461.472L 569.374 461.472z" + android:name="path2451" + android:fillColor="#00000000" + android:strokeColor="#FF000000" + android:strokeWidth="30.65500000000000"/> + <path android:pathData="M 365.015 311.066" + android:name="path2453" + android:fillColor="#00000000" + android:strokeColor="#FF000000" + android:strokeWidth="30.655000000000001"/> + <path android:pathData="M 164.46 164.49L 340.78 343.158C 353.849 356.328 377.63 356.172 390.423 343.278L 566.622 165.928" + android:name="path2455" + android:strokeColor="#FF000000" + android:fillColor="#FFFFFFFF" + android:strokeWidth="30.655000000000001"/> + <path android:pathData="M 170.515 451.566L 305.61 313.46" + android:name="path2457" + android:fillColor="#00000000" + android:strokeColor="#000000" + android:strokeWidth="30.655000000000001"/> + <path android:pathData="M 557.968 449.974L 426.515 315.375" + android:name="path2459" + android:fillColor="#00000000" + android:strokeColor="#000000" + android:strokeWidth="30.655000000000001"/> </group> </vector> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable07.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable07.xml index 90435d3bf9..bbf2451110 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable07.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable07.xml @@ -13,18 +13,17 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:width="64dp" - auto:height="64dp" auto:viewportWidth="140" - auto:viewportHeight="110"> + android:width="64dp" + android:height="64dp" android:viewportWidth="140" + android:viewportHeight="110"> <group> <path - auto:name="back" - auto:pathData="M 20,55 l 35.3-35.3 7.07,7.07-35.3,35.3 z + android:name="back" + android:pathData="M 20,55 l 35.3-35.3 7.07,7.07-35.3,35.3 z M 27,50 l 97,0 0,10-97,0 z M 20,55 l 7.07-7.07 35.3,35.3-7.07,7.07 z" - auto:fillColor="#ffffffff" + android:fillColor="#ffffffff" /> </group> </vector> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable08.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable08.xml index 251d694d72..e5b59df88d 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable08.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable08.xml @@ -13,18 +13,17 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:width="64dp" - auto:height="64dp" auto:viewportWidth="600" - auto:viewportHeight="600"> + android:width="64dp" + android:height="64dp" android:viewportWidth="600" + android:viewportHeight="600"> <group> <path - auto:name="pie1" - auto:pathData="M535.441,412.339A280.868,280.868 0 1,1 536.186,161.733L284.493,286.29Z" - auto:fillColor="#ffffcc00" - auto:strokeColor="#FF00FF00" - auto:strokeWidth="1"/> + android:name="pie1" + android:pathData="M535.441,412.339A280.868,280.868 0 1,1 536.186,161.733L284.493,286.29Z" + android:fillColor="#ffffcc00" + android:strokeColor="#FF00FF00" + android:strokeWidth="1"/> </group> </vector> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable09.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable09.xml index eccb0d092c..ce2441d2fd 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable09.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable09.xml @@ -14,20 +14,19 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="200" - auto:viewportWidth="200" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="200" + android:viewportWidth="200" > <group - auto:pivotX="100" - auto:pivotY="100" - auto:rotation="90"> + android:pivotX="100" + android:pivotY="100" + android:rotation="90"> <path - auto:name="house" - auto:fillColor="#ffffffff" - auto:pathData="M 100,20 l 0,0 0,140-80,0 z M 100,20 l 0,0 80,140-80,0 z"/> + android:name="house" + android:fillColor="#ffffffff" + android:pathData="M 100,20 l 0,0 0,140-80,0 z M 100,20 l 0,0 80,140-80,0 z"/> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable10.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable10.xml index b26d30d087..935d4a5e7c 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable10.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable10.xml @@ -15,29 +15,28 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportWidth="200" - auto:viewportHeight="200"> + android:height="64dp" + android:width="64dp" + android:viewportWidth="200" + android:viewportHeight="200"> <group> <path - auto:name="bar3" - auto:fillColor="#FFFFFFFF" - auto:pathData="M49.001,60c-5.466,0-9.899,4.478-9.899,10s4.434,10,9.899,10c5.468,0,9.899-4.478,9.899-10S54.469,60,49.001,60z" /> + android:name="bar3" + android:fillColor="#FFFFFFFF" + android:pathData="M49.001,60c-5.466,0-9.899,4.478-9.899,10s4.434,10,9.899,10c5.468,0,9.899-4.478,9.899-10S54.469,60,49.001,60z" /> <path - auto:name="bar2" - auto:fillColor="#FFFFFFFF" - auto:pathData="M28.001,48.787l7,7.07c7.731-7.811,20.269-7.81,28.001,0l6.999-7.07C58.403,37.071,39.599,37.071,28.001,48.787z" /> + android:name="bar2" + android:fillColor="#FFFFFFFF" + android:pathData="M28.001,48.787l7,7.07c7.731-7.811,20.269-7.81,28.001,0l6.999-7.07C58.403,37.071,39.599,37.071,28.001,48.787z" /> <path - auto:name="bar1" - auto:fillColor="#FF555555" - auto:pathData="M14.001,34.645 L21,41.716c15.464-15.621,40.536-15.621,56,0l7.001-7.071C64.672,15.119,33.33,15.119,14.001,34.645z" /> + android:name="bar1" + android:fillColor="#FF555555" + android:pathData="M14.001,34.645 L21,41.716c15.464-15.621,40.536-15.621,56,0l7.001-7.071C64.672,15.119,33.33,15.119,14.001,34.645z" /> <path - auto:name="bar0" - auto:fillColor="#FF555555" - auto:pathData="M0,20.502l6.999,7.071 c23.196-23.431,60.806-23.431,84.002,0L98,20.503C70.938-6.834,27.063-6.834,0,20.502z" /> + android:name="bar0" + android:fillColor="#FF555555" + android:pathData="M0,20.502l6.999,7.071 c23.196-23.431,60.806-23.431,84.002,0L98,20.503C70.938-6.834,27.063-6.834,0,20.502z" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable11.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable11.xml index eb440f5d31..05f481b26d 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable11.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable11.xml @@ -14,23 +14,22 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="80" - auto:viewportWidth="40" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="80" + android:viewportWidth="40" > <group> <path - auto:name="battery" - auto:fillColor="#3388ff" - auto:pathData="M 20.28125,2.0000002 C 17.352748,2.0000002 15,4.3527485 15,7.2812502 L 15,8.0000002 L 13.15625,8.0000002 C 9.7507553,8.0000002 7,10.750759 7,14.15625 L 7,39.84375 C 7,43.24924 9.7507558,46 13.15625,46 L 33.84375,46 C 37.249245,46 39.999999,43.24924 40,39.84375 L 40,14.15625 C 40,10.75076 37.249243,8.0000002 33.84375,8.0000002 L 32,8.0000002 L 32,7.2812502 C 32,4.3527485 29.647252,2.0000002 26.71875,2.0000002 L 20.28125,2.0000002 z" - auto:strokeColor="#ff8833" - auto:strokeWidth="1" /> + android:name="battery" + android:fillColor="#3388ff" + android:pathData="M 20.28125,2.0000002 C 17.352748,2.0000002 15,4.3527485 15,7.2812502 L 15,8.0000002 L 13.15625,8.0000002 C 9.7507553,8.0000002 7,10.750759 7,14.15625 L 7,39.84375 C 7,43.24924 9.7507558,46 13.15625,46 L 33.84375,46 C 37.249245,46 39.999999,43.24924 40,39.84375 L 40,14.15625 C 40,10.75076 37.249243,8.0000002 33.84375,8.0000002 L 32,8.0000002 L 32,7.2812502 C 32,4.3527485 29.647252,2.0000002 26.71875,2.0000002 L 20.28125,2.0000002 z" + android:strokeColor="#ff8833" + android:strokeWidth="1" /> <path - auto:name="spark" - auto:fillColor="#FFFF0000" - auto:pathData="M 30,18.031528 L 25.579581,23.421071 L 29.370621,26.765348 L 20.096792,37 L 21.156922,28.014053 L 17,24.902844 L 20.880632,18 L 30,18.031528 z" /> + android:name="spark" + android:fillColor="#FFFF0000" + android:pathData="M 30,18.031528 L 25.579581,23.421071 L 29.370621,26.765348 L 20.096792,37 L 21.156922,28.014053 L 17,24.902844 L 20.880632,18 L 30,18.031528 z" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable12.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable12.xml index 94a23e8b23..94338a720c 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable12.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable12.xml @@ -14,79 +14,78 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:name="rootGroup" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="600" - auto:viewportWidth="600" - auto:alpha="0.5" > + android:name="rootGroup" + android:height="64dp" + android:width="64dp" + android:viewportHeight="600" + android:viewportWidth="600" + android:alpha="0.5" > <group - auto:name="rotationGroup" - auto:pivotX="300.0" - auto:pivotY="300.0" - auto:rotation="45.0" > + android:name="rotationGroup" + android:pivotX="300.0" + android:pivotY="300.0" + android:rotation="45.0" > <path - auto:name="pie1" - auto:fillColor="#00000000" - auto:pathData="M300,70 a230,230 0 1,0 1,0 z" - auto:strokeColor="#FF777777" - auto:strokeWidth="70" - auto:trimPathEnd=".75" - auto:trimPathOffset="0" - auto:trimPathStart="0" /> + android:name="pie1" + android:fillColor="#00000000" + android:pathData="M300,70 a230,230 0 1,0 1,0 z" + android:strokeColor="#FF777777" + android:strokeWidth="70" + android:trimPathEnd=".75" + android:trimPathOffset="0" + android:trimPathStart="0" /> <path - auto:name="v" - auto:fillColor="#000000" - auto:pathData="M300,70 l 0,-70 70,70 0,0 -70,70z" /> + android:name="v" + android:fillColor="#000000" + android:pathData="M300,70 l 0,-70 70,70 0,0 -70,70z" /> <group - auto:name="translateToCenterGroup" - auto:rotation="0.0" - auto:translateX="200.0" - auto:translateY="200.0" > + android:name="translateToCenterGroup" + android:rotation="0.0" + android:translateX="200.0" + android:translateY="200.0" > <group - auto:name="rotationGroup2" - auto:pivotX="0.0" - auto:pivotY="0.0" - auto:rotation="-45.0" > + android:name="rotationGroup2" + android:pivotX="0.0" + android:pivotY="0.0" + android:rotation="-45.0" > <path - auto:name="twoLines1" - auto:pathData="@string/twoLinePathData" - auto:strokeColor="#FFFF0000" - auto:strokeWidth="20" /> + android:name="twoLines1" + android:pathData="@string/twoLinePathData" + android:strokeColor="#FFFF0000" + android:strokeWidth="20" /> <group - auto:name="translateGroupHalf" - auto:translateX="65.0" - auto:translateY="80.0" > + android:name="translateGroupHalf" + android:translateX="65.0" + android:translateY="80.0" > <group - auto:name="rotationGroup3" - auto:pivotX="-65.0" - auto:pivotY="-80.0" - auto:rotation="-45.0" > + android:name="rotationGroup3" + android:pivotX="-65.0" + android:pivotY="-80.0" + android:rotation="-45.0" > <path - auto:name="twoLines2" - auto:fillColor="#FF00FF00" - auto:pathData="@string/twoLinePathData" - auto:strokeColor="#FF00FF00" - auto:strokeWidth="20" /> + android:name="twoLines2" + android:fillColor="#FF00FF00" + android:pathData="@string/twoLinePathData" + android:strokeColor="#FF00FF00" + android:strokeWidth="20" /> <group - auto:name="translateGroup" - auto:translateX="65.0" - auto:translateY="80.0" > + android:name="translateGroup" + android:translateX="65.0" + android:translateY="80.0" > <group - auto:name="rotationGroupBlue" - auto:pivotX="-65.0" - auto:pivotY="-80.0" - auto:rotation="-45.0" > + android:name="rotationGroupBlue" + android:pivotX="-65.0" + android:pivotY="-80.0" + android:rotation="-45.0" > <path - auto:name="twoLines3" - auto:pathData="@string/twoLinePathData" - auto:strokeColor="#FF0000FF" - auto:strokeWidth="20" /> + android:name="twoLines3" + android:pathData="@string/twoLinePathData" + android:strokeColor="#FF0000FF" + android:strokeWidth="20" /> </group> </group> </group> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable13.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable13.xml index 43fc7eadd2..097e0281fa 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable13.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable13.xml @@ -14,25 +14,24 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="400" - auto:viewportWidth="600" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="400" + android:viewportWidth="600" > <group> <path - auto:name="pie1" - auto:fillColor="#ffffffff" - auto:pathData="M300,200 h-150 a150,150 0 1,0 150,-150 z" - auto:strokeColor="#FF00FF00" - auto:strokeWidth="1" /> + android:name="pie1" + android:fillColor="#ffffffff" + android:pathData="M300,200 h-150 a150,150 0 1,0 150,-150 z" + android:strokeColor="#FF00FF00" + android:strokeWidth="1" /> <path - auto:name="half" - auto:fillColor="#FFFF0000" - auto:pathData="M275,175 v-150 a150,150 0 0,0 -150,150 z" - auto:strokeColor="#FF0000FF" - auto:strokeWidth="5" /> + android:name="half" + android:fillColor="#FFFF0000" + android:pathData="M275,175 v-150 a150,150 0 0,0 -150,150 z" + android:strokeColor="#FF0000FF" + android:strokeWidth="5" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable14.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable14.xml index 5b4fdd1851..102ae7ac60 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable14.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable14.xml @@ -14,26 +14,25 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="500" - auto:viewportWidth="800" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="500" + android:viewportWidth="800" > <group - auto:pivotX="90" - auto:pivotY="100" - auto:rotation="20"> + android:pivotX="90" + android:pivotY="100" + android:rotation="20"> <path - auto:name="pie2" - auto:pathData="M200,350 l 50,-25 + android:name="pie2" + android:pathData="M200,350 l 50,-25 a25,12 -30 0,1 100,-50 l 50,-25 a25,25 -30 0,1 100,-50 l 50,-25 a25,37 -30 0,1 100,-50 l 50,-25 a25,50 -30 0,1 100,-50 l 50,-25" - auto:fillColor="#00000000" - auto:strokeColor="#FF00FF00" - auto:strokeWidth="10" /> + android:fillColor="#00000000" + android:strokeColor="#FF00FF00" + android:strokeWidth="10" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable15.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable15.xml index f4ef87fc3f..bdfcf811fd 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable15.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable15.xml @@ -14,22 +14,21 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="400" - auto:viewportWidth="500" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="400" + android:viewportWidth="500" > <group - auto:pivotX="250" - auto:pivotY="200" - auto:rotation="180"> + android:pivotX="250" + android:pivotY="200" + android:rotation="180"> <path - auto:name="house" - auto:fillColor="#ff440000" - auto:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200" - auto:strokeColor="#FFFF0000" - auto:strokeWidth="10" /> + android:name="house" + android:fillColor="#ff440000" + android:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200" + android:strokeColor="#FFFF0000" + android:strokeWidth="10" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable16.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable16.xml index 0c64bca831..ed1efa0185 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable16.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable16.xml @@ -14,35 +14,34 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="200" - auto:viewportWidth="200" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="200" + android:viewportWidth="200" > <group> <path - auto:name="background1" - auto:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" - auto:fillColor="#FF000000"/> + android:name="background1" + android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" + android:fillColor="#FF000000"/> <path - auto:name="background2" - auto:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" - auto:fillColor="#FF000000"/> + android:name="background2" + android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" + android:fillColor="#FF000000"/> </group> <group - auto:pivotX="100" - auto:pivotY="100" - auto:rotation="90" - auto:scaleX="0.75" - auto:scaleY="0.5" - auto:translateX="0.0" - auto:translateY="100.0"> + android:pivotX="100" + android:pivotY="100" + android:rotation="90" + android:scaleX="0.75" + android:scaleY="0.5" + android:translateX="0.0" + android:translateY="100.0"> <path - auto:name="twoLines" - auto:pathData="M 100,10 v 90 M 10,100 h 90" - auto:strokeColor="#FF00FF00" - auto:strokeWidth="10" /> + android:name="twoLines" + android:pathData="M 100,10 v 90 M 10,100 h 90" + android:strokeColor="#FF00FF00" + android:strokeWidth="10" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable17.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable17.xml index 28cf09a1ee..ba15f418c4 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable17.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable17.xml @@ -13,18 +13,17 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:width="64dp" - auto:height="64dp" auto:viewportWidth="1200" - auto:viewportHeight="600"> + android:width="64dp" + android:height="64dp" android:viewportWidth="1200" + android:viewportHeight="600"> <group> <path - auto:name="house" - auto:pathData="M200,300 Q400,50 600,300 T1000,300" - auto:fillColor="#00000000" - auto:strokeColor="#FFFF0000" - auto:strokeWidth="10"/> + android:name="house" + android:pathData="M200,300 Q400,50 600,300 T1000,300" + android:fillColor="#00000000" + android:strokeColor="#FFFF0000" + android:strokeWidth="10"/> </group> </vector> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable18.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable18.xml index d66d4ff4c1..ee2122a7de 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable18.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable18.xml @@ -14,19 +14,18 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="400" - auto:viewportWidth="500" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="400" + android:viewportWidth="500" > <group> <path - auto:name="house" - auto:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200" - auto:fillColor="#00000000" - auto:strokeColor="#FFFFFF00" - auto:strokeWidth="10" /> + android:name="house" + android:pathData="M100,200 C100,100 250,100 250,200 S400,300 400,200" + android:fillColor="#00000000" + android:strokeColor="#FFFFFF00" + android:strokeWidth="10" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable19.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable19.xml index 3a6559d818..b98e1ded2c 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable19.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable19.xml @@ -14,21 +14,20 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="800" - auto:viewportWidth="1000" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="800" + android:viewportWidth="1000" > <group> <path - auto:name="house" - auto:pathData="M10,300 Q400,550 600,300 T1000,300" - auto:pivotX="90" - auto:pivotY="100" - auto:fillColor="#00000000" - auto:strokeColor="#FFFF0000" - auto:strokeWidth="60" /> + android:name="house" + android:pathData="M10,300 Q400,550 600,300 T1000,300" + android:pivotX="90" + android:pivotY="100" + android:fillColor="#00000000" + android:strokeColor="#FFFF0000" + android:strokeWidth="60" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable20.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable20.xml index d6fd7043eb..1c8681869c 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable20.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable20.xml @@ -14,22 +14,21 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="480" - auto:viewportWidth="480" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="480" + android:viewportWidth="480" > <group> <path - auto:name="edit" - auto:fillColor="#FF00FFFF" - auto:pathData="M406.667,180c0,0 -100 -100 -113.334 -113.333 + android:name="edit" + android:fillColor="#FF00FFFF" + android:pathData="M406.667,180c0,0 -100 -100 -113.334 -113.333 c-13.333 -13.334 -33.333,0 -33.333,0l-160,160c0,0 -40,153.333 -40,173.333c0,13.333,13.333,13.333,13.333,13.333l173.334 -40 c0,0,146.666 -146.666,160 -160C420,200,406.667,180,406.667,180z M226.399,356.823L131.95,378.62l-38.516 -38.522 c7.848 -34.675,20.152 -82.52,23.538 -95.593l3.027,2.162l106.667,106.666L226.399,356.823z" - auto:strokeColor="#FF000000" - auto:strokeWidth="10" /> + android:strokeColor="#FF000000" + android:strokeWidth="10" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable21.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable21.xml index 9136b73417..247f6bc622 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable21.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable21.xml @@ -14,35 +14,34 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="200" - auto:viewportWidth="200" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="200" + android:viewportWidth="200" > <group> <path - auto:name="background1" - auto:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" - auto:fillColor="#FF000000"/> + android:name="background1" + android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" + android:fillColor="#FF000000"/> <path - auto:name="background2" - auto:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" - auto:fillColor="#FF000000"/> + android:name="background2" + android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" + android:fillColor="#FF000000"/> </group> <group - auto:pivotX="0" - auto:pivotY="0" - auto:rotation="90" - auto:scaleX="0.75" - auto:scaleY="0.5" - auto:translateX="100.0" - auto:translateY="100.0"> + android:pivotX="0" + android:pivotY="0" + android:rotation="90" + android:scaleX="0.75" + android:scaleY="0.5" + android:translateX="100.0" + android:translateY="100.0"> <path - auto:name="twoLines" - auto:pathData="M 100,10 v 90 M 10,100 h 90" - auto:strokeColor="#FF00FF00" - auto:strokeWidth="10" /> + android:name="twoLines" + android:pathData="M 100,10 v 90 M 10,100 h 90" + android:strokeColor="#FF00FF00" + android:strokeWidth="10" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable22.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable22.xml index 2b33a8903a..39d891feef 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable22.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable22.xml @@ -14,53 +14,52 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="400" - auto:viewportWidth="400" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="400" + android:viewportWidth="400" > - <group auto:name="backgroundGroup" > + <group android:name="backgroundGroup" > <path - auto:name="background1" - auto:fillColor="#80000000" - auto:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" /> + android:name="background1" + android:fillColor="#80000000" + android:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" /> <path - auto:name="background2" - auto:fillColor="#80000000" - auto:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" /> + android:name="background2" + android:fillColor="#80000000" + android:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" /> </group> <group - auto:name="translateToCenterGroup" - auto:translateX="50.0" - auto:translateY="90.0" > + android:name="translateToCenterGroup" + android:translateX="50.0" + android:translateY="90.0" > <path - auto:name="twoLines" - auto:pathData="M 0,0 v 100 M 0,0 h 100" - auto:strokeColor="#FFFF0000" - auto:strokeWidth="20" /> + android:name="twoLines" + android:pathData="M 0,0 v 100 M 0,0 h 100" + android:strokeColor="#FFFF0000" + android:strokeWidth="20" /> <group - auto:name="rotationGroup" - auto:pivotX="0.0" - auto:pivotY="0.0" - auto:rotation="-45.0" > + android:name="rotationGroup" + android:pivotX="0.0" + android:pivotY="0.0" + android:rotation="-45.0" > <path - auto:name="twoLines1" - auto:pathData="M 0,0 v 100 M 0,0 h 100" - auto:strokeColor="#FF00FF00" - auto:strokeWidth="20" /> + android:name="twoLines1" + android:pathData="M 0,0 v 100 M 0,0 h 100" + android:strokeColor="#FF00FF00" + android:strokeWidth="20" /> <group - auto:name="translateGroup" - auto:translateX="130.0" - auto:translateY="160.0" > - <group auto:name="scaleGroup" > + android:name="translateGroup" + android:translateX="130.0" + android:translateY="160.0" > + <group android:name="scaleGroup" > <path - auto:name="twoLines2" - auto:pathData="M 0,0 v 100 M 0,0 h 100" - auto:strokeColor="#FF0000FF" - auto:strokeWidth="20" /> + android:name="twoLines2" + android:pathData="M 0,0 v 100 M 0,0 h 100" + android:strokeColor="#FF0000FF" + android:strokeWidth="20" /> </group> </group> </group> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable23.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable23.xml index d5759f99f9..4a1c062f1a 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable23.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable23.xml @@ -14,67 +14,66 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="400" - auto:viewportWidth="400" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="400" + android:viewportWidth="400" > - <group auto:name="backgroundGroup" > + <group android:name="backgroundGroup" > <path - auto:name="background1" - auto:fillColor="#80000000" - auto:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" /> + android:name="background1" + android:fillColor="#80000000" + android:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" /> <path - auto:name="background2" - auto:fillColor="#80000000" - auto:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" /> + android:name="background2" + android:fillColor="#80000000" + android:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" /> </group> <group - auto:name="translateToCenterGroup" - auto:translateX="50.0" - auto:translateY="90.0" > + android:name="translateToCenterGroup" + android:translateX="50.0" + android:translateY="90.0" > <path - auto:name="twoLines" - auto:pathData="@string/twoLinePathData" - auto:strokeColor="#FFFF0000" - auto:strokeWidth="20" /> + android:name="twoLines" + android:pathData="@string/twoLinePathData" + android:strokeColor="#FFFF0000" + android:strokeWidth="20" /> <group - auto:name="rotationGroup" - auto:pivotX="0.0" - auto:pivotY="0.0" - auto:rotation="-45.0" > + android:name="rotationGroup" + android:pivotX="0.0" + android:pivotY="0.0" + android:rotation="-45.0" > <path - auto:name="twoLines1" - auto:pathData="@string/twoLinePathData" - auto:strokeColor="#FF00FF00" - auto:strokeWidth="20" /> + android:name="twoLines1" + android:pathData="@string/twoLinePathData" + android:strokeColor="#FF00FF00" + android:strokeWidth="20" /> <group - auto:name="translateGroup" - auto:translateX="130.0" - auto:translateY="160.0" > - <group auto:name="scaleGroup" > + android:name="translateGroup" + android:translateX="130.0" + android:translateY="160.0" > + <group android:name="scaleGroup" > <path - auto:name="twoLines3" - auto:pathData="@string/twoLinePathData" - auto:strokeColor="#FF0000FF" - auto:strokeWidth="20" /> + android:name="twoLines3" + android:pathData="@string/twoLinePathData" + android:strokeColor="#FF0000FF" + android:strokeWidth="20" /> </group> </group> <group - auto:name="translateGroupHalf" - auto:translateX="65.0" - auto:translateY="80.0" > - <group auto:name="scaleGroup" > + android:name="translateGroupHalf" + android:translateX="65.0" + android:translateY="80.0" > + <group android:name="scaleGroup" > <path - auto:name="twoLines2" - auto:pathData="@string/twoLinePathData" - auto:fillColor="#FFFFFFFF" - auto:strokeColor="#FFFFFFFF" - auto:strokeWidth="20" /> + android:name="twoLines2" + android:pathData="@string/twoLinePathData" + android:fillColor="?android:attr/colorForeground" + android:strokeColor="?android:attr/colorForeground" + android:strokeWidth="20" /> </group> </group> </group> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable24.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable24.xml index b05469281c..a7a8bd3d6f 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable24.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable24.xml @@ -14,67 +14,66 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="400" - auto:viewportWidth="400" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="400" + android:viewportWidth="400" > - <group auto:name="backgroundGroup"> + <group android:name="backgroundGroup"> <path - auto:name="background1" - auto:fillColor="#FF000000" - auto:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" /> + android:name="background1" + android:fillColor="#FF000000" + android:pathData="M 0,0 l 200,0 l 0, 200 l -200, 0 z" /> <path - auto:name="background2" - auto:fillColor="#FF000000" - auto:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" /> + android:name="background2" + android:fillColor="#FF000000" + android:pathData="M 200,200 l 200,0 l 0, 200 l -200, 0 z" /> </group> <group - auto:name="translateToCenterGroup" - auto:translateX="50.0" - auto:translateY="90.0" > + android:name="translateToCenterGroup" + android:translateX="50.0" + android:translateY="90.0" > <path - auto:name="twoLines" - auto:pathData="@string/twoLinePathData" - auto:strokeColor="#FFFF0000" - auto:strokeWidth="20" /> + android:name="twoLines" + android:pathData="@string/twoLinePathData" + android:strokeColor="#FFFF0000" + android:strokeWidth="20" /> <group - auto:name="rotationGroup" - auto:pivotX="0.0" - auto:pivotY="0.0" - auto:rotation="-45.0"> + android:name="rotationGroup" + android:pivotX="0.0" + android:pivotY="0.0" + android:rotation="-45.0"> <path - auto:name="twoLines1" - auto:pathData="@string/twoLinePathData" - auto:strokeColor="#FF00FF00" - auto:strokeWidth="20" /> + android:name="twoLines1" + android:pathData="@string/twoLinePathData" + android:strokeColor="#FF00FF00" + android:strokeWidth="20" /> <group - auto:name="translateGroup" - auto:translateX="130.0" - auto:translateY="160.0"> - <group auto:name="scaleGroup" > + android:name="translateGroup" + android:translateX="130.0" + android:translateY="160.0"> + <group android:name="scaleGroup" > <path - auto:name="twoLines3" - auto:pathData="@string/twoLinePathData" - auto:strokeColor="#FF0000FF" - auto:strokeWidth="20" /> + android:name="twoLines3" + android:pathData="@string/twoLinePathData" + android:strokeColor="#FF0000FF" + android:strokeWidth="20" /> </group> </group> <group - auto:name="translateGroupHalf" - auto:translateX="65.0" - auto:translateY="80.0"> - <group auto:name="scaleGroup" > + android:name="translateGroupHalf" + android:translateX="65.0" + android:translateY="80.0"> + <group android:name="scaleGroup" > <path - auto:name="twoLines2" - auto:pathData="@string/twoLinePathData" - auto:fillColor="#FFFFFFFF" - auto:strokeColor="#FFFFFFFF" - auto:strokeWidth="20" /> + android:name="twoLines2" + android:pathData="@string/twoLinePathData" + android:fillColor="?android:attr/colorForeground" + android:strokeColor="?android:attr/colorForeground" + android:strokeWidth="20" /> </group> </group> </group> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable25.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable25.xml index 7a94ed6ca3..7c9e7714a5 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable25.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable25.xml @@ -14,70 +14,69 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:width="64dp" - auto:viewportHeight="400" - auto:viewportWidth="400" > + android:height="64dp" + android:width="64dp" + android:viewportHeight="400" + android:viewportWidth="400" > <group - auto:name="FirstLevelGroup" - auto:translateX="100.0" - auto:translateY="0.0" > + android:name="FirstLevelGroup" + android:translateX="100.0" + android:translateY="0.0" > <group - auto:name="SecondLevelGroup1" - auto:translateX="-100.0" - auto:translateY="50.0" > + android:name="SecondLevelGroup1" + android:translateX="-100.0" + android:translateY="50.0" > <path - auto:fillColor="#FF00FF00" - auto:pathData="@string/rectangle200" /> + android:fillColor="#FF00FF00" + android:pathData="@string/rectangle200" /> <group - auto:name="ThridLevelGroup1" - auto:translateX="-100.0" - auto:translateY="50.0" > + android:name="ThridLevelGroup1" + android:translateX="-100.0" + android:translateY="50.0" > <path - auto:fillColor="#FF0000FF" - auto:pathData="@string/rectangle200" /> + android:fillColor="#FF0000FF" + android:pathData="@string/rectangle200" /> </group> <group - auto:name="ThridLevelGroup2" - auto:translateX="100.0" - auto:translateY="50.0" > + android:name="ThridLevelGroup2" + android:translateX="100.0" + android:translateY="50.0" > <path - auto:fillColor="#FF000000" - auto:pathData="@string/rectangle200" /> + android:fillColor="#FF000000" + android:pathData="@string/rectangle200" /> </group> </group> <group - auto:name="SecondLevelGroup2" - auto:translateX="100.0" - auto:translateY="50.0" > + android:name="SecondLevelGroup2" + android:translateX="100.0" + android:translateY="50.0" > <path - auto:fillColor="#FF0000FF" - auto:pathData="@string/rectangle200" /> + android:fillColor="#FF0000FF" + android:pathData="@string/rectangle200" /> <group - auto:name="ThridLevelGroup3" - auto:translateX="-100.0" - auto:translateY="50.0" > + android:name="ThridLevelGroup3" + android:translateX="-100.0" + android:translateY="50.0" > <path - auto:fillColor="#FFFF0000" - auto:pathData="@string/rectangle200" /> + android:fillColor="#FFFF0000" + android:pathData="@string/rectangle200" /> </group> <group - auto:name="ThridLevelGroup4" - auto:translateX="100.0" - auto:translateY="50.0" > + android:name="ThridLevelGroup4" + android:translateX="100.0" + android:translateY="50.0" > <path - auto:fillColor="#FF00FF00" - auto:pathData="@string/rectangle200" /> + android:fillColor="#FF00FF00" + android:pathData="@string/rectangle200" /> </group> </group> <path - auto:fillColor="#FFFF0000" - auto:pathData="@string/rectangle200" /> + android:fillColor="#FFFF0000" + android:pathData="@string/rectangle200" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable26.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable26.xml index b2dd4a3947..eda06d85ea 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable26.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable26.xml @@ -14,33 +14,32 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:viewportHeight="200" - auto:viewportWidth="200" - auto:width="64dp" > + android:height="64dp" + android:viewportHeight="200" + android:viewportWidth="200" + android:width="64dp" > <group> <path - auto:name="background1" - auto:fillColor="#FF000000" - auto:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" /> + android:name="background1" + android:fillColor="#FF000000" + android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" /> <path - auto:name="background2" - auto:fillColor="#FF000000" - auto:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" /> + android:name="background2" + android:fillColor="#FF000000" + android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" /> </group> <group - auto:translateX="50" - auto:translateY="50" > + android:translateX="50" + android:translateY="50" > <path - auto:name="twoLines" - auto:pathData="M 100,20 l 0 80 l -30 -80" - auto:strokeColor="#FF00FF00" - auto:strokeLineCap="butt" - auto:strokeLineJoin="miter" - auto:strokeMiterLimit="5" - auto:strokeWidth="20" /> + android:name="twoLines" + android:pathData="M 100,20 l 0 80 l -30 -80" + android:strokeColor="#FF00FF00" + android:strokeLineCap="butt" + android:strokeLineJoin="miter" + android:strokeMiterLimit="5" + android:strokeWidth="20" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable27.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable27.xml index b8f88cee1c..cd46dd9a7f 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable27.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable27.xml @@ -14,33 +14,32 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:viewportHeight="200" - auto:viewportWidth="200" - auto:width="64dp" > + android:height="64dp" + android:viewportHeight="200" + android:viewportWidth="200" + android:width="64dp" > <group> <path - auto:name="background1" - auto:fillColor="#FF000000" - auto:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" /> + android:name="background1" + android:fillColor="#FF000000" + android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" /> <path - auto:name="background2" - auto:fillColor="#FF000000" - auto:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" /> + android:name="background2" + android:fillColor="#FF000000" + android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" /> </group> <group - auto:translateX="50" - auto:translateY="50" > + android:translateX="50" + android:translateY="50" > <path - auto:name="twoLines" - auto:pathData="M 100,20 l 0 80 l -30 -80" - auto:strokeColor="#FF00FF00" - auto:strokeLineCap="round" - auto:strokeLineJoin="round" - auto:strokeMiterLimit="10" - auto:strokeWidth="20" /> + android:name="twoLines" + android:pathData="M 100,20 l 0 80 l -30 -80" + android:strokeColor="#FF00FF00" + android:strokeLineCap="round" + android:strokeLineJoin="round" + android:strokeMiterLimit="10" + android:strokeWidth="20" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable28.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable28.xml index 30c7fce346..812af6ba46 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable28.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable28.xml @@ -14,34 +14,33 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="64dp" - auto:viewportHeight="200" - auto:viewportWidth="200" - auto:width="64dp" - auto:autoMirrored="true" > + android:height="64dp" + android:viewportHeight="200" + android:viewportWidth="200" + android:width="64dp" + android:autoMirrored="true" > <group> <path - auto:name="background1" - auto:fillColor="#FF000000" - auto:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" /> + android:name="background1" + android:fillColor="#FF000000" + android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" /> <path - auto:name="background2" - auto:fillColor="#FF000000" - auto:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" /> + android:name="background2" + android:fillColor="#FF000000" + android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" /> </group> <group - auto:translateX="50" - auto:translateY="50" > + android:translateX="50" + android:translateY="50" > <path - auto:name="twoLines" - auto:pathData="M 100,20 l 0 80 l -30 -80" - auto:strokeColor="#FF00FF00" - auto:strokeLineCap="square" - auto:strokeLineJoin="bevel" - auto:strokeMiterLimit="10" - auto:strokeWidth="20" /> + android:name="twoLines" + android:pathData="M 100,20 l 0 80 l -30 -80" + android:strokeColor="#FF00FF00" + android:strokeLineCap="square" + android:strokeLineJoin="bevel" + android:strokeMiterLimit="10" + android:strokeWidth="20" /> </group> </vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable29.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable29.xml index 2ac1d428f4..b24d31cc27 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable29.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable29.xml @@ -14,16 +14,15 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="48dp" - auto:width="48dp" - auto:viewportHeight="1" - auto:viewportWidth="1" > + android:height="48dp" + android:width="48dp" + android:viewportHeight="1" + android:viewportWidth="1" > <group> <path - auto:name="box1" - auto:pathData="l0.0.0.5.0.0.5-0.5.0.0-.5z" - auto:fillColor="#ff00ff00"/> + android:name="box1" + android:pathData="l0.0.0.5.0.0.5-0.5.0.0-.5z" + android:fillColor="#ff00ff00"/> </group> </vector> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable30.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable30.xml index 6abb4552c8..24f7372482 100644 --- a/graphics/drawable/teststatic/res/drawable/vector_drawable30.xml +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable30.xml @@ -14,16 +14,15 @@ limitations under the License. --> <vector xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:auto="http://schemas.android.com/apk/res-auto" - auto:height="48dp" - auto:width="48dp" - auto:viewportHeight="48" - auto:viewportWidth="48" > + android:height="48dp" + android:width="48dp" + android:viewportHeight="48" + android:viewportWidth="48" > <group> <path - auto:name="plus1" - auto:pathData="M20 16h-4v8h-8v4h8v8h4v-8h8v-4h-8zm9-3.84v3.64l5-1v21.2h4v-26z" - auto:fillColor="#ff00ff00"/> + android:name="plus1" + android:pathData="M20 16h-4v8h-8v4h8v8h4v-8h8v-4h-8zm9-3.84v3.64l5-1v21.2h4v-26z" + android:fillColor="#ff00ff00"/> </group> </vector> diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable_scale0.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable_scale0.xml new file mode 100644 index 0000000000..828f0d96f9 --- /dev/null +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable_scale0.xml @@ -0,0 +1,57 @@ +<!-- + 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="64dp" + android:viewportHeight="200" + android:viewportWidth="200" + android:width="64dp" > + + <group> + <path + android:name="background1" + android:fillColor="@color/color0" + android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" /> + <path + android:name="background2" + android:fillColor="@color/color2" + android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" /> + </group> + <group + android:pivotX="0" + android:pivotY="0" + android:rotation="90" > + <group + android:scaleX="1.5" + android:scaleY="1" > + <group + android:pivotX="0" + android:pivotY="0" + android:rotation="-90" > + <group + android:scaleX="1.5" + android:scaleY="1" > + <path + android:name="twoLines" + android:fillColor="#FFFF0000" + android:pathData="@string/triangle100" + android:strokeColor="#FF00FF00" + android:strokeWidth="10" /> + </group> + </group> + </group> + </group> + +</vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable_scale1.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable_scale1.xml new file mode 100644 index 0000000000..530c73b20e --- /dev/null +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable_scale1.xml @@ -0,0 +1,52 @@ +<!-- + 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="64dp" + android:viewportHeight="200" + android:viewportWidth="200" + android:width="64dp" > + + <group> + <path + android:name="background1" + android:fillColor="#FF000000" + android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" /> + <path + android:name="background2" + android:fillColor="#FF000000" + android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" /> + </group> + <group + android:scaleX="-1" + android:scaleY="-1" > + <group + android:scaleX="-1" + android:scaleY="-1" > + <group + android:pivotX="100" + android:pivotY="100" + android:rotation="45" > + <path + android:name="twoLines" + android:fillColor="#FFFF0000" + android:pathData="M 100, 0 l 0, 100, -100, 0 z" + android:strokeColor="#FF00FF00" + android:strokeWidth="10" /> + </group> + </group> + </group> + +</vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable_scale2.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable_scale2.xml new file mode 100644 index 0000000000..200eb617a9 --- /dev/null +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable_scale2.xml @@ -0,0 +1,48 @@ +<!-- + 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="64dp" + android:viewportHeight="200" + android:viewportWidth="200" + android:width="64dp" > + + <group> + <path + android:name="background1" + android:fillColor="#FF000000" + android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" /> + <path + android:name="background2" + android:fillColor="#FF000000" + android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" /> + </group> + <group + android:scaleX="2" + android:scaleY="0.5" > + <group + android:pivotX="100" + android:pivotY="100" + android:rotation="45" > + <path + android:name="twoLines" + android:fillColor="#FFFF0000" + android:pathData="M 100, 0 l 0, 100, -100, 0 z" + android:strokeColor="#FF00FF00" + android:strokeWidth="10" /> + </group> + </group> + +</vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_drawable_scale3.xml b/graphics/drawable/teststatic/res/drawable/vector_drawable_scale3.xml new file mode 100644 index 0000000000..a40fc9c215 --- /dev/null +++ b/graphics/drawable/teststatic/res/drawable/vector_drawable_scale3.xml @@ -0,0 +1,62 @@ +<!-- + 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="64dp" + android:viewportHeight="200" + android:viewportWidth="200" + android:width="64dp" > + + <group> + <path + android:name="background1" + android:fillColor="#FF000000" + android:pathData="M 0,0 l 100,0 l 0, 100 l -100, 0 z" /> + <path + android:name="background2" + android:fillColor="#FF000000" + android:pathData="M 100,100 l 100,0 l 0, 100 l -100, 0 z" /> + </group> + <group + android:pivotX="0" + android:pivotY="0" + android:rotation="45" > + <group + android:pivotX="0" + android:pivotY="0" + android:rotation="90" > + <group + android:scaleX="1.5" + android:scaleY="1" > + <group + android:pivotX="0" + android:pivotY="0" + android:rotation="-90" > + <group + android:scaleX="1.5" + android:scaleY="1" > + <path + android:name="twoLines" + android:fillColor="#FFFF0000" + android:pathData="M 100, 0 l 0, 100, -100, 0 z" + android:strokeColor="#FF00FF00" + android:strokeWidth="10" /> + </group> + </group> + </group> + </group> + </group> + +</vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_test01.xml b/graphics/drawable/teststatic/res/drawable/vector_test01.xml new file mode 100644 index 0000000000..8b891d6469 --- /dev/null +++ b/graphics/drawable/teststatic/res/drawable/vector_test01.xml @@ -0,0 +1,31 @@ +<!-- + 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="128dp" + android:width="128dp" + android:viewportHeight="512" + android:viewportWidth="512" > + + <group> + <path + android:name="002b" + android:pathData="M100,200c0,-100 150,-100 150,0s150,100 150,0t-200,299" + android:strokeColor="#FF0000FF" + android:strokeWidth="4" + android:fillColor="#00000000" /> + </group> + +</vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/drawable/vector_test02.xml b/graphics/drawable/teststatic/res/drawable/vector_test02.xml new file mode 100644 index 0000000000..e0af3236b4 --- /dev/null +++ b/graphics/drawable/teststatic/res/drawable/vector_test02.xml @@ -0,0 +1,31 @@ +<!-- + 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. +--> +<vector xmlns:android="http://schemas.android.com/apk/res/android" + android:height="128dp" + android:width="128dp" + android:viewportHeight="512" + android:viewportWidth="512" > + + <group> + <path + android:name="002b" + android:pathData="M100,200c0,-100 150,-100 150,0s150,100 150,0T-200,299" + android:strokeColor="#FF0000FF" + android:strokeWidth="4" + android:fillColor="#00000000" /> + </group> + +</vector>
\ No newline at end of file diff --git a/graphics/drawable/teststatic/res/values/colors.xml b/graphics/drawable/teststatic/res/values/colors.xml new file mode 100644 index 0000000000..6eb303649c --- /dev/null +++ b/graphics/drawable/teststatic/res/values/colors.xml @@ -0,0 +1,20 @@ +<!-- 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> + <color name="color0">#a6e4ea</color> + <color name="color1">#ff3838</color> + <color name="color2">#ffff51</color> + <color name="color3">#0ed300</color> +</resources> diff --git a/graphics/drawable/teststatic/res/values/strings.xml b/graphics/drawable/teststatic/res/values/strings.xml index c5451c8845..065e7d9342 100644 --- a/graphics/drawable/teststatic/res/values/strings.xml +++ b/graphics/drawable/teststatic/res/values/strings.xml @@ -25,4 +25,5 @@ <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 + <string name="triangle100">"M 100, 0 l 0, 100, -100, 0 z"</string> +</resources> diff --git a/graphics/drawable/teststatic/src/android/support/test/vectordrawable/TestActivity.java b/graphics/drawable/teststatic/src/android/support/test/vectordrawable/TestActivity.java index 8bb766e511..c92ff47727 100644 --- a/graphics/drawable/teststatic/src/android/support/test/vectordrawable/TestActivity.java +++ b/graphics/drawable/teststatic/src/android/support/test/vectordrawable/TestActivity.java @@ -34,6 +34,10 @@ public class TestActivity extends Activity { private static final String LOGCAT = "VectorDrawable1"; protected int[] icon = { + R.drawable.vector_drawable_scale0, + R.drawable.vector_drawable_scale1, + R.drawable.vector_drawable_scale2, + R.drawable.vector_drawable_scale3, R.drawable.vector_drawable01, R.drawable.vector_drawable02, R.drawable.vector_drawable03, @@ -64,6 +68,8 @@ public class TestActivity extends Activity { R.drawable.vector_drawable28, R.drawable.vector_drawable29, R.drawable.vector_drawable30, + R.drawable.vector_test01, + R.drawable.vector_test02 }; private static final int EXTRA_TESTS = 2; @@ -85,8 +91,10 @@ public class TestActivity extends Activity { time = android.os.SystemClock.currentThreadTimeMillis()-time; // Testing Tint on one particular case. - d[3].setTint(0x8000FF00); - d[3].setTintMode(Mode.MULTIPLY); + if (d.length > 3) { + d[3].setTint(0x8000FF00); + d[3].setTintMode(Mode.MULTIPLY); + } // Testing Constant State like operation by creating the first 2 icons // from the 3rd one's constant state. diff --git a/graphics/drawable/util/src/android/support/graphics/drawable/AndroidResources.java b/graphics/drawable/util/src/android/support/graphics/drawable/AndroidResources.java new file mode 100644 index 0000000000..e6b2e1429f --- /dev/null +++ b/graphics/drawable/util/src/android/support/graphics/drawable/AndroidResources.java @@ -0,0 +1,82 @@ +/* + * 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. + */ + +package android.support.graphics.drawable; + +public class AndroidResources { + + // Resources ID generated in the latest R.java for framework. + static final int[] styleable_VectorDrawableTypeArray = { + android.R.attr.name, android.R.attr.tint, android.R.attr.height, + android.R.attr.width, android.R.attr.alpha, android.R.attr.autoMirrored, + android.R.attr.mode, android.R.attr.viewportWidth, android.R.attr.viewportHeight + }; + static final int styleable_VectorDrawable_alpha = 4; + static final int styleable_VectorDrawable_autoMirrored = 5; + static final int styleable_VectorDrawable_height = 2; + static final int styleable_VectorDrawable_name = 0; + static final int styleable_VectorDrawable_tint = 1; + static final int styleable_VectorDrawable_Mode = 6; + static final int styleable_VectorDrawable_viewportHeight = 8; + static final int styleable_VectorDrawable_viewportWidth = 7; + static final int styleable_VectorDrawable_width = 3; + static final int[] styleable_VectorDrawableGroup = { + android.R.attr.name, android.R.attr.pivotX, android.R.attr.pivotY, + android.R.attr.scaleX, android.R.attr.scaleY, android.R.attr.rotation, + android.R.attr.translateX, android.R.attr.translateY + }; + static final int styleable_VectorDrawableGroup_name = 0; + static final int styleable_VectorDrawableGroup_pivotX = 1; + static final int styleable_VectorDrawableGroup_pivotY = 2; + static final int styleable_VectorDrawableGroup_rotation = 5; + static final int styleable_VectorDrawableGroup_scaleX = 3; + static final int styleable_VectorDrawableGroup_scaleY = 4; + static final int styleable_VectorDrawableGroup_translateX = 6; + static final int styleable_VectorDrawableGroup_translateY = 7; + static final int[] styleable_VectorDrawablePath = { + android.R.attr.name, android.R.attr.fillColor, android.R.attr.pathData, + android.R.attr.strokeColor, android.R.attr.strokeWidth, android.R.attr.trimPathStart, + android.R.attr.trimPathEnd, android.R.attr.trimPathOffset, android.R.attr.strokeLineCap, + android.R.attr.strokeLineJoin, android.R.attr.strokeMiterLimit, + android.R.attr.strokeAlpha, android.R.attr.fillAlpha + }; + static final int styleable_VectorDrawablePath_fillAlpha = 12; + static final int styleable_VectorDrawablePath_fillColor = 1; + static final int styleable_VectorDrawablePath_name = 0; + static final int styleable_VectorDrawablePath_pathData = 2; + static final int styleable_VectorDrawablePath_strokeAlpha = 11; + static final int styleable_VectorDrawablePath_strokeColor = 3; + static final int styleable_VectorDrawablePath_strokeLineCap = 8; + static final int styleable_VectorDrawablePath_strokeLineJoin = 9; + static final int styleable_VectorDrawablePath_strokeMiterLimit = 10; + static final int styleable_VectorDrawablePath_strokeWidth = 4; + static final int styleable_VectorDrawablePath_trimPathEnd = 6; + static final int styleable_VectorDrawablePath_trimPathOffset = 7; + static final int styleable_VectorDrawablePath_trimPathStart = 5; + static final int[] styleable_VectorDrawableClipPath = { + android.R.attr.name, android.R.attr.pathData + }; + static final int styleable_VectorDrawableClipPath_name = 0; + static final int styleable_VectorDrawableClipPath_pathData = 1; + + static final int[] styleable_AnimatedVectorDrawable = { + android.R.attr.drawable + }; + static final int styleable_AnimatedVectorDrawable_drawable = 0; + static final int[] styleable_AnimatedVectorDrawableTarget = { + android.R.attr.name, android.R.attr.animation + }; + static final int styleable_AnimatedVectorDrawableTarget_animation = 1; + static final int styleable_AnimatedVectorDrawableTarget_name = 0; +} diff --git a/graphics/drawable/util/src/android/support/graphics/drawable/TypedArrayUtils.java b/graphics/drawable/util/src/android/support/graphics/drawable/TypedArrayUtils.java new file mode 100644 index 0000000000..161eae65f8 --- /dev/null +++ b/graphics/drawable/util/src/android/support/graphics/drawable/TypedArrayUtils.java @@ -0,0 +1,67 @@ +/* + * 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. + */ + +package android.support.graphics.drawable; + +import android.content.res.TypedArray; +import org.xmlpull.v1.XmlPullParser; + + +public class TypedArrayUtils { + private static final String NAMESPACE = "http://schemas.android.com/apk/res/android"; + + public static boolean hasAttribute(XmlPullParser parser, String attrName) { + return parser.getAttributeValue(NAMESPACE, attrName) != null; + } + + public static float getNamedFloat(TypedArray a, XmlPullParser parser, String attrName, + int resId, float defaultValue) { + final boolean hasAttr = hasAttribute(parser, attrName); + if (!hasAttr) { + return defaultValue; + } else { + return a.getFloat(resId, defaultValue); + } + } + + public static boolean getNamedBoolean(TypedArray a, XmlPullParser parser, String attrName, + int resId, boolean defaultValue) { + final boolean hasAttr = hasAttribute(parser, attrName); + if (!hasAttr) { + return defaultValue; + } else { + return a.getBoolean(resId, defaultValue); + } + } + + public static int getNamedInt(TypedArray a, XmlPullParser parser, String attrName, + int resId, int defaultValue) { + final boolean hasAttr = hasAttribute(parser, attrName); + if (!hasAttr) { + return defaultValue; + } else { + return a.getInt(resId, defaultValue); + } + } + + public static int getNamedColor(TypedArray a, XmlPullParser parser, String attrName, + int resId, int defaultValue) { + final boolean hasAttr = hasAttribute(parser, attrName); + if (!hasAttr) { + return defaultValue; + } else { + return a.getColor(resId, defaultValue); + } + } +} |
