From 1bd727efdd4cb6c3651ddbe86f4ec8ce826ac419 Mon Sep 17 00:00:00 2001 From: mdooley Date: Fri, 15 Sep 2017 10:22:21 -0700 Subject: Updating voicemail TOS UI to match mocks verizon TOS screen shot 1: https://drive.google.com/open?id=0B9o_KvtLkcuIU3VpLUpqcXBUYy1QY19UUk81a29sdGQyNEZZ verizon TOS screen shot 2: https://drive.google.com/open?id=0B9o_KvtLkcuIN3R6SUFjS3RVTWhZQUM1UzhoajhNUF9ZbzJJ non-verizon TOS screen shot: https://drive.google.com/open?id=0B9o_KvtLkcuIeVFYaWhYZmRzYVctU2F6N1VqazcycGpmNmRZ Bug: 37340510 Test: manual and update unit test PiperOrigin-RevId: 168851805 Change-Id: I7be27360093cae315b7249152e10d1beae5c5966 --- .../app/voicemail/error/VoicemailErrorAlert.java | 4 +- .../error/VoicemailTosMessageCreator.java | 77 +++++++++++++++------ .../app/voicemail/error/res/drawable/shadow.xml | 7 +- .../error/res/drawable/voicemail_tos_image.png | Bin 43527 -> 14695 bytes .../error/res/layout/voicemail_tos_fragment.xml | 22 +++--- .../app/voicemail/error/res/values/dimens.xml | 2 +- .../app/voicemail/error/res/values/strings.xml | 47 +++++++------ .../app/voicemail/error/res/values/styles.xml | 27 +++++++- 8 files changed, 129 insertions(+), 57 deletions(-) diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java b/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java index dbdf0f067..7d6665de6 100644 --- a/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java +++ b/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java @@ -18,7 +18,7 @@ package com.android.dialer.app.voicemail.error; import android.content.Context; import android.support.annotation.VisibleForTesting; -import android.text.util.Linkify; +import android.text.method.LinkMovementMethod; import android.view.View; import android.widget.ImageView; import android.widget.TextView; @@ -121,8 +121,8 @@ public class VoicemailErrorAlert { TextView tosTitle = (TextView) view.findViewById(R.id.tos_message_title); tosTitle.setText(message.getTitle()); TextView tosDetails = (TextView) view.findViewById(R.id.tos_message_details); - tosDetails.setAutoLinkMask(Linkify.WEB_URLS); tosDetails.setText(message.getDescription()); + tosDetails.setMovementMethod(LinkMovementMethod.getInstance()); Assert.checkArgument(message.getActions().size() == 2); Action primaryAction = message.getActions().get(0); diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java index 53f4680d2..9b3bbd08e 100644 --- a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java +++ b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java @@ -22,13 +22,17 @@ import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; -import android.graphics.Typeface; import android.preference.PreferenceManager; import android.support.annotation.Nullable; import android.telecom.PhoneAccountHandle; import android.telephony.TelephonyManager; +import android.text.Layout; import android.text.SpannableString; -import android.text.style.StyleSpan; +import android.text.Spanned; +import android.text.TextUtils; +import android.text.style.AlignmentSpan; +import android.text.style.TextAppearanceSpan; +import android.text.style.URLSpan; import android.view.View; import android.view.View.OnClickListener; import com.android.dialer.app.voicemail.error.VoicemailErrorMessage.Action; @@ -76,7 +80,6 @@ public class VoicemailTosMessageCreator { @Nullable VoicemailErrorMessage maybeCreateTosMessage() { - // TODO(mdooley): add filtering based on carrier if (hasAcceptedTos()) { return null; } @@ -117,7 +120,7 @@ public class VoicemailTosMessageCreator { }, true /* raised */)) .setModal(true) - .setImageResourceId(getTosImageId()); + .setImageResourceId(R.drawable.voicemail_tos_image); } private boolean shouldShowTos() { @@ -263,9 +266,10 @@ public class VoicemailTosMessageCreator { } private CharSequence getVvm3Tos() { + String policyUrl = context.getString(R.string.verizon_terms_and_conditions_policy_url); return useSpanish() - ? context.getString(R.string.verizon_terms_and_conditions_1_1_spanish) - : context.getString(R.string.verizon_terms_and_conditions_1_1_english); + ? context.getString(R.string.verizon_terms_and_conditions_1_1_spanish, policyUrl) + : context.getString(R.string.verizon_terms_and_conditions_1_1_english, policyUrl); } private CharSequence getDialerTos() { @@ -273,9 +277,10 @@ public class VoicemailTosMessageCreator { return ""; } - return useSpanish() - ? context.getString(R.string.dialer_terms_and_conditions_1_0_spanish) - : context.getString(R.string.dialer_terms_and_conditions_1_0_english); + String learnMoreText = context.getString(R.string.dialer_terms_and_conditions_learn_more); + return isVvm3() + ? context.getString(R.string.dialer_terms_and_conditions_for_verizon_1_0, learnMoreText) + : context.getString(R.string.dialer_terms_and_conditions_1_0, learnMoreText); } private CharSequence getAcceptText() { @@ -309,6 +314,7 @@ public class VoicemailTosMessageCreator { } private CharSequence getTosMessage() { + SpannableString spannableTos; if (isVvm3()) { // For verizon the TOS consist of three pieces: google dialer TOS, Verizon TOS message and // Verizon TOS details. @@ -316,18 +322,51 @@ public class VoicemailTosMessageCreator { CharSequence tos = context.getString( R.string.verizon_terms_and_conditions_message, getDialerTos(), vvm3Details); - // Make all text bold except the details. - SpannableString spannableTos = new SpannableString(tos); - spannableTos.setSpan(new StyleSpan(Typeface.BOLD), 0, tos.length() - vvm3Details.length(), 0); - return spannableTos; + spannableTos = new SpannableString(tos); + // Set the text style for the details part of the TOS + int start = spannableTos.length() - vvm3Details.length(); + spannableTos.setSpan( + new TextAppearanceSpan(context, R.style.TosDetailsTextStyle), + start, + start + vvm3Details.length(), + Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + // Add verizon policy link + String linkUrl = context.getString(R.string.verizon_terms_and_conditions_policy_url); + addLink(spannableTos, linkUrl, linkUrl); } else { - // The TOS for everyone else there are no details, so just make everything bold. + // The TOS for everyone else, there are no details, but change to center alignment. CharSequence tos = context.getString(R.string.dialer_terms_and_conditions_message, getDialerTos()); - SpannableString spannableTos = new SpannableString(tos); - spannableTos.setSpan(new StyleSpan(Typeface.BOLD), 0, tos.length(), 0); - return spannableTos; + spannableTos = new SpannableString(tos); + spannableTos.setSpan( + new AlignmentSpan.Standard(Layout.Alignment.ALIGN_CENTER), + 0, + tos.length(), + Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + } + + // Add 'Learn more' link for dialer TOS + String learnMore = context.getString(R.string.dialer_terms_and_conditions_learn_more); + String linkUrl = context.getString(R.string.dialer_terms_and_conditions_learn_more_url); + return addLink(spannableTos, learnMore, linkUrl); + } + + private SpannableString addLink(SpannableString spannable, String linkText, String linkUrl) { + if (TextUtils.isEmpty(linkUrl) || TextUtils.isEmpty(linkText)) { + return spannable; + } + + int start = spannable.toString().indexOf(linkText); + if (start != -1) { + int end = start + linkText.length(); + spannable.setSpan(new URLSpan(linkUrl), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); + spannable.setSpan( + new TextAppearanceSpan(context, R.style.TosLinkStyle), + start, + end, + Spanned.SPAN_EXCLUSIVE_EXCLUSIVE); } + return spannable; } private int getTosDeclinedDialogMessageId() { @@ -341,8 +380,4 @@ public class VoicemailTosMessageCreator { ? R.string.verizon_terms_and_conditions_decline_dialog_downgrade : R.string.dialer_terms_and_conditions_decline_dialog_downgrade; } - - private Integer getTosImageId() { - return isVvm3() ? null : R.drawable.voicemail_tos_image; - } } diff --git a/java/com/android/dialer/app/voicemail/error/res/drawable/shadow.xml b/java/com/android/dialer/app/voicemail/error/res/drawable/shadow.xml index 681c795f5..925c8d290 100644 --- a/java/com/android/dialer/app/voicemail/error/res/drawable/shadow.xml +++ b/java/com/android/dialer/app/voicemail/error/res/drawable/shadow.xml @@ -16,5 +16,10 @@ - + + diff --git a/java/com/android/dialer/app/voicemail/error/res/drawable/voicemail_tos_image.png b/java/com/android/dialer/app/voicemail/error/res/drawable/voicemail_tos_image.png index 2e076c69a..48ab3c3c3 100644 Binary files a/java/com/android/dialer/app/voicemail/error/res/drawable/voicemail_tos_image.png and b/java/com/android/dialer/app/voicemail/error/res/drawable/voicemail_tos_image.png differ diff --git a/java/com/android/dialer/app/voicemail/error/res/layout/voicemail_tos_fragment.xml b/java/com/android/dialer/app/voicemail/error/res/layout/voicemail_tos_fragment.xml index ec8abed6d..184a81fec 100644 --- a/java/com/android/dialer/app/voicemail/error/res/layout/voicemail_tos_fragment.xml +++ b/java/com/android/dialer/app/voicemail/error/res/layout/voicemail_tos_fragment.xml @@ -29,33 +29,31 @@ android:layout_height="wrap_content" android:paddingLeft="16dp" android:paddingRight="16dp" + android:paddingTop="32dp" android:orientation="vertical"> + style="@style/TosTitleStyle"/> + style="@style/TosTextStyle"/> @@ -69,10 +67,12 @@ android:id="@+id/voicemail_tos_button" android:layout_width="match_parent" android:layout_height="wrap_content" + android:gravity="center_vertical" + android:minHeight="56dp" android:paddingStart="16dp" android:paddingEnd="16dp" - android:paddingTop="20dp" - android:paddingBottom="20dp" + android:paddingTop="10dp" + android:paddingBottom="10dp" android:orientation="horizontal"> 16sp 14sp - 200dp + 280dp diff --git a/java/com/android/dialer/app/voicemail/error/res/values/strings.xml b/java/com/android/dialer/app/voicemail/error/res/values/strings.xml index 2f6a720db..3917cf8a2 100644 --- a/java/com/android/dialer/app/voicemail/error/res/values/strings.xml +++ b/java/com/android/dialer/app/voicemail/error/res/values/strings.xml @@ -100,28 +100,28 @@ Can\'t Connect to Your Voice Mailbox Sorry, we\'re not able to connect to your voice mailbox at this time. Please try again later. If there is still a problem, please contact Customer Service at %1$s and tell them the error code is 9990." - Set Up Voice Mail + Set Up Voicemail Voicemail is not set up on your account. Please contact Customer Service at %1$s and tell them the error code is 9991. - Voice Mail - Visual Voicemail cannot be used on this device. Please contact Customer Service at %1$s and tell them the error code is 9992. + Voicemail + Visual voicemail cannot be used on this device. Please contact Customer Service at %1$s and tell them the error code is 9992. Something Went Wrong Please contact Customer Service at %1$s and tell them the error code is 9993. - Visual Voice Mail - To complete Visual Voicemail setup, please contact Customer Service at %1$s and tell them the error code is 9994. + Visual voicemail + To complete visual voicemail setup, please contact Customer Service at %1$s and tell them the error code is 9994. - Visual Voice Mail - To complete Visual Voicemail setup, please contact Customer Service at %1$s and tell them the error code is 9995. + Visual voicemail + To complete visual voicemail setup, please contact Customer Service at %1$s and tell them the error code is 9995. - Visual Voice Mail - To activate Visual Voice Mail, please contact Customer Service at %1$s and tell them the error code is 9996. + Visual voicemail + To activate visual voicemail, please contact Customer Service at %1$s and tell them the error code is 9996. Something Went Wrong - To complete Visual Voicemail setup, please contact Customer Service at %1$s and tell them the error code is 9998. + To complete visual voicemail setup, please contact Customer Service at %1$s and tell them the error code is 9998. - Visual Voicemail is Disabled + Visual voicemail is disabled Please contact Customer Service at %1$s to activate visual voicemail. Something Went Wrong @@ -136,10 +136,10 @@ +18009220204 (800) 922–0204 - Visual Voicemail Terms and Conditions - %1$s\n\nYou must accept Verizon Wireless\'s terms and conditions to use visual voicemail:\n\n%2$s + Turn on Visual Voice Mail + %1$s\n\nBy turning on Visual Voice Mail you agree to the Verizon Wireless terms and conditions:\n\n%2$s - Turn on Visual Voicemail + Turn on visual voicemail %s @@ -149,7 +149,7 @@ You may disable VVM in settings. This will revert you to basic voice mail. In so \n For the Premium Visual Voice Mail service, some voice messages may not be completely transcribed; incomplete messages will end with [...]. Only the first 45 seconds of each voice message will be transcribed, so for longer messages, you will need to listen to the voice message itself. Any profane or offensive language also will not be transcribed and will appear as [...] in the transcription.\n \n -Speech recordings may be collected and stored for a period of 30 days, solely for the purpose of testing and improving transcription technology and performance, subject to the Verizon Wireless Privacy Policy, which can be found at http://www.verizon.com/about/privacy/policy/\n +Speech recordings may be collected and stored for a period of 30 days, solely for the purpose of testing and improving transcription technology and performance, subject to the Verizon Wireless Privacy Policy, which can be found at %s\n \n You understand that by selecting ACCEPT, your messages will be stored and anyone in possession of this device will have access to your voice mail. You further understand that your voice mail messages may be stored in electronic format on this device. To limit unauthorized access to your voice mail, you should consider locking your phone when not in use. Not available in all areas or over Wi\u2011Fi.\n \n @@ -162,21 +162,28 @@ Puede inhabilitar el VVM en la configuración. Esto le permite volver al buzón \n En el caso del servicio de buzón de voz visual premium, es posible que algunos mensajes no se transcriban totalmente; los mensajes incompletos finalizan con "[…]". Solo se transcriben los primeros 45 segundos de cada mensaje de voz, por lo que debe escuchar los mensajes de voz más largos. Tampoco se transcribe ninguna palabra ofensiva o profana; aparece como "[…]" en la transcripción.\n \n -Es posible que reunamos y almacenemos grabaciones de voz durante 30 días, con el único fin de probar y mejorar el rendimiento y la tecnología de la transcripción, sujeto a la Política de privacidad de Verizon Wireless, disponible en http://www.verizon.com/about/privacy/policy/.\n +Es posible que reunamos y almacenemos grabaciones de voz durante 30 días, con el único fin de probar y mejorar el rendimiento y la tecnología de la transcripción, sujeto a la Política de privacidad de Verizon Wireless, disponible en %s\n \n Entiende que, al seleccionar ACEPTAR, sus mensajes se almacenarán, y cualquier persona que disponga de este dispositivo tendrá acceso al buzón de voz. Entiende, además, que los mensajes de voz pueden almacenarse en formato electrónico en este dispositivo. Para limitar el acceso no autorizado al buzón de voz, debe considerar el bloqueo del teléfono cuando no está en uso. No está disponible en todas las áreas ni mediante Wi\u2011Fi.\n \n Si no acepta todos estos términos y condiciones, no use el buzón de voz visual. - - See and listen to your messages, without having to call voicemail.\nGet transcripts of your voicemail using Google’s transcription service. + + See and listen to your messages, without having to call voicemail. Transcripts of your voicemail are provided by Google’s free transcription service. %s - - ***TRANSLATE TO SPANISH***\nSee and listen to your messages, without having to call voicemail.\nGet transcripts of your voicemail using Google’s transcription service. + + See and listen to your messages, without having to call voicemail. %s + Learn more + + + https://www.google.com + + http://www.verizon.com/about/privacy/policy/ + Turn On Aceptar No Thanks diff --git a/java/com/android/dialer/app/voicemail/error/res/values/styles.xml b/java/com/android/dialer/app/voicemail/error/res/values/styles.xml index 257e93d1b..938c77a01 100644 --- a/java/com/android/dialer/app/voicemail/error/res/values/styles.xml +++ b/java/com/android/dialer/app/voicemail/error/res/values/styles.xml @@ -40,7 +40,7 @@ 8dp 8dp 8dp - @color/dialer_secondary_text_color + #80000000 "sans-serif-medium" true true @@ -54,4 +54,29 @@ 14sp @dimen/call_log_action_height + + + + + + + + -- cgit v1.2.3