mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 11:01:23 +01:00
Refactoring
This commit is contained in:
@@ -83,7 +83,7 @@ import static androidx.core.text.HtmlCompat.FROM_HTML_SEPARATOR_LINE_BREAK_LIST_
|
||||
import static androidx.core.text.HtmlCompat.TO_HTML_PARAGRAPH_LINES_CONSECUTIVE;
|
||||
|
||||
public class HtmlHelper {
|
||||
static final int PREVIEW_SIZE = 250; // characters
|
||||
private static final int PREVIEW_SIZE = 250; // characters
|
||||
|
||||
private static final float MIN_LUMINANCE = 0.5f;
|
||||
private static final int MAX_AUTO_LINK = 250;
|
||||
@@ -812,8 +812,16 @@ public class HtmlHelper {
|
||||
}
|
||||
|
||||
static String getPreview(String body) {
|
||||
String text = (body == null ? null : Jsoup.parse(body).text());
|
||||
return (text == null ? null : text.substring(0, Math.min(text.length(), PREVIEW_SIZE)));
|
||||
if (body == null)
|
||||
return null;
|
||||
|
||||
String text = Jsoup.parse(body).text();
|
||||
|
||||
String preview = text.substring(0, Math.min(text.length(), PREVIEW_SIZE));
|
||||
if (preview.length() < text.length())
|
||||
preview += "…";
|
||||
|
||||
return preview;
|
||||
}
|
||||
|
||||
static String getText(String html) {
|
||||
|
||||
Reference in New Issue
Block a user