From f73332f2a571c69e5a4ecc3eea4a7ae3722cb55b Mon Sep 17 00:00:00 2001 From: Dan Ambrisco Date: Wed, 4 Mar 2015 10:07:33 -0700 Subject: [PATCH] Add prefix to all MrVector attrs --- demo/src/main/res/drawable/logo.xml | 14 +-- .../res/drawable/sample_vector_drawable.xml | 22 ++-- demo/src/main/res/drawable/simple.xml | 14 +-- demo/src/main/res/drawable/vector_android.xml | 12 +- .../com/telly/mrvector/VectorDrawable.java | 64 +++++----- library/src/main/res/values/attrs.xml | 118 +++++++++--------- 6 files changed, 122 insertions(+), 122 deletions(-) diff --git a/demo/src/main/res/drawable/logo.xml b/demo/src/main/res/drawable/logo.xml index dcf735e..98634ef 100644 --- a/demo/src/main/res/drawable/logo.xml +++ b/demo/src/main/res/drawable/logo.xml @@ -4,10 +4,10 @@ xmlns:auto="http://schemas.android.com/apk/res-auto" tools:targetApi="21" - auto:width="@dimen/logo_side" + auto:mvWidth="@dimen/logo_side" auto:height="@dimen/logo_side" - auto:viewportWidth="@integer/logo_viewport_side" - auto:viewportHeight="@integer/logo_viewport_side" + auto:mvViewportWidth="@integer/logo_viewport_side" + auto:mvViewportHeight="@integer/logo_viewport_side" android:width="@dimen/logo_side" android:height="@dimen/logo_side" @@ -17,15 +17,15 @@ tag requires height > 0"); } - final float alphaInFloat = a.getFloat(R.styleable.VectorDrawable_alpha, + final float alphaInFloat = a.getFloat(R.styleable.VectorDrawable_mvAlpha, pathRenderer.getAlpha()); pathRenderer.setAlpha(alphaInFloat); - final String name = a.getString(R.styleable.VectorDrawable_name); + final String name = a.getString(R.styleable.VectorDrawable_mvName); if (name != null) { pathRenderer.mRootName = name; pathRenderer.mVGTargetsMap.put(name, pathRenderer); @@ -1134,15 +1134,15 @@ private void updateStateFromTypedArray(TypedArray 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); + mRotate = a.getFloat(R.styleable.VectorDrawableGroup_mvRotation, mRotate); + mPivotX = a.getFloat(R.styleable.VectorDrawableGroup_mvPivotX, mPivotX); + mPivotY = a.getFloat(R.styleable.VectorDrawableGroup_mvPivotY, mPivotY); + mScaleX = a.getFloat(R.styleable.VectorDrawableGroup_mvScaleX, mScaleX); + mScaleY = a.getFloat(R.styleable.VectorDrawableGroup_mvScaleY, mScaleY); + mTranslateX = a.getFloat(R.styleable.VectorDrawableGroup_mvTranslateX, mTranslateX); + mTranslateY = a.getFloat(R.styleable.VectorDrawableGroup_mvTranslateY, mTranslateY); - final String groupName = a.getString(R.styleable.VectorDrawableGroup_name); + final String groupName = a.getString(R.styleable.VectorDrawableGroup_mvName); if (groupName != null) { mGroupName = groupName; } @@ -1349,12 +1349,12 @@ private void updateStateFromTypedArray(TypedArray a) { // Account for any configuration changes. mChangingConfigurations |= Utils.getChangingConfigurations(a);; - final String pathName = a.getString(R.styleable.VectorDrawableClipPath_name); + final String pathName = a.getString(R.styleable.VectorDrawableClipPath_mvName); if (pathName != null) { mPathName = pathName; } - final String pathData = a.getString(R.styleable.VectorDrawableClipPath_pathData); + final String pathData = a.getString(R.styleable.VectorDrawableClipPath_mvPathData); if (pathData != null) { mNodes = PathParser.createNodesFromPathData(pathData); } @@ -1457,38 +1457,38 @@ private void updateStateFromTypedArray(TypedArray 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); + final String pathName = a.getString(R.styleable.VectorDrawablePath_mvName); if (pathName != null) { mPathName = pathName; } - final String pathData = a.getString(R.styleable.VectorDrawablePath_pathData); + final String pathData = a.getString(R.styleable.VectorDrawablePath_mvPathData); if (pathData != null) { mNodes = PathParser.createNodesFromPathData(pathData); } - mFillColor = a.getColor(R.styleable.VectorDrawablePath_fillColor, + mFillColor = a.getColor(R.styleable.VectorDrawablePath_mvFillColor, mFillColor); - mFillAlpha = a.getFloat(R.styleable.VectorDrawablePath_fillAlpha, + mFillAlpha = a.getFloat(R.styleable.VectorDrawablePath_mvFillAlpha, mFillAlpha); mStrokeLineCap = getStrokeLineCap(a.getInt( - R.styleable.VectorDrawablePath_strokeLineCap, -1), mStrokeLineCap); + R.styleable.VectorDrawablePath_mvStrokeLineCap, -1), mStrokeLineCap); mStrokeLineJoin = getStrokeLineJoin(a.getInt( - R.styleable.VectorDrawablePath_strokeLineJoin, -1), mStrokeLineJoin); + R.styleable.VectorDrawablePath_mvStrokeLineJoin, -1), mStrokeLineJoin); mStrokeMiterlimit = a.getFloat( - R.styleable.VectorDrawablePath_strokeMiterLimit, mStrokeMiterlimit); - mStrokeColor = a.getColor(R.styleable.VectorDrawablePath_strokeColor, + R.styleable.VectorDrawablePath_mvStrokeMiterLimit, mStrokeMiterlimit); + mStrokeColor = a.getColor(R.styleable.VectorDrawablePath_mvStrokeColor, mStrokeColor); - mStrokeAlpha = a.getFloat(R.styleable.VectorDrawablePath_strokeAlpha, + mStrokeAlpha = a.getFloat(R.styleable.VectorDrawablePath_mvStrokeAlpha, mStrokeAlpha); - mStrokeWidth = a.getFloat(R.styleable.VectorDrawablePath_strokeWidth, + mStrokeWidth = a.getFloat(R.styleable.VectorDrawablePath_mvStrokeWidth, mStrokeWidth); - mTrimPathEnd = a.getFloat(R.styleable.VectorDrawablePath_trimPathEnd, + mTrimPathEnd = a.getFloat(R.styleable.VectorDrawablePath_mvTrimPathEnd, mTrimPathEnd); mTrimPathOffset = a.getFloat( - R.styleable.VectorDrawablePath_trimPathOffset, mTrimPathOffset); + R.styleable.VectorDrawablePath_mvTrimPathOffset, mTrimPathOffset); mTrimPathStart = a.getFloat( - R.styleable.VectorDrawablePath_trimPathStart, mTrimPathStart); + R.styleable.VectorDrawablePath_mvTrimPathStart, mTrimPathStart); } @Override diff --git a/library/src/main/res/values/attrs.xml b/library/src/main/res/values/attrs.xml index 7f6aa87..ca4873e 100644 --- a/library/src/main/res/values/attrs.xml +++ b/library/src/main/res/values/attrs.xml @@ -13,55 +13,55 @@ - + - + - + - + - + - + - + - + - + - - - + + + - + - + - + - + - + - + @@ -72,94 +72,94 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - + + + + - - - - + + + + - + - + - + @@ -170,14 +170,14 @@ - + - + - +