diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index 9018cba8a..076ee4fa6 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -89,12 +89,13 @@ import com.fsck.k9.crypto.PgpData; import com.fsck.k9.fragment.ProgressDialogFragment; import com.fsck.k9.helper.ContactItem; import com.fsck.k9.helper.Contacts; -import com.fsck.k9.helper.HtmlConverter; +import com.fsck.k9.mail.internet.HtmlConverter; import com.fsck.k9.helper.IdentityHelper; import com.fsck.k9.helper.Utility; import com.fsck.k9.mail.Address; import com.fsck.k9.mail.Body; import com.fsck.k9.mail.Flag; +import com.fsck.k9.mail.internet.InsertableHtmlContent; import com.fsck.k9.mail.Message; import com.fsck.k9.mail.Message.RecipientType; import com.fsck.k9.mail.MessagingException; diff --git a/src/com/fsck/k9/activity/setup/WelcomeMessage.java b/src/com/fsck/k9/activity/setup/WelcomeMessage.java index 9c30bb0c2..e40a95eb9 100644 --- a/src/com/fsck/k9/activity/setup/WelcomeMessage.java +++ b/src/com/fsck/k9/activity/setup/WelcomeMessage.java @@ -12,7 +12,7 @@ import android.widget.TextView; import com.fsck.k9.R; import com.fsck.k9.activity.Accounts; import com.fsck.k9.activity.K9Activity; -import com.fsck.k9.helper.HtmlConverter; +import com.fsck.k9.mail.internet.HtmlConverter; /** * Displays a welcome message when no accounts have been created yet. diff --git a/src/com/fsck/k9/helper/Contacts.java b/src/com/fsck/k9/helper/Contacts.java index 022139f89..f5d25a912 100644 --- a/src/com/fsck/k9/helper/Contacts.java +++ b/src/com/fsck/k9/helper/Contacts.java @@ -18,7 +18,7 @@ import java.util.List; /** * Helper class to access the contacts stored on the device. */ -public class Contacts { +public class Contacts implements Address.Lookup { /** * The order in which the search results are returned by * {@link #searchContacts(CharSequence)}. diff --git a/src/com/fsck/k9/mail/Address.java b/src/com/fsck/k9/mail/Address.java index f3810f051..25929e94e 100644 --- a/src/com/fsck/k9/mail/Address.java +++ b/src/com/fsck/k9/mail/Address.java @@ -20,11 +20,14 @@ import android.text.util.Rfc822Tokenizer; import android.util.Log; import com.fsck.k9.K9; -import com.fsck.k9.helper.Contacts; import com.fsck.k9.helper.Utility; public class Address { + public static interface Lookup { + String getNameForAddress(String address); + } + /** * If the number of addresses exceeds this value the addresses aren't * resolved to the names of Android contacts. @@ -34,7 +37,7 @@ public class Address { * performance tests. *

* - * @see Address#toFriendly(Address[], Contacts) + * @see Address#toFriendly(Address[], com.fsck.k9.mail.Address.Lookup) */ private static final int TOO_MANY_ADDRESSES = 50; @@ -239,7 +242,7 @@ public class Address { * @return */ public CharSequence toFriendly() { - return toFriendly((Contacts)null); + return toFriendly((Lookup)null); } /** @@ -254,7 +257,7 @@ public class Address { * @return * A "friendly" name for this {@link Address}. */ - public CharSequence toFriendly(final Contacts contacts) { + public CharSequence toFriendly(final Lookup contacts) { if (!K9.showCorrespondentNames()) { return mAddress; @@ -281,11 +284,7 @@ public class Address { return (!TextUtils.isEmpty(mPersonal)) ? mPersonal : mAddress; } - public static CharSequence toFriendly(Address[] addresses) { - return toFriendly(addresses, null); - } - - public static CharSequence toFriendly(Address[] addresses, Contacts contacts) { + public static CharSequence toFriendly(Address[] addresses, Lookup contacts) { if (addresses == null) { return null; } diff --git a/src/com/fsck/k9/helper/HtmlConverter.java b/src/com/fsck/k9/mail/internet/HtmlConverter.java similarity index 99% rename from src/com/fsck/k9/helper/HtmlConverter.java rename to src/com/fsck/k9/mail/internet/HtmlConverter.java index 14eb75fda..a217d5b81 100644 --- a/src/com/fsck/k9/helper/HtmlConverter.java +++ b/src/com/fsck/k9/mail/internet/HtmlConverter.java @@ -1,9 +1,11 @@ -package com.fsck.k9.helper; +package com.fsck.k9.mail.internet; import android.text.*; import android.text.Html.TagHandler; import android.util.Log; import com.fsck.k9.K9; +import com.fsck.k9.helper.Regex; + import org.xml.sax.XMLReader; import java.io.IOException; diff --git a/src/com/fsck/k9/activity/InsertableHtmlContent.java b/src/com/fsck/k9/mail/internet/InsertableHtmlContent.java similarity index 99% rename from src/com/fsck/k9/activity/InsertableHtmlContent.java rename to src/com/fsck/k9/mail/internet/InsertableHtmlContent.java index 9821ad784..fabcc6082 100644 --- a/src/com/fsck/k9/activity/InsertableHtmlContent.java +++ b/src/com/fsck/k9/mail/internet/InsertableHtmlContent.java @@ -1,4 +1,4 @@ -package com.fsck.k9.activity; +package com.fsck.k9.mail.internet; import java.io.Serializable; diff --git a/src/com/fsck/k9/mail/internet/MimeUtility.java b/src/com/fsck/k9/mail/internet/MimeUtility.java index c6308a313..6aaa93256 100644 --- a/src/com/fsck/k9/mail/internet/MimeUtility.java +++ b/src/com/fsck/k9/mail/internet/MimeUtility.java @@ -5,7 +5,6 @@ import android.content.Context; import android.util.Log; import com.fsck.k9.K9; import com.fsck.k9.R; -import com.fsck.k9.helper.HtmlConverter; import com.fsck.k9.mail.*; import com.fsck.k9.mail.Message.RecipientType; import com.fsck.k9.mail.internet.BinaryTempFileBody.BinaryTempFileBodyInputStream; diff --git a/src/com/fsck/k9/mail/internet/TextBodyBuilder.java b/src/com/fsck/k9/mail/internet/TextBodyBuilder.java index 7efbc8f5d..962a80e14 100644 --- a/src/com/fsck/k9/mail/internet/TextBodyBuilder.java +++ b/src/com/fsck/k9/mail/internet/TextBodyBuilder.java @@ -4,8 +4,6 @@ import android.text.TextUtils; import android.util.Log; import com.fsck.k9.K9; -import com.fsck.k9.activity.InsertableHtmlContent; -import com.fsck.k9.helper.HtmlConverter; import com.fsck.k9.mail.Body; public class TextBodyBuilder { @@ -27,7 +25,7 @@ public class TextBodyBuilder { /** * Build the {@link Body} that will contain the text of the message. * - * @return {@link TextBody} instance that contains the entered text and + * @return {@link com.fsck.k9.mail.internet.TextBody} instance that contains the entered text and * possibly the quoted original message. */ public TextBody buildTextHtml() { diff --git a/src/com/fsck/k9/mail/store/local/LocalFolder.java b/src/com/fsck/k9/mail/store/local/LocalFolder.java index 8ca5c139c..e68d7d684 100644 --- a/src/com/fsck/k9/mail/store/local/LocalFolder.java +++ b/src/com/fsck/k9/mail/store/local/LocalFolder.java @@ -32,7 +32,7 @@ import com.fsck.k9.Account; import com.fsck.k9.K9; import com.fsck.k9.Account.MessageFormat; import com.fsck.k9.activity.Search; -import com.fsck.k9.helper.HtmlConverter; +import com.fsck.k9.mail.internet.HtmlConverter; import com.fsck.k9.helper.Utility; import com.fsck.k9.mail.Address; import com.fsck.k9.mail.Body; diff --git a/src/com/fsck/k9/view/MessageWebView.java b/src/com/fsck/k9/view/MessageWebView.java index 3198d4723..07faaf3e1 100644 --- a/src/com/fsck/k9/view/MessageWebView.java +++ b/src/com/fsck/k9/view/MessageWebView.java @@ -10,7 +10,7 @@ import android.widget.Toast; import com.fsck.k9.K9; import com.fsck.k9.R; -import com.fsck.k9.helper.HtmlConverter; +import com.fsck.k9.mail.internet.HtmlConverter; public class MessageWebView extends RigidWebView { diff --git a/src/com/fsck/k9/view/SingleMessageView.java b/src/com/fsck/k9/view/SingleMessageView.java index 1506bd4dd..a351e7921 100644 --- a/src/com/fsck/k9/view/SingleMessageView.java +++ b/src/com/fsck/k9/view/SingleMessageView.java @@ -5,7 +5,6 @@ import java.io.FileOutputStream; import java.io.InputStream; import java.net.URL; import java.net.URLConnection; -import java.net.URLDecoder; import android.app.Activity; import android.app.Fragment; @@ -47,7 +46,7 @@ import com.fsck.k9.fragment.MessageViewFragment; import com.fsck.k9.helper.ClipboardManager; import com.fsck.k9.helper.Contacts; import com.fsck.k9.helper.FileHelper; -import com.fsck.k9.helper.HtmlConverter; +import com.fsck.k9.mail.internet.HtmlConverter; import com.fsck.k9.helper.UrlEncodingHelper; import com.fsck.k9.helper.Utility; import com.fsck.k9.mail.Address; diff --git a/tests-on-jvm/src/com/fsck/k9/mail/internet/TextBodyBuilderTest.java b/tests-on-jvm/src/com/fsck/k9/mail/internet/TextBodyBuilderTest.java index 64882691d..7c3b096dd 100644 --- a/tests-on-jvm/src/com/fsck/k9/mail/internet/TextBodyBuilderTest.java +++ b/tests-on-jvm/src/com/fsck/k9/mail/internet/TextBodyBuilderTest.java @@ -7,7 +7,7 @@ import org.junit.experimental.theories.*; import org.junit.runner.RunWith; import com.fsck.k9.Account.QuoteStyle; -import com.fsck.k9.activity.InsertableHtmlContent; +import com.fsck.k9.activity.TextBodyBuilder; class TestingTextBodyBuilder extends TextBodyBuilder { diff --git a/tests/src/com/fsck/k9/helper/HtmlConverterTest.java b/tests/src/com/fsck/k9/helper/HtmlConverterTest.java index c79958150..7ab254baf 100644 --- a/tests/src/com/fsck/k9/helper/HtmlConverterTest.java +++ b/tests/src/com/fsck/k9/helper/HtmlConverterTest.java @@ -1,5 +1,7 @@ package com.fsck.k9.helper; +import com.fsck.k9.mail.internet.HtmlConverter; + import junit.framework.TestCase; import java.io.BufferedWriter;