Mark inserted templates

This commit is contained in:
M66B
2022-05-03 13:13:26 +02:00
parent 753c8f2fec
commit 83cb57b006
2 changed files with 19 additions and 17 deletions

View File

@@ -82,7 +82,7 @@ public class StyleHelper {
StrikethroughSpan.class,
URLSpan.class,
TypefaceSpan.class, CustomTypefaceSpan.class,
TranslatedSpan.class
InsertedSpan.class
));
static boolean apply(int action, LifecycleOwner owner, View anchor, EditText etBody, Object... args) {
@@ -956,13 +956,13 @@ public class StyleHelper {
}
}
static void markAsTranslated(Editable text, int start, int end) {
for (TranslatedSpan span : text.getSpans(0, text.length(), TranslatedSpan.class))
static void markAsInserted(Editable text, int start, int end) {
for (InsertedSpan span : text.getSpans(0, text.length(), InsertedSpan.class))
text.removeSpan(span);
text.setSpan(new TranslatedSpan(), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
text.setSpan(new InsertedSpan(), start, end, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
}
static class TranslatedSpan implements NoCopySpan {
static class InsertedSpan implements NoCopySpan {
}
static String getFamily(String family) {