forked from upstream-mirrors/OpenTracks
fix comment on 78a330b32e6f
This commit is contained in:
+6
-6
@@ -182,17 +182,17 @@ public class StatusAnnouncerTask implements PeriodicTask {
|
||||
int speedLabel;
|
||||
if (metricUnits) {
|
||||
if (reportSpeed) {
|
||||
speedLabel = R.string.kilometer_per_hour_long;
|
||||
speedLabel = R.string.voice_kilometer_per_hour;
|
||||
} else {
|
||||
speedLabel = R.string.per_kilometer;
|
||||
speedLabel = R.string.voice_per_kilometer;
|
||||
}
|
||||
} else {
|
||||
s *= UnitConversions.KMH_TO_MPH;
|
||||
d *= UnitConversions.KM_TO_MI;
|
||||
if (reportSpeed) {
|
||||
speedLabel = R.string.mile_per_hour_long;
|
||||
speedLabel = R.string.voice_mile_per_hour;
|
||||
} else {
|
||||
speedLabel = R.string.per_mile;
|
||||
speedLabel = R.string.voice_per_mile;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -214,8 +214,8 @@ public class StatusAnnouncerTask implements PeriodicTask {
|
||||
context.getString(R.string.total_distance_label),
|
||||
d,
|
||||
context.getString(metricUnits
|
||||
? R.string.kilometers_long
|
||||
: R.string.miles_long),
|
||||
? R.string.voice_kilometers
|
||||
: R.string.voice_miles),
|
||||
stringUtils.formatTimeLong(stats.getMovingTime()),
|
||||
speed,
|
||||
context.getString(speedLabel));
|
||||
|
||||
@@ -221,14 +221,19 @@ public class StringUtils implements DescriptionGenerator {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Formats a time for voice announcement.
|
||||
*
|
||||
* @param time the time
|
||||
*/
|
||||
public String formatTimeLong(long time) {
|
||||
int[] parts = getTimeParts(time);
|
||||
String secLabel =
|
||||
context.getString(parts[0] == 1 ? R.string.second : R.string.seconds);
|
||||
context.getString(parts[0] == 1 ? R.string.voice_second : R.string.voice_seconds);
|
||||
String minLabel =
|
||||
context.getString(parts[1] == 1 ? R.string.minute : R.string.minutes);
|
||||
context.getString(parts[1] == 1 ? R.string.voice_minute : R.string.voice_minutes);
|
||||
String hourLabel =
|
||||
context.getString(parts[2] == 1 ? R.string.hour : R.string.hours);
|
||||
context.getString(parts[2] == 1 ? R.string.voice_hour : R.string.voice_hours);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (parts[2] != 0) {
|
||||
|
||||
Reference in New Issue
Block a user