示例#1
0
 public long updateTimeLeft(boolean forceUpdate) {
   if (isTicking() || forceUpdate) {
     long millis = Utils.getTimeNow();
     mTimeLeft = mOriginalLength - (millis - mStartTime);
   }
   return mTimeLeft;
 }
示例#2
0
 public void addTime(long time) {
   mTimeLeft = mOriginalLength - (Utils.getTimeNow() - mStartTime);
   if (mTimeLeft < MAX_TIMER_LENGTH - time) {
     mOriginalLength += time;
   }
 }
示例#3
0
 private void init(long length) {
   mTimerId = (int) Utils.getTimeNow();
   mStartTime = Utils.getTimeNow();
   mTimeLeft = mOriginalLength = mSetupLength = length;
   mLabel = "";
 }