diff options
Diffstat (limited to 'java/com/android')
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 @@ <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> - <solid android:color="#42000000" /> + <gradient + android:startColor="#3333" + android:endColor="#0333" + android:type="linear" + android:angle="90"> + </gradient> </shape> 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 Binary files differindex 2e076c69a..48ab3c3c3 100644 --- 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 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"> <ImageView android:id="@+id/voicemail_image" android:layout_width="@dimen/voicemail_tos_image_size" android:layout_height="@dimen/voicemail_tos_image_size" android:layout_gravity="center" - android:paddingTop="24dp" - android:visibility="gone" + android:paddingBottom="32dp" android:importantForAccessibility="no"/> <TextView android:id="@+id/tos_message_title" - android:textStyle="bold" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingTop="24dp" - android:paddingBottom="12dp" + android:gravity="center_horizontal|top" + android:minHeight="20sp" android:text="@string/verizon_terms_and_conditions_title" - android:textColor="@color/primary_text_color" - android:textSize="@dimen/call_log_primary_text_size"/> + style="@style/TosTitleStyle"/> <TextView android:id="@+id/tos_message_details" android:layout_width="match_parent" android:layout_height="wrap_content" + android:paddingTop="16dp" android:paddingBottom="16dp" android:text="@string/verizon_terms_and_conditions_1.1_english" - android:textColor="@color/secondary_text_color" - android:textSize="@dimen/call_log_detail_text_size"/> + style="@style/TosTextStyle"/> </LinearLayout> </ScrollView> @@ -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"> <TextView android:id="@+id/voicemail_tos_button_decline" diff --git a/java/com/android/dialer/app/voicemail/error/res/values/dimens.xml b/java/com/android/dialer/app/voicemail/error/res/values/dimens.xml index 867bd2f8a..f40cc5f2b 100644 --- a/java/com/android/dialer/app/voicemail/error/res/values/dimens.xml +++ b/java/com/android/dialer/app/voicemail/error/res/values/dimens.xml @@ -30,5 +30,5 @@ <dimen name="voicemail_promo_card_title_text_size">16sp</dimen> <dimen name="voicemail_promo_card_message_size">14sp</dimen> - <dimen name="voicemail_tos_image_size">200dp</dimen> + <dimen name="voicemail_tos_image_size">280dp</dimen> </resources> 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 @@ <string name="vvm3_error_subscriber_blocked_title">Can\'t Connect to Your Voice Mailbox</string> <string name="vvm3_error_subscriber_blocked_message">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 <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9990."</string> - <string name="vvm3_error_unknown_user_title">Set Up Voice Mail</string> + <string name="vvm3_error_unknown_user_title">Set Up Voicemail</string> <string name="vvm3_error_unknown_user_message">Voicemail is not set up on your account. Please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9991.</string> - <string name="vvm3_error_unknown_device_title">Voice Mail</string> - <string name="vvm3_error_unknown_device_message">Visual Voicemail cannot be used on this device. Please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9992.</string> + <string name="vvm3_error_unknown_device_title">Voicemail</string> + <string name="vvm3_error_unknown_device_message">Visual voicemail cannot be used on this device. Please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9992.</string> <string name="vvm3_error_invalid_password_title">Something Went Wrong</string> <string name="vvm3_error_invalid_password_message">Please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9993.</string> - <string name="vvm3_error_mailbox_not_initialized_title">Visual Voice Mail</string> - <string name="vvm3_error_mailbox_not_initialized_message">To complete Visual Voicemail setup, please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9994.</string> + <string name="vvm3_error_mailbox_not_initialized_title">Visual voicemail</string> + <string name="vvm3_error_mailbox_not_initialized_message">To complete visual voicemail setup, please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9994.</string> - <string name="vvm3_error_service_not_provisioned_title">Visual Voice Mail</string> - <string name="vvm3_error_service_not_provisioned_message">To complete Visual Voicemail setup, please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9995.</string> + <string name="vvm3_error_service_not_provisioned_title">Visual voicemail</string> + <string name="vvm3_error_service_not_provisioned_message">To complete visual voicemail setup, please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9995.</string> - <string name="vvm3_error_service_not_activated_title">Visual Voice Mail</string> - <string name="vvm3_error_service_not_activated_message">To activate Visual Voice Mail, please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9996.</string> + <string name="vvm3_error_service_not_activated_title">Visual voicemail</string> + <string name="vvm3_error_service_not_activated_message">To activate visual voicemail, please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9996.</string> <string name="vvm3_error_user_blocked_title">Something Went Wrong</string> - <string name="vvm3_error_user_blocked_message">To complete Visual Voicemail setup, please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9998.</string> + <string name="vvm3_error_user_blocked_message">To complete visual voicemail setup, please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> and tell them the error code is 9998.</string> - <string name="vvm3_error_subscriber_unknown_title">Visual Voicemail is Disabled</string> + <string name="vvm3_error_subscriber_unknown_title">Visual voicemail is disabled</string> <string name="vvm3_error_subscriber_unknown_message">Please contact Customer Service at <xliff:g example="(555) 555-5555" id="number">%1$s</xliff:g> to activate visual voicemail.</string> <string name="vvm3_error_imap_getquota_error_title">Something Went Wrong</string> @@ -136,10 +136,10 @@ <string translatable="false" name="verizon_domestic_customer_support_number">+18009220204</string> <string translatable="false" name="verizon_domestic_customer_support_display_number">(800) 922–0204</string> - <string name="verizon_terms_and_conditions_title">Visual Voicemail Terms and Conditions</string> - <string name="verizon_terms_and_conditions_message">%1$s\n\nYou must accept Verizon Wireless\'s terms and conditions to use visual voicemail:\n\n%2$s</string> + <string name="verizon_terms_and_conditions_title">Turn on Visual Voice Mail</string> + <string name="verizon_terms_and_conditions_message">%1$s\n\nBy turning on Visual Voice Mail you agree to the Verizon Wireless terms and conditions:\n\n%2$s</string> - <string name="dialer_terms_and_conditions_title">Turn on Visual Voicemail</string> + <string name="dialer_terms_and_conditions_title">Turn on visual voicemail</string> <string name="dialer_terms_and_conditions_message">%s</string> <string translatable="false" name="verizon_terms_and_conditions_1.1_english"> @@ -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. </string> - <string translatable="false" name="dialer_terms_and_conditions_1.0_english"> - See and listen to your messages, without having to call voicemail.\nGet transcripts of your voicemail using Google’s transcription service. + <string name="dialer_terms_and_conditions_1.0"> + See and listen to your messages, without having to call voicemail. Transcripts of your voicemail are provided by Google’s free transcription service. %s </string> - <string translatable="false" name="dialer_terms_and_conditions_1.0_spanish"> - ***TRANSLATE TO SPANISH***\nSee and listen to your messages, without having to call voicemail.\nGet transcripts of your voicemail using Google’s transcription service. + <string name="dialer_terms_and_conditions_for_verizon_1.0"> + See and listen to your messages, without having to call voicemail. %s </string> + <string name="dialer_terms_and_conditions_learn_more">Learn more</string> + + <!-- TODO(mdooley): STOP SHIP, get real url, b/65734734 --> + <string translatable="false" name="dialer_terms_and_conditions_learn_more_url">https://www.google.com</string> + + <string translatable="false" name="verizon_terms_and_conditions_policy_url">http://www.verizon.com/about/privacy/policy/</string> + <string translatable="false" name="verizon_terms_and_conditions_accept_english">Turn On</string> <string translatable="false" name="verizon_terms_and_conditions_accept_spanish">Aceptar</string> <string translatable="false" name="verizon_terms_and_conditions_decline_english">No Thanks</string> 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 @@ <item name="android:paddingEnd">8dp</item> <item name="android:layout_marginStart">8dp</item> <item name="android:layout_marginEnd">8dp</item> - <item name="android:textColor">@color/dialer_secondary_text_color</item> + <item name="android:textColor">#80000000</item> <item name="android:fontFamily">"sans-serif-medium"</item> <item name="android:focusable">true</item> <item name="android:singleLine">true</item> @@ -54,4 +54,29 @@ <item name="android:textSize">14sp</item> <item name="android:layout_height">@dimen/call_log_action_height</item> </style> + + <style name="TosTitleStyle"> + <item name="android:textColor">@color/primary_text_color</item> + <item name="android:textSize">20sp</item> + <item name="android:fontFamily">"sans-serif-medium"</item> + </style> + + <style name="TosLinkStyle"> + <item name="android:textColor">@color/dialer_theme_color</item> + <item name="android:fontFamily">"sans-serif-medium"</item> + </style> + + <style name="TosTextStyle"> + <item name="android:textSize">16sp</item> + <item name="android:textColor">@color/dialer_primary_text_color</item> + <item name="android:fontFamily">"sans-serif-regular"</item> + <item name="android:lineSpacingExtra">8sp</item> + </style> + + <style name="TosDetailsTextStyle"> + <item name="android:textSize">12sp</item> + <item name="android:textColor">@color/dialer_secondary_text_color</item> + <item name="android:fontFamily">"sans-serif-regular"</item> + <item name="android:lineSpacingExtra">12sp</item> + </style> </resources> |