Skip to content

Commit

Permalink
Merge pull request #8 from farhadfaghihi/master
Browse files Browse the repository at this point in the history
Added animatedSvgTraceMarkerLength attribute
  • Loading branch information
Jared Rummler authored Dec 25, 2016
2 parents 2d0d52d + 36548b7 commit d5c051d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions demo/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
app:animatedSvgImageSizeX="400"
app:animatedSvgImageSizeY="400"
app:animatedSvgTraceTime="2000"
app:animatedSvgTraceMarkerLength="50"
app:animatedSvgTraceTimePerGlyph="1000"/>

<LinearLayout
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private static float constrain(float min, float max, float v) {
private int mTraceTimePerGlyph = 1000;
private int mFillStart = 1200;
private int mFillTime = 1000;
private static final int MARKER_LENGTH_DIP = 16;
private int mTraceMarkerLength = 16;
private int[] mTraceResidueColors;
private int[] mTraceColors;
private float mViewportWidth;
Expand Down Expand Up @@ -108,9 +108,6 @@ private void init(Context context, AttributeSet attrs) {
mFillPaint.setAntiAlias(true);
mFillPaint.setStyle(Paint.Style.FILL);

mMarkerLength =
TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, MARKER_LENGTH_DIP, getResources().getDisplayMetrics());

mTraceColors = new int[1];
mTraceColors[0] = Color.BLACK;
mTraceResidueColors = new int[1];
Expand All @@ -126,6 +123,8 @@ private void init(Context context, AttributeSet attrs) {
mTraceTimePerGlyph = a.getInt(R.styleable.AnimatedSvgView_animatedSvgTraceTimePerGlyph, 1000);
mFillStart = a.getInt(R.styleable.AnimatedSvgView_animatedSvgFillStart, 1200);
mFillTime = a.getInt(R.styleable.AnimatedSvgView_animatedSvgFillTime, 1000);
mTraceMarkerLength = a.getInt(R.styleable.AnimatedSvgView_animatedSvgTraceMarkerLength,16);
mMarkerLength = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, mTraceMarkerLength, getResources().getDisplayMetrics());
int glyphStringsId = a.getResourceId(R.styleable.AnimatedSvgView_animatedSvgGlyphStrings, 0);
int traceResidueColorsId = a.getResourceId(R.styleable.AnimatedSvgView_animatedSvgTraceResidueColors, 0);
int traceColorsId = a.getResourceId(R.styleable.AnimatedSvgView_animatedSvgTraceColors, 0);
Expand Down
1 change: 1 addition & 0 deletions library/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<attr name="animatedSvgGlyphStrings" format="reference"/>
<attr name="animatedSvgTraceColors" format="reference"/>
<attr name="animatedSvgTraceResidueColors" format="reference"/>
<attr name="animatedSvgTraceMarkerLength" format="integer"/>
<attr name="animatedSvgFillColors" format="reference"/>
</declare-styleable>
</resources>

0 comments on commit d5c051d

Please sign in to comment.