diff options
author | zachh <zachh@google.com> | 2018-03-30 17:12:55 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-30 17:14:03 -0700 |
commit | 07206e2c106eec909fd38c16a66957a5e00372de (patch) | |
tree | fef38ad919265f8179b14ae01fdb6023e6024429 /java/com/android/dialer/calllog/ui | |
parent | f6be61727fba9b0fdac3b9d69588e4467f861552 (diff) |
Use IS_READ instead of NEW in new call log.
We want to be more consistent with other usages of NEW in the app, i.e. NEW should be used primarily by notifications.
Bug: 74821515
Test: unit
PiperOrigin-RevId: 191139559
Change-Id: Ib6fbead8b5589aedd881db26a07f7daed4d83543
Diffstat (limited to 'java/com/android/dialer/calllog/ui')
3 files changed, 17 insertions, 16 deletions
diff --git a/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java b/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java index 1f84ebfdf..217208d17 100644 --- a/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java +++ b/java/com/android/dialer/calllog/ui/NewCallLogViewHolder.java @@ -109,11 +109,11 @@ final class NewCallLogViewHolder extends RecyclerView.ViewHolder { primaryTextView.setText(CallLogEntryText.buildPrimaryText(context, row)); secondaryTextView.setText(CallLogEntryText.buildSecondaryTextForEntries(context, clock, row)); - if (isNewMissedCall(row)) { - primaryTextView.setTextAppearance(R.style.primary_textview_new_call); - callCountTextView.setTextAppearance(R.style.primary_textview_new_call); - secondaryTextView.setTextAppearance(R.style.secondary_textview_new_call); - phoneAccountView.setTextAppearance(R.style.phoneaccount_textview_new_call); + if (isUnreadMissedCall(row)) { + primaryTextView.setTextAppearance(R.style.primary_textview_unread_call); + callCountTextView.setTextAppearance(R.style.primary_textview_unread_call); + secondaryTextView.setTextAppearance(R.style.secondary_textview_unread_call); + phoneAccountView.setTextAppearance(R.style.phoneaccount_textview_unread_call); } else { primaryTextView.setTextAppearance(R.style.primary_textview); callCountTextView.setTextAppearance(R.style.primary_textview); @@ -140,10 +140,11 @@ final class NewCallLogViewHolder extends RecyclerView.ViewHolder { } } - private boolean isNewMissedCall(CoalescedRow row) { + private boolean isUnreadMissedCall(CoalescedRow row) { // Show missed call styling if the most recent call in the group was missed and it is still - // marked as NEW. It is not clear what IS_READ should be used for and it is currently not used. - return row.getCallType() == Calls.MISSED_TYPE && row.getIsNew(); + // marked as not read. The "NEW" column is presumably used for notifications and voicemails + // only. + return row.getCallType() == Calls.MISSED_TYPE && !row.getIsRead(); } private void setPhoto(CoalescedRow row) { @@ -159,7 +160,7 @@ final class NewCallLogViewHolder extends RecyclerView.ViewHolder { ColorStateList colorStateList = ColorStateList.valueOf( context.getColor( - isNewMissedCall(row) + isUnreadMissedCall(row) ? R.color.feature_icon_unread_color : R.color.feature_icon_read_color)); @@ -217,7 +218,7 @@ final class NewCallLogViewHolder extends RecyclerView.ViewHolder { } callTypeIcon.setImageResource(resId); - if (isNewMissedCall(row)) { + if (isUnreadMissedCall(row)) { callTypeIcon.setImageTintList( ColorStateList.valueOf(context.getColor(R.color.call_type_icon_unread_color))); } else { diff --git a/java/com/android/dialer/calllog/ui/menu/NewCallLogMenu.java b/java/com/android/dialer/calllog/ui/menu/NewCallLogMenu.java index dabb9bbe4..3869e78c3 100644 --- a/java/com/android/dialer/calllog/ui/menu/NewCallLogMenu.java +++ b/java/com/android/dialer/calllog/ui/menu/NewCallLogMenu.java @@ -35,9 +35,9 @@ public final class NewCallLogMenu { HistoryItemActionBottomSheet.show( context, BottomSheetHeader.fromRow(context, row), Modules.fromRow(context, row)); - // If the user opens the bottom sheet for a new call, clear the notifications and make the row - // not bold immediately. To do this, mark all of the calls in group as not new. - if (row.getIsNew() && row.getCallType() == Calls.MISSED_TYPE) { + // If the user opens the bottom sheet for an unread call, clear the notifications and make the + // row not bold immediately. To do this, mark all of the calls in group as read. + if (!row.getIsRead() && row.getCallType() == Calls.MISSED_TYPE) { Futures.addCallback( CallLogComponent.get(context) .getClearMissedCalls() diff --git a/java/com/android/dialer/calllog/ui/res/values/styles.xml b/java/com/android/dialer/calllog/ui/res/values/styles.xml index d521feed4..047f1dace 100644 --- a/java/com/android/dialer/calllog/ui/res/values/styles.xml +++ b/java/com/android/dialer/calllog/ui/res/values/styles.xml @@ -21,7 +21,7 @@ <item name="android:fontFamily">sans-serif</item> </style> - <style name="primary_textview_new_call"> + <style name="primary_textview_unread_call"> <item name="android:textColor">@color/primary_text_color</item> <item name="android:fontFamily">sans-serif-medium</item> </style> @@ -35,12 +35,12 @@ <item name="android:fontFamily">sans-serif</item> </style> - <style name="secondary_textview_new_call"> + <style name="secondary_textview_unread_call"> <item name="android:textColor">@color/missed_call</item> <item name="android:fontFamily">sans-serif-medium</item> </style> - <style name="phoneaccount_textview_new_call"> + <style name="phoneaccount_textview_unread_call"> <item name="android:fontFamily">sans-serif-medium</item> </style> |