diff --git a/res/values/dimensions.xml b/res/values/dimensions.xml index a466dd309..02cbbb1d9 100644 --- a/res/values/dimensions.xml +++ b/res/values/dimensions.xml @@ -50,4 +50,9 @@ 8dip 0dip 10sp + + + 10sp + 10sp + 4sp diff --git a/src/com/android/email/activity/setup/AccountSettings.java b/src/com/android/email/activity/setup/AccountSettings.java index b64b95ded..102eff04c 100644 --- a/src/com/android/email/activity/setup/AccountSettings.java +++ b/src/com/android/email/activity/setup/AccountSettings.java @@ -32,10 +32,15 @@ import android.net.Uri; import android.os.AsyncTask; import android.os.Bundle; import android.preference.PreferenceActivity; +import android.text.SpannableString; +import android.text.method.LinkMovementMethod; +import android.text.util.Linkify; import android.util.Log; +import android.util.TypedValue; import android.view.KeyEvent; import android.view.Menu; import android.view.MenuItem; +import android.widget.TextView; import com.android.email.R; import com.android.email.activity.ActivityHelper; @@ -842,8 +847,21 @@ public class AccountSettings extends PreferenceActivity { b.setTitle(R.string.account_settings_login_dialog_title); b.setIconAttribute(android.R.attr.alertDialogIcon); if (mReason != null) { - b.setMessage(res.getString(R.string.account_settings_login_dialog_reason_fmt, - accountName, mReason)); + final TextView message = new TextView(context); + String alert = res.getString( + R.string.account_settings_login_dialog_reason_fmt, accountName, mReason); + SpannableString spannableAlertString = new SpannableString(alert); + Linkify.addLinks(spannableAlertString, Linkify.WEB_URLS); + message.setText(spannableAlertString); + // There must be a better way than specifying size/padding this way + // It does work and look right, though + int textSize = res.getDimensionPixelSize(R.dimen.dialog_text_size); + message.setTextSize(textSize); + int paddingLeft = res.getDimensionPixelSize(R.dimen.dialog_padding_left); + int paddingOther = res.getDimensionPixelSize(R.dimen.dialog_padding_other); + message.setPadding(paddingLeft, paddingOther, paddingOther, paddingOther); + message.setMovementMethod(LinkMovementMethod.getInstance()); + b.setView(message); } else { b.setMessage(res.getString(R.string.account_settings_login_dialog_content_fmt, accountName));