diff --git a/app/src/main/java/eu/faircode/email/EditTextCompose.java b/app/src/main/java/eu/faircode/email/EditTextCompose.java index 1dbc47c551..d813d11ff5 100644 --- a/app/src/main/java/eu/faircode/email/EditTextCompose.java +++ b/app/src/main/java/eu/faircode/email/EditTextCompose.java @@ -151,6 +151,7 @@ public class EditTextCompose extends FixedEditText { html = h; final int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary); + final int colorBlockquote = Helper.resolveColor(context, R.attr.colorBlockquote, colorPrimary); final int quoteGap = context.getResources().getDimensionPixelSize(R.dimen.quote_gap_size); final int quoteStripe = context.getResources().getDimensionPixelSize(R.dimen.quote_stripe_width); @@ -176,9 +177,9 @@ public class EditTextCompose extends FixedEditText { for (QuoteSpan span : spans) { QuoteSpan q; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) - q = new QuoteSpan(colorPrimary); + q = new QuoteSpan(colorBlockquote); else - q = new QuoteSpan(colorPrimary, quoteStripe, quoteGap); + q = new QuoteSpan(colorBlockquote, quoteStripe, quoteGap); ssb.setSpan(q, ssb.getSpanStart(span), ssb.getSpanEnd(span), diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 16ed50f7ec..ef457c4e1f 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -5702,6 +5702,7 @@ public class FragmentCompose extends FragmentBase { final boolean show_images = args.getBoolean("show_images", false); int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary); + final int colorBlockquote = Helper.resolveColor(context, R.attr.colorBlockquote, colorPrimary); int quoteGap = context.getResources().getDimensionPixelSize(R.dimen.quote_gap_size); int quoteStripe = context.getResources().getDimensionPixelSize(R.dimen.quote_stripe_width); @@ -5727,9 +5728,9 @@ public class FragmentCompose extends FragmentBase { for (QuoteSpan quoteSpan : bodySpans) { QuoteSpan q; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) - q = new QuoteSpan(colorPrimary); + q = new QuoteSpan(colorBlockquote); else - q = new QuoteSpan(colorPrimary, quoteStripe, quoteGap); + q = new QuoteSpan(colorBlockquote, quoteStripe, quoteGap); bodyBuilder.setSpan(q, bodyBuilder.getSpanStart(quoteSpan), bodyBuilder.getSpanEnd(quoteSpan), diff --git a/app/src/main/java/eu/faircode/email/Helper.java b/app/src/main/java/eu/faircode/email/Helper.java index a6f6b187e8..02f062f8e3 100644 --- a/app/src/main/java/eu/faircode/email/Helper.java +++ b/app/src/main/java/eu/faircode/email/Helper.java @@ -1035,9 +1035,13 @@ public class Helper { } static int resolveColor(Context context, int attr) { + return resolveColor(context, attr, 0xFF0000); + } + + static int resolveColor(Context context, int attr, int def) { int[] attrs = new int[]{attr}; TypedArray a = context.getTheme().obtainStyledAttributes(attrs); - int color = a.getColor(0, 0xFF0000); + int color = a.getColor(0, def); a.recycle(); return color; } diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 57639bda6c..d15ac0b285 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -2173,6 +2173,7 @@ public class HtmlHelper { final int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary); final int colorAccent = Helper.resolveColor(context, R.attr.colorAccent); + final int colorBlockquote = Helper.resolveColor(context, R.attr.colorBlockquote, colorPrimary); final int colorSeparator = Helper.resolveColor(context, R.attr.colorSeparator); int bulletGap = context.getResources().getDimensionPixelSize(R.dimen.bullet_gap_size); int bulletRadius = context.getResources().getDimensionPixelSize(R.dimen.bullet_radius_size); @@ -2460,9 +2461,9 @@ public class HtmlHelper { ssb.append("\n"); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) - setSpan(ssb, new QuoteSpan(colorPrimary), start, ssb.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); + setSpan(ssb, new QuoteSpan(colorBlockquote), start, ssb.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); else - setSpan(ssb, new QuoteSpan(colorPrimary, quoteStripe, quoteGap), start, ssb.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); + setSpan(ssb, new QuoteSpan(colorBlockquote, quoteStripe, quoteGap), start, ssb.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); break; case "br": ssb.append('\n'); diff --git a/app/src/main/java/eu/faircode/email/StyleHelper.java b/app/src/main/java/eu/faircode/email/StyleHelper.java index a513ebf4cd..f8e9fdd8ec 100644 --- a/app/src/main/java/eu/faircode/email/StyleHelper.java +++ b/app/src/main/java/eu/faircode/email/StyleHelper.java @@ -489,6 +489,7 @@ public class StyleHelper { Context context = etBody.getContext(); int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary); + final int colorBlockquote = Helper.resolveColor(context, R.attr.colorBlockquote, colorPrimary); int quoteGap = context.getResources().getDimensionPixelSize(R.dimen.quote_gap_size); int quoteStripe = context.getResources().getDimensionPixelSize(R.dimen.quote_stripe_width); @@ -521,9 +522,9 @@ public class StyleHelper { if (!has) { QuoteSpan q; if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P) - q = new QuoteSpan(colorPrimary); + q = new QuoteSpan(colorBlockquote); else - q = new QuoteSpan(colorPrimary, quoteStripe, quoteGap); + q = new QuoteSpan(colorBlockquote, quoteStripe, quoteGap); edit.setSpan(q, paragraph.first, paragraph.second, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); } diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index b101426ef4..9fb1f48b9e 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -3,6 +3,7 @@ + @@ -437,6 +438,7 @@ @color/darkSolarizedAccent @color/darkSolarizedAccent + @color/darkSolarizedAccent @color/darkSolarizedActionBackground