summaryrefslogtreecommitdiffstats
path: root/java/com/android/dialer/voicemail
diff options
context:
space:
mode:
authoruabdullah <uabdullah@google.com>2018-02-02 15:28:40 -0800
committerCopybara-Service <copybara-piper@google.com>2018-02-02 17:26:53 -0800
commitae8144b6905143e0a8e5a6920b6ed8f60cf8b00e (patch)
tree4e074f9dac2f695e9c87b8144b00e44589a5e7c4 /java/com/android/dialer/voicemail
parent4144a8fa37856a339c52f0fa52246b88755656ad (diff)
downloadandroid_packages_apps_Dialer-ae8144b6905143e0a8e5a6920b6ed8f60cf8b00e.tar.gz
android_packages_apps_Dialer-ae8144b6905143e0a8e5a6920b6ed8f60cf8b00e.tar.bz2
android_packages_apps_Dialer-ae8144b6905143e0a8e5a6920b6ed8f60cf8b00e.zip
NUI VM Transcribed by Google UI Support
Shows the "Transcribed by Google" logo for voicemails transcribed by Google Bug: 72491920 Test: Unit Tests PiperOrigin-RevId: 184343786 Change-Id: I9d662860e218ff555c65f667f4ee15015df47ab2
Diffstat (limited to 'java/com/android/dialer/voicemail')
-rw-r--r--java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java16
-rw-r--r--java/com/android/dialer/voicemail/listui/res/layout/new_voicemail_entry.xml10
-rw-r--r--java/com/android/dialer/voicemail/listui/res/values/strings.xml3
3 files changed, 29 insertions, 0 deletions
diff --git a/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java b/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java
index 71c98031a..b0c07df66 100644
--- a/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java
+++ b/java/com/android/dialer/voicemail/listui/NewVoicemailViewHolder.java
@@ -43,6 +43,7 @@ import com.android.dialer.common.LogUtil;
import com.android.dialer.common.concurrent.DialerExecutor.SuccessListener;
import com.android.dialer.common.concurrent.DialerExecutor.Worker;
import com.android.dialer.common.concurrent.DialerExecutorComponent;
+import com.android.dialer.compat.android.provider.VoicemailCompat;
import com.android.dialer.contactphoto.ContactPhotoManager;
import com.android.dialer.contactphoto.NumberAttributeConverter;
import com.android.dialer.lettertile.LetterTileDrawable;
@@ -58,6 +59,7 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder implements On
private final TextView primaryTextView;
private final TextView secondaryTextView;
private final TextView transcriptionTextView;
+ private final TextView transcriptionBrandingTextView;
private final QuickContactBadge quickContactBadge;
private final NewVoicemailMediaPlayerView mediaPlayerView;
private final ImageView menuButton;
@@ -76,6 +78,7 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder implements On
primaryTextView = view.findViewById(R.id.primary_text);
secondaryTextView = view.findViewById(R.id.secondary_text);
transcriptionTextView = view.findViewById(R.id.transcription_text);
+ transcriptionBrandingTextView = view.findViewById(R.id.transcription_branding);
quickContactBadge = view.findViewById(R.id.quick_contact_photo);
mediaPlayerView = view.findViewById(R.id.new_voicemail_media_player);
menuButton = view.findViewById(R.id.menu_button);
@@ -226,6 +229,7 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder implements On
String.valueOf(mediaPlayerView.getVoicemailUri()),
String.valueOf(viewHolderVoicemailUri));
transcriptionTextView.setMaxLines(1);
+ transcriptionBrandingTextView.setVisibility(GONE);
isViewHolderExpanded = false;
mediaPlayerView.reset();
@@ -251,6 +255,8 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder implements On
secondaryTextView.setTypeface(null, Typeface.NORMAL);
transcriptionTextView.setTypeface(null, Typeface.NORMAL);
+ transcriptionBrandingTextView.setVisibility(GONE);
+
mediaPlayerView.reset();
LogUtil.i(
@@ -319,6 +325,7 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder implements On
transcriptionTextView.setMaxLines(999);
isViewHolderExpanded = true;
+ updateBrandingText(voicemailEntry);
// Once the media player is visible update its state
mediaPlayerView.setVisibility(View.VISIBLE);
mediaPlayerView.bindValuesFromAdapterOfExpandedViewHolderMediaPlayerView(
@@ -333,6 +340,15 @@ final class NewVoicemailViewHolder extends RecyclerView.ViewHolder implements On
String.valueOf(mediaPlayerView.getVoicemailUri()));
}
+ private void updateBrandingText(VoicemailEntry voicemailEntry) {
+ if (voicemailEntry.transcriptionState() == VoicemailCompat.TRANSCRIPTION_AVAILABLE
+ && !TextUtils.isEmpty(voicemailEntry.transcription())) {
+ transcriptionBrandingTextView.setVisibility(VISIBLE);
+ } else {
+ transcriptionBrandingTextView.setVisibility(GONE);
+ }
+ }
+
@WorkerThread
private Integer markVoicemailAsRead(Pair<Context, Uri> contextUriPair) {
Assert.isWorkerThread();
diff --git a/java/com/android/dialer/voicemail/listui/res/layout/new_voicemail_entry.xml b/java/com/android/dialer/voicemail/listui/res/layout/new_voicemail_entry.xml
index 95769fe32..6900627dd 100644
--- a/java/com/android/dialer/voicemail/listui/res/layout/new_voicemail_entry.xml
+++ b/java/com/android/dialer/voicemail/listui/res/layout/new_voicemail_entry.xml
@@ -82,6 +82,16 @@
android:layout_gravity="center_vertical"
android:visibility="gone"/>
+ <TextView
+ android:id="@+id/transcription_branding"
+ style="@style/SecondaryText"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_marginStart="@dimen/call_log_entry_photo_text_margin"
+ android:layout_gravity="center_vertical"
+ android:text="@string/voicemail_transcription_branding_text"
+ android:visibility="gone"/>
+
<com.android.dialer.voicemail.listui.NewVoicemailMediaPlayerView
android:id="@+id/new_voicemail_media_player"
android:layout_width="match_parent"
diff --git a/java/com/android/dialer/voicemail/listui/res/values/strings.xml b/java/com/android/dialer/voicemail/listui/res/values/strings.xml
index e7373d69f..db33c1909 100644
--- a/java/com/android/dialer/voicemail/listui/res/values/strings.xml
+++ b/java/com/android/dialer/voicemail/listui/res/values/strings.xml
@@ -54,4 +54,7 @@ If you do not accept all of these terms and conditions, do not use Visual Voice
<string translatable="false" name="verizon_terms_and_conditions_accept_english">Turn On</string>
+ <!-- Label indicating who provided the voicemail transcription [CHAR LIMIT=64] -->
+ <string name="voicemail_transcription_branding_text">Transcribed by Google</string>
+
</resources>