diff options
author | Eric Erfanian <erfanian@google.com> | 2017-06-19 11:26:01 -0700 |
---|---|---|
committer | Eric Erfanian <erfanian@google.com> | 2017-06-19 11:30:45 -0700 |
commit | 2f1c7586bcce334ca69022eb8dc6d8965ceb6a05 (patch) | |
tree | bf00ada449ee3de31ec983a14e84159200aa18c2 /java/com/android/dialer/calldetails/CallDetailsHeaderViewHolder.java | |
parent | 3d0ca68e466482971a4cf46576c50cb2bd42bcb5 (diff) | |
download | android_packages_apps_Dialer-2f1c7586bcce334ca69022eb8dc6d8965ceb6a05.tar.gz android_packages_apps_Dialer-2f1c7586bcce334ca69022eb8dc6d8965ceb6a05.tar.bz2 android_packages_apps_Dialer-2f1c7586bcce334ca69022eb8dc6d8965ceb6a05.zip |
Update AOSP Dialer source from internal google3 repository at
cl/159428781.
Test: make, treehugger
This CL updates the AOSP Dialer source with all the changes that have
gone into the private google3 repository. This includes all the
changes from cl/152373142 (4/06/2017) to cl/159428781 (6/19/2017).
This goal of these drops is to keep the AOSP source in sync with the
internal google3 repository. Currently these sync are done by hand
with very minor modifications to the internal source code.
See the Android.mk file for list of modifications.
Our current goal is to do frequent drops (daily if possible) and
eventually switched to an automated process.
Change-Id: Ie60a84b3936efd0ea3d95d7c86bf96d2b1663030
Diffstat (limited to 'java/com/android/dialer/calldetails/CallDetailsHeaderViewHolder.java')
-rw-r--r-- | java/com/android/dialer/calldetails/CallDetailsHeaderViewHolder.java | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/java/com/android/dialer/calldetails/CallDetailsHeaderViewHolder.java b/java/com/android/dialer/calldetails/CallDetailsHeaderViewHolder.java index 4d9aacf7b..3df3c3aac 100644 --- a/java/com/android/dialer/calldetails/CallDetailsHeaderViewHolder.java +++ b/java/com/android/dialer/calldetails/CallDetailsHeaderViewHolder.java @@ -25,11 +25,12 @@ import android.view.View.OnClickListener; import android.widget.QuickContactBadge; import android.widget.TextView; import com.android.contacts.common.ContactPhotoManager; -import com.android.dialer.callcomposer.CallComposerContact; import com.android.dialer.callintent.CallInitiationType; import com.android.dialer.callintent.CallIntentBuilder; import com.android.dialer.common.Assert; +import com.android.dialer.dialercontact.DialerContact; import com.android.dialer.logging.DialerImpression; +import com.android.dialer.logging.InteractionEvent; import com.android.dialer.logging.Logger; import com.android.dialer.util.DialerUtils; @@ -40,23 +41,29 @@ public class CallDetailsHeaderViewHolder extends RecyclerView.ViewHolder private final View callBackButton; private final TextView nameView; private final TextView numberView; + private final TextView networkView; private final QuickContactBadge contactPhoto; private final Context context; - private CallComposerContact contact; + private DialerContact contact; CallDetailsHeaderViewHolder(View container) { super(container); context = container.getContext(); callBackButton = container.findViewById(R.id.call_back_button); - nameView = (TextView) container.findViewById(R.id.contact_name); - numberView = (TextView) container.findViewById(R.id.phone_number); - contactPhoto = (QuickContactBadge) container.findViewById(R.id.quick_contact_photo); + nameView = container.findViewById(R.id.contact_name); + numberView = container.findViewById(R.id.phone_number); + networkView = container.findViewById(R.id.network); + contactPhoto = container.findViewById(R.id.quick_contact_photo); + callBackButton.setOnClickListener(this); + Logger.get(context) + .logQuickContactOnTouch( + contactPhoto, InteractionEvent.Type.OPEN_QUICK_CONTACT_FROM_CALL_DETAILS, true); } /** Populates the contact info fields based on the current contact information. */ - void updateContactInfo(CallComposerContact contact) { + void updateContactInfo(DialerContact contact) { this.contact = contact; ContactPhotoManager.getInstance(context) .loadDialerThumbnailOrPhoto( @@ -67,8 +74,6 @@ public class CallDetailsHeaderViewHolder extends RecyclerView.ViewHolder contact.getNameOrNumber(), contact.getContactType()); - contactPhoto.setContentDescription( - context.getString(R.string.description_contact_photo_details, contact.getNameOrNumber())); nameView.setText(contact.getNameOrNumber()); if (!TextUtils.isEmpty(contact.getDisplayNumber())) { numberView.setVisibility(View.VISIBLE); @@ -85,6 +90,12 @@ public class CallDetailsHeaderViewHolder extends RecyclerView.ViewHolder numberView.setText(null); } + if (!TextUtils.isEmpty(contact.getSimDetails().getNetwork())) { + networkView.setVisibility(View.VISIBLE); + networkView.setText(contact.getSimDetails().getNetwork()); + networkView.setTextColor(context.getResources().getColor(contact.getSimDetails().getColor())); + } + if (TextUtils.isEmpty(contact.getNumber())) { callBackButton.setVisibility(View.GONE); } @@ -98,7 +109,7 @@ public class CallDetailsHeaderViewHolder extends RecyclerView.ViewHolder view.getContext(), new CallIntentBuilder(contact.getNumber(), CallInitiationType.Type.CALL_DETAILS).build()); } else { - Assert.fail("View OnClickListener not implemented: " + view); + throw Assert.createIllegalStateFailException("View OnClickListener not implemented: " + view); } } } |