aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-06-15 20:12:40 +0200
committerDaniel Gultsch <daniel@gultsch.de>2014-06-15 20:12:40 +0200
commite6b5713c125c65dc152ce1439c3c0fd0091f3820 (patch)
tree148c40ac680312a69f01eef549fb4cc060741b7e /src/eu/siacs
parent7a164f7639d586f2b50be3beb583c0b761039d55 (diff)
parentfebf23de1fcef45ae30b8a6e3cf13339b9d54e90 (diff)
Merge pull request #211 from kruks23/development
Rounded minutes ago and last seen moe exactly
Diffstat (limited to 'src/eu/siacs')
-rw-r--r--src/eu/siacs/conversations/utils/UIHelper.java20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/eu/siacs/conversations/utils/UIHelper.java b/src/eu/siacs/conversations/utils/UIHelper.java
index 50715ee9..183d94f3 100644
--- a/src/eu/siacs/conversations/utils/UIHelper.java
+++ b/src/eu/siacs/conversations/utils/UIHelper.java
@@ -61,8 +61,10 @@ public class UIHelper {
}
Date date = new Date(time);
long difference = (System.currentTimeMillis() - time) / 1000;
- if (difference < 90) {
+ if (difference < 60) {
return context.getString(R.string.just_now);
+ } else if (difference < 60 * 2) {
+ return context.getString(R.string.minute_ago);
} else if (difference < 60 * 15) {
return context.getString(R.string.minutes_ago,Math.round(difference/60.0));
} else if (today(date)) {
@@ -87,12 +89,18 @@ public class UIHelper {
return context.getString(R.string.never_seen);
}
long difference = (System.currentTimeMillis() - time) / 1000;
- if (difference < 90) {
+ if (difference < 60) {
return context.getString(R.string.last_seen_now);
- } else if (difference < 60 * 90) {
- return context.getString(R.string.last_seen_mins,Math.round(difference/60.0));
- } else if (difference < 60 * 60 * 36) {
- return context.getString(R.string.last_seen_hours,Math.round(difference/(60.0*60.0)));
+ } else if (difference < 60 * 2) {
+ return context.getString(R.string.last_seen_min);
+ } else if (difference < 60 * 60) {
+ return context.getString(R.string.last_seen_mins,Math.round(difference/60.0));
+ } else if (difference < 60 * 60 * 2) {
+ return context.getString(R.string.last_seen_hour);
+ } else if (difference < 60 * 60 * 24) {
+ return context.getString(R.string.last_seen_hours,Math.round(difference/(60.0*60.0)));
+ } else if (difference < 60 * 60 * 48) {
+ return context.getString(R.string.last_seen_day);
} else {
return context.getString(R.string.last_seen_days,Math.round(difference/(60.0*60.0*24.0)));
}