mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-31 20:25:38 +00:00
Refactoring
This commit is contained in:
parent
feb3939244
commit
63a49a3fe2
1 changed files with 3 additions and 3 deletions
|
@ -1969,14 +1969,14 @@ public class HtmlHelper {
|
|||
|
||||
static Spanned highlightHeaders(Context context, String headers) {
|
||||
SpannableStringBuilder ssb = new SpannableStringBuilder(headers);
|
||||
int colorAccent = Helper.resolveColor(context, android.R.attr.textColorLink);
|
||||
int textColorLink = Helper.resolveColor(context, android.R.attr.textColorLink);
|
||||
|
||||
int index = 0;
|
||||
for (String line : headers.split("\n")) {
|
||||
if (line.length() > 0 && !Character.isWhitespace(line.charAt(0))) {
|
||||
int colon = line.indexOf(':');
|
||||
if (colon > 0)
|
||||
ssb.setSpan(new ForegroundColorSpan(colorAccent), index, index + colon, 0);
|
||||
ssb.setSpan(new ForegroundColorSpan(textColorLink), index, index + colon, 0);
|
||||
}
|
||||
index += line.length() + 1;
|
||||
}
|
||||
|
@ -2018,7 +2018,7 @@ public class HtmlHelper {
|
|||
s = ssb.length();
|
||||
ssb.append(w[j]);
|
||||
if (words.contains(w[j].toLowerCase(Locale.ROOT)))
|
||||
ssb.setSpan(new ForegroundColorSpan(colorAccent), s, ssb.length(), 0);
|
||||
ssb.setSpan(new ForegroundColorSpan(textColorLink), s, ssb.length(), 0);
|
||||
j++;
|
||||
}
|
||||
ssb.append("\n\n");
|
||||
|
|
Loading…
Reference in a new issue