summaryrefslogtreecommitdiff
path: root/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java
diff options
context:
space:
mode:
authorEric Erfanian <erfanian@google.com>2017-10-24 14:05:52 -0700
committerEric Erfanian <erfanian@google.com>2017-10-24 14:05:52 -0700
commit938468da6f5c225ebb161a68bd949c9cf3261892 (patch)
tree232533fa35dc9d140fdfe0dac82b2bd21ad1b5c4 /java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java
parent958b292fc04ad15879fff47df929d6d1a826615c (diff)
Rename the new bubble package name from "bubble" to "newbubble".
It fixes AOSP for package name conflict. Test: manual PiperOrigin-RevId: 173298696 Change-Id: Id10ebe0bcf029e61f65cf6580c7198abd8395081
Diffstat (limited to 'java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java')
-rw-r--r--java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java25
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);
}