mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 00:21:10 +00:00
Use dimensions for blockquotes
This commit is contained in:
parent
ae296b489b
commit
1d2d06c933
5 changed files with 14 additions and 10 deletions
|
@ -135,8 +135,8 @@ public class EditTextCompose extends FixedEditText {
|
|||
html = h;
|
||||
|
||||
final int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary);
|
||||
final int dp3 = Helper.dp2pixels(context, 3);
|
||||
final int dp6 = Helper.dp2pixels(context, 6);
|
||||
final int quoteGap = context.getResources().getDimensionPixelSize(R.dimen.quote_gap_size);
|
||||
final int quoteStripe = context.getResources().getDimensionPixelSize(R.dimen.quote_stripe_width);
|
||||
|
||||
executor.submit(new Runnable() {
|
||||
@Override
|
||||
|
@ -162,7 +162,7 @@ public class EditTextCompose extends FixedEditText {
|
|||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P)
|
||||
q = new QuoteSpan(colorPrimary);
|
||||
else
|
||||
q = new QuoteSpan(colorPrimary, dp3, dp6);
|
||||
q = new QuoteSpan(colorPrimary, quoteStripe, quoteGap);
|
||||
ssb.setSpan(q,
|
||||
ssb.getSpanStart(span),
|
||||
ssb.getSpanEnd(span),
|
||||
|
|
|
@ -5458,8 +5458,8 @@ public class FragmentCompose extends FragmentBase {
|
|||
final boolean show_images = args.getBoolean("show_images", false);
|
||||
|
||||
int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary);
|
||||
int dp3 = Helper.dp2pixels(context, 3);
|
||||
int dp6 = Helper.dp2pixels(context, 6);
|
||||
int quoteGap = context.getResources().getDimensionPixelSize(R.dimen.quote_gap_size);
|
||||
int quoteStripe = context.getResources().getDimensionPixelSize(R.dimen.quote_stripe_width);
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
EntityMessage draft = db.message().getMessage(id);
|
||||
|
@ -5485,7 +5485,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P)
|
||||
q = new QuoteSpan(colorPrimary);
|
||||
else
|
||||
q = new QuoteSpan(colorPrimary, dp3, dp6);
|
||||
q = new QuoteSpan(colorPrimary, quoteStripe, quoteGap);
|
||||
bodyBuilder.setSpan(q,
|
||||
bodyBuilder.getSpanStart(quoteSpan),
|
||||
bodyBuilder.getSpanEnd(quoteSpan),
|
||||
|
|
|
@ -2040,6 +2040,8 @@ public class HtmlHelper {
|
|||
int bulletGap = context.getResources().getDimensionPixelSize(R.dimen.bullet_gap_size);
|
||||
int bulletRadius = context.getResources().getDimensionPixelSize(R.dimen.bullet_radius_size);
|
||||
int bulletIndent = context.getResources().getDimensionPixelSize(R.dimen.bullet_indent_size);
|
||||
int quoteGap = context.getResources().getDimensionPixelSize(R.dimen.quote_gap_size);
|
||||
int quoteStripe = context.getResources().getDimensionPixelSize(R.dimen.quote_stripe_width);
|
||||
|
||||
int message_zoom = prefs.getInt("message_zoom", 100);
|
||||
float textSize = Helper.getTextSize(context, 0) * message_zoom / 100f;
|
||||
|
@ -2307,7 +2309,7 @@ public class HtmlHelper {
|
|||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P)
|
||||
setSpan(ssb, new QuoteSpan(colorPrimary), start, ssb.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
else
|
||||
setSpan(ssb, new QuoteSpan(colorPrimary, dp3, dp6), start, ssb.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
setSpan(ssb, new QuoteSpan(colorPrimary, quoteStripe, quoteGap), start, ssb.length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
break;
|
||||
case "br":
|
||||
ssb.append('\n');
|
||||
|
|
|
@ -356,8 +356,8 @@ public class StyleHelper {
|
|||
Context context = etBody.getContext();
|
||||
|
||||
int colorPrimary = Helper.resolveColor(context, R.attr.colorPrimary);
|
||||
int dp3 = Helper.dp2pixels(context, 3);
|
||||
int dp6 = Helper.dp2pixels(context, 6);
|
||||
int quoteGap = context.getResources().getDimensionPixelSize(R.dimen.quote_gap_size);
|
||||
int quoteStripe = context.getResources().getDimensionPixelSize(R.dimen.quote_stripe_width);
|
||||
|
||||
Pair<Integer, Integer> paragraph = ensureParagraph(edit, start, end);
|
||||
int s = paragraph.first;
|
||||
|
@ -371,7 +371,7 @@ public class StyleHelper {
|
|||
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.P)
|
||||
q = new QuoteSpan(colorPrimary);
|
||||
else
|
||||
q = new QuoteSpan(colorPrimary, dp3, dp6);
|
||||
q = new QuoteSpan(colorPrimary, quoteStripe, quoteGap);
|
||||
edit.setSpan(q, s, e, Spanned.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||
|
||||
etBody.setText(edit);
|
||||
|
|
|
@ -8,4 +8,6 @@
|
|||
<dimen name="bullet_gap_size">6dp</dimen>
|
||||
<dimen name="bullet_radius_size">3dp</dimen>
|
||||
<dimen name="bullet_indent_size">24dp</dimen>
|
||||
<dimen name="quote_gap_size">6dp</dimen>
|
||||
<dimen name="quote_stripe_width">3dp</dimen>
|
||||
</resources>
|
Loading…
Add table
Reference in a new issue