mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-27 10:17:18 +00:00
Added paragraph destroyer
This commit is contained in:
parent
71b919b40d
commit
7ebca45d28
1 changed files with 11 additions and 1 deletions
|
@ -500,7 +500,7 @@ public class FragmentCompose extends FragmentBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void beforeTextChanged(CharSequence text, int start, int count, int after) {
|
public void beforeTextChanged(CharSequence text, int start, int count, int after) {
|
||||||
if (count == 1 && after == 0 && text.charAt(start) == '\n') {
|
if (count == 1 && after == 0 && (start == 0 || text.charAt(start) == '\n')) {
|
||||||
Log.i("Removed=" + start);
|
Log.i("Removed=" + start);
|
||||||
removed = start;
|
removed = start;
|
||||||
}
|
}
|
||||||
|
@ -607,7 +607,17 @@ public class FragmentCompose extends FragmentBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (removed != null) {
|
if (removed != null) {
|
||||||
|
ParagraphStyle[] ps = text.getSpans(removed, removed + 1, ParagraphStyle.class);
|
||||||
|
if (ps != null)
|
||||||
|
for (ParagraphStyle p : ps) {
|
||||||
|
int start = text.getSpanStart(p);
|
||||||
|
int end = text.getSpanEnd(p);
|
||||||
|
if (start == removed && end == removed + 1)
|
||||||
|
text.removeSpan(p);
|
||||||
|
}
|
||||||
|
|
||||||
StyleHelper.renumber(text, true, etBody.getContext());
|
StyleHelper.renumber(text, true, etBody.getContext());
|
||||||
|
|
||||||
removed = null;
|
removed = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue