Small improvement

pull/213/head
M66B 1 year ago
parent 4f239a8741
commit e0d456a39b

@ -664,8 +664,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
DynamicDrawableSpan[] ddss = buffer.getSpans(off, off, DynamicDrawableSpan.class); DynamicDrawableSpan[] ddss = buffer.getSpans(off, off, DynamicDrawableSpan.class);
if (ddss.length > 0) { if (ddss.length > 0) {
int s = buffer.getSpanStart(ddss[0]); int f = buffer.getSpanFlags(ddss[0]);
properties.setValue("quotes", message.id, buffer.charAt(s) != '0'); properties.setValue("quotes", message.id, (f & Spanned.SPAN_USER) == 0);
properties.setHeight(message.id, null); properties.setHeight(message.id, null);
bindBody(message, false); bindBody(message, false);
return true; return true;
@ -3195,7 +3195,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
continue; continue;
if (show_quotes) { if (show_quotes) {
ssb.insert(s - 1, "\n0"); ssb.insert(s - 1, "\n ");
ssb.setSpan( ssb.setSpan(
new DynamicDrawableSpan() { new DynamicDrawableSpan() {
@Override @Override
@ -3203,12 +3203,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
return d; return d;
} }
}, },
s, s + 1, Spanned.SPAN_INCLUSIVE_INCLUSIVE); s, s + 1, Spanned.SPAN_INCLUSIVE_INCLUSIVE | Spanned.SPAN_USER);
} else { } else {
for (Object span : ssb.getSpans(s, e, Object.class)) for (Object span : ssb.getSpans(s, e, Object.class))
ssb.removeSpan(span); ssb.removeSpan(span);
ssb.delete(s, e); ssb.delete(s, e);
ssb.insert(s - 1, "\n1"); ssb.insert(s - 1, "\n ");
ssb.setSpan( ssb.setSpan(
new DynamicDrawableSpan() { new DynamicDrawableSpan() {
@Override @Override

Loading…
Cancel
Save