Skip to content

Commit

Permalink
Added setter for speed
Browse files Browse the repository at this point in the history
  • Loading branch information
tsuijten committed Oct 21, 2015
1 parent e134de9 commit 7bed07c
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void onDraw(Canvas canvas) {
left += width;
}

if (isStarted) {
if (isStarted && speed != 0) {
offset -= abs(speed);
postInvalidateOnAnimation();
}
Expand Down Expand Up @@ -159,4 +159,11 @@ public void stop() {
invalidate();
}
}

public void setSpeed(float speed) {
this.speed = speed;
if (isStarted) {
postInvalidateOnAnimation();
}
}
}

0 comments on commit 7bed07c

Please sign in to comment.