From 059d2e2a9ef121edfbd0596cf0f8c22b167a7b8d Mon Sep 17 00:00:00 2001 From: mdooley Date: Fri, 23 Jun 2017 15:51:08 -0700 Subject: Tweaks to the voicemail TOS UI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • moved scrollbar to edge of screen • changed divider to .5dp and added shadow • change "DECLINE" to "NO THANKS" for verizon TOS (it already was that way for non-verizon) • changed "ACCEPT" button to "TURN ON" text • increased the bottom bar height • made the google transcription text in the TOS bold • add an image to the non-verizon TOS screen (just using test image for now) i didn't add the 'Learn more' link, since its not ready yet. verizon screen shot: https://drive.google.com/open?id=0B9o_KvtLkcuIcVk0dHBtWmFfdjJWQVV3OEdVc0JXN01XZHQ4 non-verizon screen shot: https://drive.google.com/open?id=0B9o_KvtLkcuIci1OMlVXTHVuMGYwMWZVTS01dGVwMUpLdmRr Bug: 62375681 Test: manual and updated unit tests PiperOrigin-RevId: 160006810 Change-Id: Id45a3a848bb219a70fddbb5a7ada29cd39e604a9 --- .../app/voicemail/error/VoicemailErrorAlert.java | 8 +++++ .../app/voicemail/error/VoicemailErrorMessage.java | 11 ++++++ .../error/VoicemailTosMessageCreator.java | 37 +++++++++++++++++---- .../app/voicemail/error/res/drawable/shadow.xml | 20 +++++++++++ .../error/res/drawable/voicemail_tos_image.png | Bin 0 -> 43527 bytes .../error/res/layout/voicemail_tos_fragment.xml | 23 +++++++++---- .../app/voicemail/error/res/values/dimens.xml | 20 ++++++++++- .../app/voicemail/error/res/values/strings.xml | 8 ++--- .../app/voicemail/error/res/values/styles.xml | 37 +++++++++++++++++++-- 9 files changed, 143 insertions(+), 21 deletions(-) create mode 100644 java/com/android/dialer/app/voicemail/error/res/drawable/shadow.xml create mode 100644 java/com/android/dialer/app/voicemail/error/res/drawable/voicemail_tos_image.png (limited to 'java/com/android/dialer/app') diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java b/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java index d045b1bd3..dbdf0f067 100644 --- a/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java +++ b/java/com/android/dialer/app/voicemail/error/VoicemailErrorAlert.java @@ -20,6 +20,7 @@ import android.content.Context; import android.support.annotation.VisibleForTesting; import android.text.util.Linkify; import android.view.View; +import android.widget.ImageView; import android.widget.TextView; import com.android.dialer.app.alert.AlertManager; import com.android.dialer.app.voicemail.error.VoicemailErrorMessage.Action; @@ -132,6 +133,13 @@ public class VoicemailErrorAlert { TextView secondaryButton = (TextView) view.findViewById(R.id.voicemail_tos_button_accept); secondaryButton.setText(secondaryAction.getText()); secondaryButton.setOnClickListener(secondaryAction.getListener()); + + if (message.getImageResourceId() != null) { + ImageView voicemailTosImage = (ImageView) view.findViewById(R.id.voicemail_image); + voicemailTosImage.setImageResource(message.getImageResourceId()); + voicemailTosImage.setVisibility(View.VISIBLE); + } + return view; } diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailErrorMessage.java b/java/com/android/dialer/app/voicemail/error/VoicemailErrorMessage.java index a0dd30f0b..92c787d2d 100644 --- a/java/com/android/dialer/app/voicemail/error/VoicemailErrorMessage.java +++ b/java/com/android/dialer/app/voicemail/error/VoicemailErrorMessage.java @@ -47,6 +47,7 @@ public class VoicemailErrorMessage { private final List actions; private boolean modal; + private Integer imageResourceId; /** Something the user can click on to resolve an error, such as retrying or calling voicemail */ public static class Action { @@ -100,6 +101,16 @@ public class VoicemailErrorMessage { return this; } + @Nullable + public Integer getImageResourceId() { + return imageResourceId; + } + + public VoicemailErrorMessage setImageResourceId(Integer imageResourceId) { + this.imageResourceId = imageResourceId; + return this; + } + public VoicemailErrorMessage(CharSequence title, CharSequence description, Action... actions) { this(title, description, Arrays.asList(actions)); } diff --git a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java index cf6564a74..56de4e91a 100644 --- a/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java +++ b/java/com/android/dialer/app/voicemail/error/VoicemailTosMessageCreator.java @@ -22,10 +22,13 @@ 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.SpannableString; +import android.text.style.StyleSpan; import android.view.View; import android.view.View.OnClickListener; import com.android.contacts.common.compat.TelephonyManagerCompat; @@ -114,7 +117,8 @@ public class VoicemailTosMessageCreator { } }, true /* raised */)) - .setModal(true); + .setModal(true) + .setImageResourceId(getTosImageId()); } private void showDeclineTosDialog(final PhoneAccountHandle handle) { @@ -274,17 +278,32 @@ public class VoicemailTosMessageCreator { } } - private String getTosTitle() { + private CharSequence getTosTitle() { return isVvm3() ? context.getString(R.string.verizon_terms_and_conditions_title) : context.getString(R.string.dialer_terms_and_conditions_title); } - private String getTosMessage() { - return isVvm3() - ? context.getString( - R.string.verizon_terms_and_conditions_message, getDialerTos(), getVvm3Tos()) - : context.getString(R.string.dialer_terms_and_conditions_message, getDialerTos()); + private CharSequence getTosMessage() { + if (isVvm3()) { + // For verizon the TOS consist of three pieces: google dialer TOS, Verizon TOS message and + // Verizon TOS details. + CharSequence vvm3Details = getVvm3Tos(); + 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; + } else { + // The TOS for everyone else there are no details, so just make everything bold. + 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; + } } private int getTosDeclinedDialogMessageId() { @@ -298,4 +317,8 @@ 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 new file mode 100644 index 000000000..681c795f5 --- /dev/null +++ b/java/com/android/dialer/app/voicemail/error/res/drawable/shadow.xml @@ -0,0 +1,20 @@ + + + + + + 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 new file mode 100644 index 000000000..2e076c69a Binary files /dev/null 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 a082e8e67..ec8abed6d 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 @@ -23,13 +23,21 @@ android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" - android:paddingStart="16dp" - android:paddingEnd="16dp" android:orientation="vertical"> + + android:layout_height="0.5dp" + android:elevation="1dp" + android:background="@drawable/shadow"/> 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 090311f15..dd815ca12 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 @@ -1,4 +1,20 @@ + + 24dp 16dp @@ -22,4 +38,6 @@ 4dp 16sp 14sp - \ No newline at end of file + + 200dp + 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 ad5240b9d..80349e168 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 @@ -174,16 +174,16 @@ 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.\n\nGet transcripts of your voicemail using Google’s transcription service. + See and listen to your messages, without having to call voicemail.\nGet transcripts of your voicemail using Google’s transcription service. - ***TRANSLATE TO SPANISH***\nSee and listen to your messages, without having to call voicemail.\n\nGet transcripts of your voicemail using Google’s transcription service. + ***TRANSLATE TO SPANISH***\nSee and listen to your messages, without having to call voicemail.\nGet transcripts of your voicemail using Google’s transcription service. - Accept + Turn On Aceptar - Decline + No Thanks Rechazar Turn On 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 c4a8542f1..257e93d1b 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 @@ -1,6 +1,21 @@ - + + + + - \ No newline at end of file + -- cgit v1.2.3