diff options
author | Roshan Pius <rpius@google.com> | 2015-06-09 15:38:45 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2015-06-10 00:58:07 +0000 |
commit | 2edcc52884f5ce28df261573ec87b876bc00f963 (patch) | |
tree | 443ba95a09b57b42a822c838daa3e5be9a8520fc | |
parent | feddb49ced2eb10328f9f3db52c950668472ffef (diff) |
Call log duration display for calls less than a minute.
Changing the call log details duration display to show only the seconds
if the elapsed duration is less than a minute.
Bug: 19383401
Change-Id: I8d39ca2c6c680e58602022250d4272d83024696d
-rw-r--r-- | res/values/strings.xml | 3 | ||||
-rw-r--r-- | src/com/android/dialer/calllog/CallDetailHistoryAdapter.java | 8 |
2 files changed, 8 insertions, 3 deletions
diff --git a/res/values/strings.xml b/res/values/strings.xml index 213d340dd..c661e5818 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -390,6 +390,9 @@ <!-- String used to display calls from pay phone in the call log --> <string name="payphone">Payphone</string> + <!-- A nicely formatted call duration displayed when viewing call details for duration less than 1 minute. For example "28 sec" --> + <string name="callDetailsShortDurationFormat"><xliff:g id="seconds" example="28">%s</xliff:g> sec</string> + <!-- A nicely formatted call duration displayed when viewing call details. For example "42 min 28 sec" --> <string name="callDetailsDurationFormat"><xliff:g id="minutes" example="42">%s</xliff:g> min <xliff:g id="seconds" example="28">%s</xliff:g> sec</string> diff --git a/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java b/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java index d53f77f8a..3b488a8ae 100644 --- a/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java +++ b/src/com/android/dialer/calllog/CallDetailHistoryAdapter.java @@ -153,10 +153,12 @@ public class CallDetailHistoryAdapter extends BaseAdapter { if (elapsedSeconds >= 60) { minutes = elapsedSeconds / 60; elapsedSeconds -= minutes * 60; + seconds = elapsedSeconds; + return mContext.getString(R.string.callDetailsDurationFormat, minutes, seconds); + } else { + seconds = elapsedSeconds; + return mContext.getString(R.string.callDetailsShortDurationFormat, seconds); } - seconds = elapsedSeconds; - - return mContext.getString(R.string.callDetailsDurationFormat, minutes, seconds); } /** |