summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTyler Gunn <tgunn@google.com>2014-06-10 12:59:53 -0700
committerTyler Gunn <tgunn@google.com>2014-06-10 12:59:53 -0700
commit1e273313ff938ba0c7294dade433736d3fc5876b (patch)
treee15ec0ea30b4b3c0e1869c1cbae299e949e7503a
parentaa3350fe6fc21945e52f4a1096e68e73757ad2bf (diff)
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
-rw-r--r--res/values/strings.xml10
-rw-r--r--src/com/android/dialer/calllog/CallLogAdapter.java10
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] -->
<string name="toast_entry_removed">Call log entry deleted.</string>
+ <!-- String used as a header in the call log above calls which occurred today.
+ [CHAR LIMIT=65] -->
+ <string name="call_log_header_today">Today</string>
+
+ <!-- String used as a header in the call log above calls which occurred yesterday.
+ [CHAR LIMIT=65] -->
+ <string name="call_log_header_yesterday">Yesterday</string>
+
<!-- String used as a header in the call log above calls which occurred last week.
[CHAR LIMIT=65] -->
<string name="call_log_header_last_week">Last week</string>
- <!-- String used as a header in the call log above calls which ocurred more than a week ago.
+ <!-- String used as a header in the call log above calls which occurred more than a week ago.
[CHAR LIMIT=65] -->
<string name="call_log_header_other">Other</string>
</resources>
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 {