summaryrefslogtreecommitdiffstats
path: root/src/com/android/deskclock/stopwatch/Stopwatches.java
diff options
context:
space:
mode:
authorSteve Kondik <shade@chemlab.org>2013-02-13 00:37:05 -0800
committerSteve Kondik <shade@chemlab.org>2013-02-13 00:37:05 -0800
commit1f5a43d0469fce561c311a19c85ac8dd036c4cac (patch)
tree3b3ce44c9eccb23e898ee53c45c3e9bac1962fb7 /src/com/android/deskclock/stopwatch/Stopwatches.java
parent057d88c735d8d0e7dce9714f9db28388501c24e7 (diff)
parent0ed03e8e14cf2edcda9ee3ecc604d4e048c8ccf3 (diff)
downloadandroid_packages_apps_DeskClock-mr1.1-staging.tar.gz
android_packages_apps_DeskClock-mr1.1-staging.tar.bz2
android_packages_apps_DeskClock-mr1.1-staging.zip
Merge tag 'android-4.2.2_r1' of https://android.googlesource.com/platform/packages/apps/DeskClock into 1.1mr1.1-staging
Android 4.2.2 release 1 Conflicts: res/xml/settings.xml src/com/android/deskclock/AlarmAlertFullScreen.java src/com/android/deskclock/AlarmKlaxon.java src/com/android/deskclock/DeskClock.java src/com/android/deskclock/SettingsActivity.java Change-Id: Ieba9c47923469713cf14c310044fe8fb3b31523c
Diffstat (limited to 'src/com/android/deskclock/stopwatch/Stopwatches.java')
-rw-r--r--src/com/android/deskclock/stopwatch/Stopwatches.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/com/android/deskclock/stopwatch/Stopwatches.java b/src/com/android/deskclock/stopwatch/Stopwatches.java
index d8d0741d5..94af594b4 100644
--- a/src/com/android/deskclock/stopwatch/Stopwatches.java
+++ b/src/com/android/deskclock/stopwatch/Stopwatches.java
@@ -19,7 +19,6 @@ package com.android.deskclock.stopwatch;
import android.content.Context;
import com.android.deskclock.R;
-import com.android.deskclock.stopwatch.StopwatchFragment.Lap;
public class Stopwatches {
// Private actions processed by the receiver
@@ -107,4 +106,23 @@ public class Stopwatches {
return timeStr;
}
+ /***
+ * Sets the string of the time running on the stopwatch up to hundred of a second accuracy
+ * @param time - in hundreds of a second since the stopwatch started
+ */
+ public static String formatTimeText(long time, final String format) {
+ if (time < 0) {
+ time = 0;
+ }
+ long hundreds, seconds, minutes, hours;
+ seconds = time / 1000;
+ hundreds = (time - seconds * 1000) / 10;
+ minutes = seconds / 60;
+ seconds = seconds - minutes * 60;
+ hours = minutes / 60;
+ minutes = minutes - hours * 60;
+ String timeStr = String.format(format, hours, minutes, seconds, hundreds);
+ return timeStr;
+ }
+
}