From 1e273313ff938ba0c7294dade433736d3fc5876b Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Tue, 10 Jun 2014 12:59:53 -0700 Subject: Adding "today" and "yesterday" string resources. These replace a previous method which relied on buggy methods to try and get the today and yesterday literals from the locale layer using a date format method. Bug: 15541650 Change-Id: I6ff6dd133904f21c8b41b51e68db465c34186719 --- res/values/strings.xml | 10 +++++++++- src/com/android/dialer/calllog/CallLogAdapter.java | 10 ++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index 8f083c885..bd23506a5 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -687,11 +687,19 @@ [CHAR LIMIT=NONE] --> Call log entry deleted. + + Today + + + Yesterday + Last week - Other diff --git a/src/com/android/dialer/calllog/CallLogAdapter.java b/src/com/android/dialer/calllog/CallLogAdapter.java index 924a17fc2..12edaa0f2 100644 --- a/src/com/android/dialer/calllog/CallLogAdapter.java +++ b/src/com/android/dialer/calllog/CallLogAdapter.java @@ -122,12 +122,6 @@ public class CallLogAdapter extends GroupingListAdapter /** The size of the cache of contact info. */ private static final int CONTACT_INFO_CACHE_SIZE = 100; - /** Localized string representing the word "Today". */ - private final CharSequence mTodayLabel = DateUtils.getTodayString(); - - /** Localized string representing the word "Yesterday". */ - private final CharSequence mYesterdayLabel = DateUtils.getYesterdayString(); - /** Constant used to indicate no row is expanded. */ private static final long NONE_EXPANDED = -1; @@ -1318,9 +1312,9 @@ public class CallLogAdapter extends GroupingListAdapter */ private CharSequence getGroupDescription(int group) { if (group == CallLogGroupBuilder.DAY_GROUP_TODAY) { - return mTodayLabel; + return mContext.getResources().getString(R.string.call_log_header_today); } else if (group == CallLogGroupBuilder.DAY_GROUP_YESTERDAY) { - return mYesterdayLabel; + return mContext.getResources().getString(R.string.call_log_header_yesterday); } else if (group == CallLogGroupBuilder.DAY_GROUP_LAST_WEEK) { return mContext.getResources().getString(R.string.call_log_header_last_week); } else { -- cgit v1.2.3