public class SSTimer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) boolean |
canceled
boolean indicating if the timer count down was canceled.
|
private CountDownTimer |
cdt
The Android CountDownTimer timer used in the SSTimer
|
private OnSSTimerListener |
listener
The saved class implementing the
OnSSTimerListener |
private SSTimer |
me
Current instance of the SSSTimer
|
private long |
minTime
The minimum time associated with the current instance of the SSTimer
|
private long |
startTime
time when
setStartTime() |
Constructor and Description |
---|
SSTimer()
Constructor that saves the current instance of the class
|
Modifier and Type | Method and Description |
---|---|
void |
cancelCountDown()
Stops the timer
|
void |
countDownFrom(int sec)
sets the amount the timer will run before calling the onTimerDone method
set via the
OnSSTimerListener interface. |
int |
getTimeElapsed()
Called when the time elapsed is desired
|
boolean |
hasMinimumTimeElapsed()
Indicates weather or not the minimum time set by
setMinimumTimePeriod(int) has been reached |
void |
setMinimumTimePeriod(int seconds)
set the minimum elapsed time for this timer
|
void |
setOnSSTimerListener(java.lang.Object o)
sets the onTimerDone method to be performed on timer completion
|
void |
setStartTime()
Sets the starting time of the timer
|
void |
startCountDown()
Starts the timer
|
boolean canceled
private CountDownTimer cdt
private OnSSTimerListener listener
OnSSTimerListener
private SSTimer me
private long minTime
private long startTime
setStartTime()
public SSTimer()
public void cancelCountDown()
public void countDownFrom(int sec)
OnSSTimerListener
interface.
startCountDown()
must be called to initiate the timer.public int getTimeElapsed()
setStartTime()
was calledpublic boolean hasMinimumTimeElapsed()
setMinimumTimePeriod(int)
has been reachedpublic void setMinimumTimePeriod(int seconds)
public void setOnSSTimerListener(java.lang.Object o)
public void setStartTime()
public void startCountDown()