diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-10-24 22:41:00 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-10-24 22:41:00 +0000 |
commit | daa1c44c00f3c598223639c9b80a52cf41db51ba (patch) | |
tree | e4c88a1862b157dc858abe73e52b077bf7b96948 /java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java | |
parent | ef7338cf787301c573fde8129bf8880d7faba040 (diff) | |
parent | 938468da6f5c225ebb161a68bd949c9cf3261892 (diff) |
Merge "Rename the new bubble package name from "bubble" to "newbubble"."
Diffstat (limited to 'java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java')
-rw-r--r-- | java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java b/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java index daa24c86c..8016563ce 100644 --- a/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java +++ b/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java @@ -19,11 +19,13 @@ import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.support.v7.widget.RecyclerView; +import android.text.TextUtils; import android.view.View; import android.widget.QuickContactBadge; import android.widget.TextView; import com.android.dialer.contactphoto.ContactPhotoManager; import com.android.dialer.lettertile.LetterTileDrawable; +import com.android.dialer.time.Clock; import com.android.dialer.voicemail.model.VoicemailEntry; /** {@link RecyclerView.ViewHolder} for the new voicemail tab. */ @@ -31,18 +33,37 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder { private final Context context; private final TextView primaryTextView; + private final TextView secondaryTextView; + private final TextView transcriptionTextView; private final QuickContactBadge quickContactBadge; + private final Clock clock; - NewVoicemailViewHolder(View view) { + NewVoicemailViewHolder(View view, Clock clock) { super(view); this.context = view.getContext(); - primaryTextView = (TextView) view.findViewById(R.id.primary_text); + primaryTextView = view.findViewById(R.id.primary_text); + secondaryTextView = view.findViewById(R.id.secondary_text); + transcriptionTextView = view.findViewById(R.id.transcription_text); quickContactBadge = view.findViewById(R.id.quick_contact_photo); + this.clock = clock; } void bind(Cursor cursor) { VoicemailEntry voicemailEntry = VoicemailCursorLoader.toVoicemailEntry(cursor); primaryTextView.setText(VoicemailEntryText.buildPrimaryVoicemailText(context, voicemailEntry)); + secondaryTextView.setText( + VoicemailEntryText.buildSecondaryVoicemailText(context, clock, voicemailEntry)); + + String voicemailTranscription = voicemailEntry.transcription(); + + if (TextUtils.isEmpty(voicemailTranscription)) { + transcriptionTextView.setVisibility(View.GONE); + transcriptionTextView.setText(null); + } else { + transcriptionTextView.setVisibility(View.VISIBLE); + transcriptionTextView.setText(voicemailTranscription); + } + setPhoto(voicemailEntry); } |