mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-27 19:22:15 -05:00
Show time in messages previous days
This commit is contained in:
parent
8379f69516
commit
bb6e732ca1
@ -54,7 +54,7 @@ public class UIHelper {
|
|||||||
private static final int FG_COLOR = 0xFFFAFAFA;
|
private static final int FG_COLOR = 0xFFFAFAFA;
|
||||||
private static final int TRANSPARENT = 0x00000000;
|
private static final int TRANSPARENT = 0x00000000;
|
||||||
private static final int DATE_NO_YEAR_FLAGS = DateUtils.FORMAT_SHOW_DATE
|
private static final int DATE_NO_YEAR_FLAGS = DateUtils.FORMAT_SHOW_DATE
|
||||||
| DateUtils.FORMAT_NO_YEAR | DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_ABBREV_ALL;
|
| DateUtils.FORMAT_NO_YEAR | DateUtils.FORMAT_ABBREV_ALL;
|
||||||
|
|
||||||
public static String readableTimeDifference(Context context, long time) {
|
public static String readableTimeDifference(Context context, long time) {
|
||||||
if (time == 0) {
|
if (time == 0) {
|
||||||
@ -69,7 +69,7 @@ public class UIHelper {
|
|||||||
} else if (difference < 60 * 15) {
|
} else if (difference < 60 * 15) {
|
||||||
return context.getString(R.string.minutes_ago,
|
return context.getString(R.string.minutes_ago,
|
||||||
Math.round(difference / 60.0));
|
Math.round(difference / 60.0));
|
||||||
} else if (today(date)) {
|
} else if (today(date) || difference < 12 * 60 * 60) {
|
||||||
java.text.DateFormat df = DateFormat.getTimeFormat(context);
|
java.text.DateFormat df = DateFormat.getTimeFormat(context);
|
||||||
return df.format(date);
|
return df.format(date);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user