summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/calllog/ui/menu
diff options
context:
space:
mode:
authorzachh <zachh@google.com>2018-01-11 13:43:45 -0800
committerCopybara-Service <copybara-piper@google.com>2018-01-11 14:22:45 -0800
commit5dd30438fd3e4384b57cef3c7606ec20fad9b50d (patch)
tree3d83b4073a473666c6915186598eddcf85b5f3e0 /java/com/android/dialer/calllog/ui/menu
parentc3490b2075833dc2a4205eae35f6ee404df49cc9 (diff)
Minor polish and bugfixes for new call log.
-Reuse the adapter in NewCallLogFragment to maintain position in call log when returning from call details -Convert empty values to null when invoking ContactPhotoManager to make photos appear correctly in new call log bottom sheets -Added CallLogContactTypes to be shared between proper call log and bottom sheets -Fixed vertical alignment in bottom sheet when there was no secondary text -Added some verbose logging Test: unit and manual PiperOrigin-RevId: 181655715 Change-Id: I9c1a42ad8d529ee2327e15fcc1d32b7b83982014
Diffstat (limited to 'java/com/android/dialer/calllog/ui/menu')
-rw-r--r--java/com/android/dialer/calllog/ui/menu/PrimaryAction.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/java/com/android/dialer/calllog/ui/menu/PrimaryAction.java b/java/com/android/dialer/calllog/ui/menu/PrimaryAction.java
index 404c41787..faedc8f62 100644
--- a/java/com/android/dialer/calllog/ui/menu/PrimaryAction.java
+++ b/java/com/android/dialer/calllog/ui/menu/PrimaryAction.java
@@ -19,16 +19,17 @@ package com.android.dialer.calllog.ui.menu;
import android.content.Context;
import android.provider.CallLog.Calls;
import com.android.dialer.calllog.model.CoalescedRow;
+import com.android.dialer.calllogutils.CallLogContactTypes;
import com.android.dialer.calllogutils.CallLogEntryText;
import com.android.dialer.calllogutils.CallLogIntents;
import com.android.dialer.contactactions.ContactPrimaryActionInfo;
import com.android.dialer.contactactions.ContactPrimaryActionInfo.PhotoInfo;
-import com.android.dialer.lettertile.LetterTileDrawable;
/** Configures the primary action row (top row) for the bottom sheet. */
final class PrimaryAction {
static ContactPrimaryActionInfo fromRow(Context context, CoalescedRow row) {
+ CharSequence primaryText = CallLogEntryText.buildPrimaryText(context, row);
return ContactPrimaryActionInfo.builder()
.setNumber(row.number())
.setPhotoInfo(
@@ -37,10 +38,10 @@ final class PrimaryAction {
.setPhotoUri(row.photoUri())
.setLookupUri(row.lookupUri())
.setIsVideo((row.features() & Calls.FEATURES_VIDEO) == Calls.FEATURES_VIDEO)
- .setContactType(LetterTileDrawable.TYPE_DEFAULT) // TODO(zachh): Use proper type.
- .setDisplayName(row.name())
+ .setContactType(CallLogContactTypes.getContactType(row))
+ .setDisplayName(primaryText.toString())
.build())
- .setPrimaryText(CallLogEntryText.buildPrimaryText(context, row))
+ .setPrimaryText(primaryText)
.setSecondaryText(CallLogEntryText.buildSecondaryTextForBottomSheet(context, row))
.setIntent(CallLogIntents.getCallBackIntent(context, row))
.build();