<string name="in_call">к Жене</string>
<string name="out_call">от Жени</string>
<string name="duration">длиной</string>
+ <string name="lessthan">меньше</string>
<string name="minutes1">минуту</string>
<string name="minutes2to4">минуты</string>
<string name="minutes5up">минут</string>
private String in_call;
private String out_call;
private String duration;
+ private String lessthan;
private String minutes1;
private String minutes2to4;
private String minutes5up;
in_call = res.getString(R.string.in_call);
out_call = res.getString(R.string.out_call);
duration = res.getString(R.string.duration);
+ lessthan = res.getString(R.string.lessthan);
minutes1 = res.getString(R.string.minutes1);
minutes2to4 = res.getString(R.string.minutes2to4);
minutes5up = res.getString(R.string.minutes5up);
stime.set(latestStartTime);
Long dur = (latestStopTime - latestStartTime) / 60000L;
Log.v(TAG, "Chosen event: start " + stime +
- " for " + dur + " sec");
+ " for " + dur + " min");
String minutes;
- if (dur == 1) {
+ String howlong = dur.toString();
+ if (dur == 0) {
+ howlong = lessthan;
+ minutes = minutes2to4;
+ } else if ((dur / 10) == 1) {
+ minutes = minutes5up;
+ } else if ((dur % 10) == 1) {
minutes = minutes1;
- } else if (dur < 5) {
+ } else if ((dur % 10) < 5) {
minutes = minutes2to4;
} else {
minutes = minutes5up;
return last_call +
" " + (latestWasOutgoing?out_call:in_call) +
" " + sayWhen.say(latestStartTime) +
- " " + duration + " " + dur + " " + minutes;
+ " " + duration + " " + howlong + " " + minutes;
}
}