mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Use experiments settings for message sections
This commit is contained in:
parent
bdb5644367
commit
ec08b8e47f
1 changed files with 23 additions and 19 deletions
|
@ -327,6 +327,7 @@ public class HtmlHelper {
|
||||||
boolean disable_tracking = prefs.getBoolean("disable_tracking", true);
|
boolean disable_tracking = prefs.getBoolean("disable_tracking", true);
|
||||||
boolean parse_classes = prefs.getBoolean("parse_classes", false);
|
boolean parse_classes = prefs.getBoolean("parse_classes", false);
|
||||||
boolean inline_images = prefs.getBoolean("inline_images", false);
|
boolean inline_images = prefs.getBoolean("inline_images", false);
|
||||||
|
boolean experiments = prefs.getBoolean("experiments", false);
|
||||||
|
|
||||||
int textColorPrimary = Helper.resolveColor(context, android.R.attr.textColorPrimary);
|
int textColorPrimary = Helper.resolveColor(context, android.R.attr.textColorPrimary);
|
||||||
|
|
||||||
|
@ -792,7 +793,7 @@ public class HtmlHelper {
|
||||||
if (hasVisibleContent(row.childNodes())) {
|
if (hasVisibleContent(row.childNodes())) {
|
||||||
Element next = row.nextElementSibling();
|
Element next = row.nextElementSibling();
|
||||||
if (next != null && "tr".equals(next.tagName()))
|
if (next != null && "tr".equals(next.tagName()))
|
||||||
row.appendElement("hr");
|
row.appendElement(experiments ? "hr" : "br");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1809,6 +1810,7 @@ public class HtmlHelper {
|
||||||
@Nullable Html.ImageGetter imageGetter, @Nullable Html.TagHandler tagHandler) {
|
@Nullable Html.ImageGetter imageGetter, @Nullable Html.TagHandler tagHandler) {
|
||||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
boolean debug = prefs.getBoolean("debug", false);
|
boolean debug = prefs.getBoolean("debug", false);
|
||||||
|
boolean experiments = prefs.getBoolean("experiments", false);
|
||||||
|
|
||||||
final int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary);
|
final int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary);
|
||||||
final int colorAccent = Helper.resolveColor(context, R.attr.colorAccent);
|
final int colorAccent = Helper.resolveColor(context, R.attr.colorAccent);
|
||||||
|
@ -2099,6 +2101,7 @@ public class HtmlHelper {
|
||||||
newline(ssb.length());
|
newline(ssb.length());
|
||||||
break;
|
break;
|
||||||
case "hr":
|
case "hr":
|
||||||
|
if (experiments) {
|
||||||
int lhr = 0;
|
int lhr = 0;
|
||||||
for (LineSpan ls : ssb.getSpans(0, ssb.length(), LineSpan.class)) {
|
for (LineSpan ls : ssb.getSpans(0, ssb.length(), LineSpan.class)) {
|
||||||
int end = ssb.getSpanEnd(ls);
|
int end = ssb.getSpanEnd(ls);
|
||||||
|
@ -2119,6 +2122,7 @@ public class HtmlHelper {
|
||||||
ssb.charAt(ssb.length() - 2) == '\n' &&
|
ssb.charAt(ssb.length() - 2) == '\n' &&
|
||||||
ssb.charAt(ssb.length() - 1) == '\n')
|
ssb.charAt(ssb.length() - 1) == '\n')
|
||||||
ssb.delete(ssb.length() - 1, ssb.length());
|
ssb.delete(ssb.length() - 1, ssb.length());
|
||||||
|
}
|
||||||
|
|
||||||
ssb.append("\n" + LINE + "\n");
|
ssb.append("\n" + LINE + "\n");
|
||||||
float stroke = context.getResources().getDisplayMetrics().density;
|
float stroke = context.getResources().getDisplayMetrics().density;
|
||||||
|
|
Loading…
Reference in a new issue