Skip to content

Commit

Permalink
Fixed krtkush#24
Browse files Browse the repository at this point in the history
  • Loading branch information
krtkush committed May 2, 2017
1 parent 2179b3e commit 8e93b1c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ protected void onCreate(Bundle savedInstanceState) {
linearTimer = new LinearTimer.Builder()
.linearTimerView(linearTimerView)
.duration(duration)
.timerListener(this)
.getCountUpdate(LinearTimer.COUNT_DOWN_TIMER, 1000)
.build();

// Start the timer.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ public abstract class CountUpTimer {
private long base;

public CountUpTimer(long duration, long interval) {
// Reduce the time duration by 1000 millis so as to make sure that tha animation and
// counter finish at the same time.
this.duration = duration - 1000;
this.duration = duration;
this.interval = interval;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,8 @@ else if (countType == COUNT_UP_TIMER)
} else if (countType == COUNT_UP_TIMER)
countUpTimer.resume();

// The LinearTimerView's prefill is reset to as it was when it was paused.
linearTimerView.setAnimation(arcProgressAnimation);

// Start animation again.
arcProgressAnimation.start();
linearTimerView.startAnimation(arcProgressAnimation);

// Store the current status code in intStatusCode integer
intStatusCode = LinearTimerStates.ACTIVE.getStaus();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,12 @@ public class LinearTimerCountDownTimer extends CountDownTimer {
private LinearTimer.TimerListener timerListener;

/**
* @param millisInFuture The number of millis in the future from the call
* @param millisLeftUntilFinished The number of millis in the future from the call
* to {@link #start()} until the countdown is done and {@link #onFinish()}
* is called.
* @param countDownInterval The interval along the way to receive
* {@link #onTick(long)} callbacks.
*/
public LinearTimerCountDownTimer(long millisInFuture, long countDownInterval) {
super(millisInFuture, countDownInterval);
}

public LinearTimerCountDownTimer(long millisLeftUntilFinished,
long countDownInterval, LinearTimer.TimerListener timerListener) {
super(millisLeftUntilFinished, countDownInterval);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ public class LinearTimerCountUpTimer extends CountUpTimer {

private LinearTimer.TimerListener timerListener;

public LinearTimerCountUpTimer(long duration, long interval) {
super(duration, interval);
}

public LinearTimerCountUpTimer(long timerDuration,
long countUpInterval, LinearTimer.TimerListener timerListener) {
super(timerDuration, countUpInterval);
this.timerListener = timerListener;
// Reduce the time duration by 1000 millis so as to make sure that tha animation and
// counter finish at the same time.
this.timerDuration = timerDuration;
}

Expand Down

0 comments on commit 8e93b1c

Please sign in to comment.