OSDN Git Service

過去記録表示を作りこむ。(データの削除はまだ。)
[gokigen/JoggingTimer.git] / wear / src / main / java / net / osdn / gokigen / joggingtimer / stopwatch / MyTimerCounter.java
index c7280fb..261c541 100644 (file)
@@ -26,27 +26,6 @@ public class MyTimerCounter implements Parcelable, ITimerCounter
 
 
     /**
-     *  Converts time value from long to string
-     * @param millis  time(milliseconds)
-     * @return  hh:mm:ss.S
-     */
-    static CharSequence getTimeString(long millis)
-    {
-        int ms = (int) ((millis % 1000) / 100);
-        int sec = (int) (millis / 1000) % 60;
-        int minutes = (int) ((millis / (1000 * 60)) % 60);
-        int hours = (int) ((millis / (1000 * 60 * 60)) % 24);
-
-        if (hours < 1)
-        {
-            // 1時間経過していない時は、時間表示は省略する
-            return (String.format(Locale.US,"%02d'%02d\"%d", minutes, sec, ms));
-        }
-        return (String.format(Locale.US,"%d:%02d'%02d\"%d", hours, minutes, sec, ms));
-        //return (DateFormat.format("hh:mm:ss.S", time));
-    }
-
-    /**
      *   Is my timer running?
      *
      * @return  true : running, false : stopped
@@ -81,12 +60,15 @@ public class MyTimerCounter implements Parcelable, ITimerCounter
     }
 
     @Override
-    public void timeStamp()
+    public long timeStamp()
     {
+        long timeToSet = 0;
         if (!isTimerStopped)
         {
-            elapsedTime.add(SystemClock.elapsedRealtime());
+            timeToSet = SystemClock.elapsedRealtime();
+            elapsedTime.add(timeToSet);
         }
+        return (timeToSet);
     }
 
     @Override
@@ -169,6 +151,18 @@ public class MyTimerCounter implements Parcelable, ITimerCounter
     }
 
     @Override
+    public long getStartTime()
+    {
+        return (startTime);
+    }
+
+    @Override
+    public long getStopTime()
+    {
+        return (stopTime);
+    }
+
+    @Override
     public int describeContents()
     {
         return 0;