diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-05-18 22:15:19 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-05-18 22:15:19 +0000 |
commit | b327b63680f609125b80a3804445a8cf16e70fcb (patch) | |
tree | 201cfd29ae955524c29c7bc41738fff2a7c8d59e /java/com/android/dialer/voicemail/listui | |
parent | 619080d929b914e218bd32aa30287a67bf10551b (diff) | |
parent | 00cdd7b552b3fde4c9cbc1c4e4d0edc1b54df365 (diff) |
Merge "Remove duplicate code when constructing PhotoInfo proto."
Diffstat (limited to 'java/com/android/dialer/voicemail/listui')
-rw-r--r-- | java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java | 12 | ||||
-rw-r--r-- | java/com/android/dialer/voicemail/listui/menu/BottomSheetHeader.java | 7 |
2 files changed, 5 insertions, 14 deletions
diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java b/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java index c001c0059..ba851ebb9 100644 --- a/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java +++ b/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java @@ -36,7 +36,7 @@ import android.view.View.OnClickListener; import android.widget.ImageView; import android.widget.TextView; import com.android.dialer.calllog.database.contract.AnnotatedCallLogContract.AnnotatedCallLog; -import com.android.dialer.calllogutils.NumberAttributesConverter; +import com.android.dialer.calllogutils.PhotoInfoBuilder; import com.android.dialer.common.Assert; import com.android.dialer.common.LogUtil; import com.android.dialer.common.concurrent.DialerExecutor.SuccessListener; @@ -147,7 +147,8 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder implements On menuButton.setOnClickListener( NewVoicemailMenu.createOnClickListener(context, voicemailEntryOfViewHolder)); - setPhoto(voicemailEntryOfViewHolder); + contactPhotoView.setPhoto( + PhotoInfoBuilder.fromVoicemailEntry(voicemailEntryOfViewHolder).build()); // Update the expanded/collapsed state of this view holder // Only update the binding of the mediaPlayerView of the expanded view holder @@ -206,13 +207,6 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder implements On } } - private void setPhoto(VoicemailEntry voicemailEntry) { - contactPhotoView.setPhoto( - NumberAttributesConverter.toPhotoInfoBuilder(voicemailEntry.getNumberAttributes()) - .setFormattedNumber(voicemailEntry.getFormattedNumber()) - .build()); - } - void collapseViewHolder() { LogUtil.i( "NewVoicemailViewHolder.collapseViewHolder", diff --git a/java/com/android/dialer/voicemail/listui/menu/BottomSheetHeader.java b/java/com/android/dialer/voicemail/listui/menu/BottomSheetHeader.java index bf86278b2..deca7bd74 100644 --- a/java/com/android/dialer/voicemail/listui/menu/BottomSheetHeader.java +++ b/java/com/android/dialer/voicemail/listui/menu/BottomSheetHeader.java @@ -17,7 +17,7 @@ package com.android.dialer.voicemail.listui.menu; import android.text.TextUtils; -import com.android.dialer.calllogutils.NumberAttributesConverter; +import com.android.dialer.calllogutils.PhotoInfoBuilder; import com.android.dialer.historyitemactions.HistoryItemBottomSheetHeaderInfo; import com.android.dialer.voicemail.model.VoicemailEntry; @@ -27,10 +27,7 @@ final class BottomSheetHeader { static HistoryItemBottomSheetHeaderInfo fromVoicemailEntry(VoicemailEntry voicemailEntry) { return HistoryItemBottomSheetHeaderInfo.newBuilder() .setNumber(voicemailEntry.getNumber()) - .setPhotoInfo( - NumberAttributesConverter.toPhotoInfoBuilder(voicemailEntry.getNumberAttributes()) - .setFormattedNumber(voicemailEntry.getFormattedNumber()) - .build()) + .setPhotoInfo(PhotoInfoBuilder.fromVoicemailEntry(voicemailEntry)) .setPrimaryText(buildPrimaryVoicemailText(voicemailEntry)) .setSecondaryText(buildSecondaryVoicemailText(voicemailEntry)) .build(); |