Skip to content

Commit

Permalink
Added the new attribute 'TraceMarkerLength' to AnimatedSvgView widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Farhad Faghihi committed Dec 24, 2016
1 parent 0227d37 commit 13cc705
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,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 @@ -101,9 +101,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 @@ -119,6 +116,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 13cc705

Please sign in to comment.