Removed custom rendering as experiment

pull/178/head
M66B 5 years ago
parent 86e589a904
commit 602621f36e

@ -2540,7 +2540,7 @@ Reformatting and displaying such messages will take too long. You can try to use
<a name="faq125"></a>
**(125) What are the current experimental features?**
* Custom rendering of reformatted messages
* ~~Custom rendering of reformatted messages~~
<br />

@ -245,7 +245,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
private boolean authentication;
private boolean language_detection;
private static boolean debug;
private boolean experiments;
private boolean gotoTop = false;
private boolean firstClick = false;
@ -1913,17 +1912,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
quote.html("&#8230;");
}
// Add debug info
if (debug && !experiments) {
document.outputSettings().prettyPrint(true).outline(true).indentAmount(1);
String[] lines = document.html().split("\\r?\\n");
for (int i = 0; i < lines.length; i++)
lines[i] = Html.escapeHtml(lines[i]);
Element pre = document.createElement("pre");
pre.html(TextUtils.join("<br>", lines));
document.body().appendChild(pre);
}
// Draw images
Spanned spanned = HtmlHelper.fromDocument(context, document, new Html.ImageGetter() {
@Override
@ -4647,7 +4635,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
this.language_detection = prefs.getBoolean("language_detection", false);
debug = prefs.getBoolean("debug", false);
this.experiments = prefs.getBoolean("experiments", false);
DiffUtil.ItemCallback<TupleMessageEx> callback = new DiffUtil.ItemCallback<TupleMessageEx>() {
@Override

@ -272,6 +272,8 @@ public class ApplicationEx extends Application {
} else if (version < 1121) {
if (!Helper.isPlayStoreInstall())
editor.putBoolean("experiments", true);
} else if (version < 1124) {
editor.remove("experiments");
}
if (version < BuildConfig.VERSION_CODE)

@ -314,8 +314,6 @@ public class HtmlHelper {
boolean display_hidden = prefs.getBoolean("display_hidden", false);
boolean disable_tracking = prefs.getBoolean("disable_tracking", true);
boolean parse_classes = prefs.getBoolean("parse_classes", false);
boolean experiments = prefs.getBoolean("experiments", false);
// https://chromium.googlesource.com/chromium/blink/+/master/Source/core/css/html.css
@ -754,13 +752,13 @@ public class HtmlHelper {
// Subscript/Superscript
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sub
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/sup
if (!experiments || !view)
if (!view)
for (Element subp : document.select("sub,sup"))
subp.tagName("small");
// Lists
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/li
if (!experiments || !view) {
if (!view) {
for (Element li : document.select("li")) {
li.tagName("span");
Element parent = li.parent();
@ -1779,14 +1777,12 @@ public class HtmlHelper {
static Spanned fromDocument(Context context, @NonNull Document document, @Nullable Html.ImageGetter imageGetter, @Nullable Html.TagHandler tagHandler) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean experiments = prefs.getBoolean("experiments", false);
boolean debug = prefs.getBoolean("debug", false);
int colorAccent = Helper.resolveColor(context, R.attr.colorAccent);
int dp3 = Helper.dp2pixels(context, 3);
int dp6 = Helper.dp2pixels(context, 6);
int dp24 = Helper.dp2pixels(context, 24);
if (experiments) {
// https://developer.mozilla.org/en-US/docs/Web/HTML/Block-level_elements
NodeTraversor.traverse(new NodeVisitor() {
private int pre = 0;
@ -2066,8 +2062,6 @@ public class HtmlHelper {
ssb.insert(i, "|");
return reverseSpans(ssb);
} else
return fromHtml(document.html(), imageGetter, null);
}
static Spanned fromHtml(@NonNull String html) {

Loading…
Cancel
Save