1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 12:44:42 +00:00

Dashed line improvement

This commit is contained in:
M66B 2020-11-07 21:16:09 +01:00
parent 8146c5243a
commit 38efddcb8f

View file

@ -2289,13 +2289,14 @@ public class HtmlHelper {
setSpan(ssb, new StyleSpan(Typeface.BOLD), start, ssb.length());
break;
case "hr":
boolean dashed = "true".equals(element.attr("x-dashed"));
LineSpan[] lines = null;
if (ssb.length() > 0)
if (dashed && ssb.length() > 0)
lines = ssb.getSpans(ssb.length() - 1, ssb.length() - 1, LineSpan.class);
if (lines == null || lines.length == 0) {
ssb.append(LINE);
float stroke = context.getResources().getDisplayMetrics().density;
float dash = ("true".equals(element.attr("x-dashed")) ? dp3 : 0f);
float dash = (dashed ? dp3 : 0f);
setSpan(ssb, new LineSpan(colorSeparator, stroke, dash), start, ssb.length());
}
break;