Optionally show text colors

This commit is contained in:
M66B
2019-09-23 20:13:38 +02:00
parent 7b183675c3
commit 214774fa09
8 changed files with 65 additions and 32 deletions

View File

@@ -2527,6 +2527,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
boolean show_quotes = args.getBoolean("show_quotes");
int zoom = args.getInt("zoom");
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean text_color = prefs.getBoolean("text_color", true);
boolean inline = prefs.getBoolean("inline_images", false);
if (message == null || !message.content)
return null;
@@ -2537,9 +2541,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
String body = Helper.readText(file);
Document document = Jsoup.parse(body);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
boolean inline = prefs.getBoolean("inline_images", false);
boolean has_images = false;
for (Element img : document.select("img")) {
if (inline) {
@@ -2561,7 +2562,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
body = document.html();
}
String html = HtmlHelper.sanitize(context, body, show_images);
String html = HtmlHelper.sanitize(context, body, text_color, show_images);
if (debug) {
Document format = Jsoup.parse(html);
format.outputSettings().prettyPrint(true).outline(true).indentAmount(1);