Skip to content

Commit

Permalink
Add State annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jared Rummler committed Mar 20, 2017
1 parent 2d84cde commit 05fb8df
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ private void setSvg(SVG svg) {
svgView.setViewportSize(svg.width, svg.height);
svgView.setTraceResidueColor(0x32000000);
svgView.setTraceColors(svg.colors);

svgView.setTraceTime(10_000);
svgView.setTraceTimePerGlyph(10_000);
svgView.setFillTime(5_000);
svgView.setFillStart(5_000);

svgView.rebuildGlyphData();
svgView.start();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import android.graphics.RectF;
import android.os.Build;
import android.support.annotation.ColorInt;
import android.support.annotation.IntDef;
import android.support.annotation.NonNull;
import android.support.graphics.drawable.ExposedPathParser;
import android.support.v4.view.ViewCompat;
Expand Down Expand Up @@ -472,7 +473,7 @@ public void setToFinishedFrame() {
* {@link #STATE_FILL_STARTED} or
* {@link #STATE_FINISHED}
*/
public int getState() {
@State public int getState() {
return mState;
}

Expand All @@ -486,7 +487,7 @@ public void setOnStateChangeListener(OnStateChangeListener onStateChangeListener
mOnStateChangeListener = onStateChangeListener;
}

private void changeState(int state) {
private void changeState(@State int state) {
if (mState == state) {
return;
}
Expand All @@ -512,14 +513,18 @@ public interface OnStateChangeListener {
* {@link #STATE_FILL_STARTED} or
* {@link #STATE_FINISHED}
*/
void onStateChange(int state);
void onStateChange(@State int state);
}

static final class GlyphData {
@IntDef({STATE_NOT_STARTED, STATE_TRACE_STARTED, STATE_FILL_STARTED, STATE_FINISHED})
public @interface State {
}

static final class GlyphData {
Path path;
Paint paint;
float length;

}

}

0 comments on commit 05fb8df

Please sign in to comment.