am 2da2e463: Change android.text.util.Regex to com.android.common.Patterns

Merge commit '2da2e4632dfd84f956d778f3fe6a83c2719296c7' into eclair-mr2-plus-aosp

* commit '2da2e4632dfd84f956d778f3fe6a83c2719296c7':
  Change android.text.util.Regex to com.android.common.Patterns
This commit is contained in:
Dan Egnor 2009-11-18 13:06:53 -08:00 committed by Android Git Automerger
commit 45ea7ec021

View File

@ -16,6 +16,7 @@
package com.android.email.activity; package com.android.email.activity;
import com.android.common.Patterns;
import com.android.email.Controller; import com.android.email.Controller;
import com.android.email.Email; import com.android.email.Email;
import com.android.email.R; import com.android.email.R;
@ -58,7 +59,6 @@ import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.QuickContact; import android.provider.ContactsContract.QuickContact;
import android.provider.ContactsContract.StatusUpdates; import android.provider.ContactsContract.StatusUpdates;
import android.text.TextUtils; import android.text.TextUtils;
import android.text.util.Regex;
import android.util.Log; import android.util.Log;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.Menu; import android.view.Menu;
@ -1309,7 +1309,7 @@ public class MessageView extends Activity implements OnClickListener {
// Escape any inadvertent HTML in the text message // Escape any inadvertent HTML in the text message
text = EmailHtmlUtil.escapeCharacterToDisplay(text); text = EmailHtmlUtil.escapeCharacterToDisplay(text);
// Find any embedded URL's and linkify // Find any embedded URL's and linkify
Matcher m = Regex.WEB_URL_PATTERN.matcher(text); Matcher m = Patterns.WEB_URL.matcher(text);
while (m.find()) { while (m.find()) {
int start = m.start(); int start = m.start();
/* /*
@ -1326,7 +1326,7 @@ public class MessageView extends Activity implements OnClickListener {
// because WebView could follow only lower case protocol link. // because WebView could follow only lower case protocol link.
link = proto.group().toLowerCase() + url.substring(proto.end()); link = proto.group().toLowerCase() + url.substring(proto.end());
} else { } else {
// Regex.WEB_URL_PATTERN matches URL without protocol part, // Patterns.WEB_URL matches URL without protocol part,
// so added default protocol to link. // so added default protocol to link.
link = "http://" + url; link = "http://" + url;
} }
@ -1470,7 +1470,7 @@ public class MessageView extends Activity implements OnClickListener {
// */ // */
// StringBuffer sb = new StringBuffer("<html><body>"); // StringBuffer sb = new StringBuffer("<html><body>");
// if (text != null) { // if (text != null) {
// Matcher m = Regex.WEB_URL_PATTERN.matcher(text); // Matcher m = Patterns.WEB_URL.matcher(text);
// while (m.find()) { // while (m.find()) {
// int start = m.start(); // int start = m.start();
// /* // /*
@ -1488,7 +1488,7 @@ public class MessageView extends Activity implements OnClickListener {
// link = proto.group().toLowerCase() // link = proto.group().toLowerCase()
// + url.substring(proto.end()); // + url.substring(proto.end());
// } else { // } else {
// // Regex.WEB_URL_PATTERN matches URL without protocol part, // // Patterns.WEB_URL matches URL without protocol part,
// // so added default protocol to link. // // so added default protocol to link.
// link = "http://" + url; // link = "http://" + url;
// } // }