mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 19:10:11 +01:00
Paragraph alignment
This commit is contained in:
@@ -170,7 +170,7 @@ public class HtmlEx {
|
||||
// Only use the last AlignmentSpan with flag SPAN_PARAGRAPH
|
||||
for (int i = alignmentSpans.length - 1; i >= 0; i--) {
|
||||
AlignmentSpan s = alignmentSpans[i];
|
||||
if ((text.getSpanFlags(s) & Spanned.SPAN_PARAGRAPH) == Spanned.SPAN_PARAGRAPH || true) {
|
||||
if ((text.getSpanFlags(s) & Spanned.SPAN_PARAGRAPH) == Spanned.SPAN_PARAGRAPH) {
|
||||
final Layout.Alignment alignment = s.getAlignment();
|
||||
if (alignment == Layout.Alignment.ALIGN_NORMAL) {
|
||||
textAlign = "text-align:start;";
|
||||
|
||||
@@ -2322,7 +2322,9 @@ public class HtmlHelper {
|
||||
int s = start.get(spans[i]);
|
||||
int e = end.get(spans[i]);
|
||||
int f = flags.get(spans[i]);
|
||||
if (spans[i] instanceof BulletSpan || spans[i] instanceof NumberSpan)
|
||||
if (spans[i] instanceof AlignmentSpan ||
|
||||
spans[i] instanceof BulletSpan ||
|
||||
spans[i] instanceof NumberSpan)
|
||||
if (s > 1 && ssb.charAt(s - 1) == '\n' &&
|
||||
e > 1 && ssb.charAt(e - 1) == '\n')
|
||||
f |= Spanned.SPAN_PARAGRAPH;
|
||||
|
||||
@@ -232,7 +232,8 @@ public class StyleHelper {
|
||||
}
|
||||
|
||||
if (alignment != null)
|
||||
t.setSpan(new AlignmentSpan.Standard(alignment), start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
t.setSpan(new AlignmentSpan.Standard(alignment),
|
||||
start, end, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE | Spanned.SPAN_PARAGRAPH);
|
||||
|
||||
etBody.setText(t);
|
||||
etBody.setSelection(start, end);
|
||||
|
||||
Reference in New Issue
Block a user