From 570f79d91ad027939c8190a95436b3749793c7b7 Mon Sep 17 00:00:00 2001 From: agrajaghh Date: Wed, 3 Jun 2015 20:37:13 +0200 Subject: [PATCH] fix unit strings Fixes #3295 Closes #3320 //FREEBIE --- res/values/strings.xml | 6 +----- src/org/thoughtcrime/securesms/util/DateUtils.java | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 6c47796a71..b68ec4bdee 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -158,6 +158,7 @@ Now + %d min Share with @@ -684,11 +685,6 @@ Use custom - - %d min - %d mins - - %d hour %d hours diff --git a/src/org/thoughtcrime/securesms/util/DateUtils.java b/src/org/thoughtcrime/securesms/util/DateUtils.java index af9df22ddb..ac570fd80d 100644 --- a/src/org/thoughtcrime/securesms/util/DateUtils.java +++ b/src/org/thoughtcrime/securesms/util/DateUtils.java @@ -50,7 +50,7 @@ public class DateUtils extends android.text.format.DateUtils { return c.getString(R.string.DateUtils_now); } else if (isWithin(timestamp, 1, TimeUnit.HOURS)) { int mins = convertDelta(timestamp, TimeUnit.MINUTES); - return c.getResources().getQuantityString(R.plurals.minutes_ago, mins, mins); + return c.getResources().getString(R.string.DateUtils_minutes_ago, mins); } else if (isWithin(timestamp, 1, TimeUnit.DAYS)) { int hours = convertDelta(timestamp, TimeUnit.HOURS); return c.getResources().getQuantityString(R.plurals.hours_ago, hours, hours); @@ -68,7 +68,7 @@ public class DateUtils extends android.text.format.DateUtils { return c.getString(R.string.DateUtils_now); } else if (isWithin(timestamp, 1, TimeUnit.HOURS)) { int mins = (int)TimeUnit.MINUTES.convert(System.currentTimeMillis() - timestamp, TimeUnit.MILLISECONDS); - return c.getResources().getQuantityString(R.plurals.minutes_ago, mins, mins); + return c.getResources().getString(R.string.DateUtils_minutes_ago, mins); } else { StringBuilder format = new StringBuilder(); if (isWithin(timestamp, 6, TimeUnit.DAYS)) format.append("EEE ");