Added span logging

pull/194/merge
M66B 3 years ago
parent ff8f3c8dcb
commit c7b60c3c7b

@ -55,6 +55,7 @@ import android.os.RemoteException;
import android.os.TransactionTooLargeException; import android.os.TransactionTooLargeException;
import android.provider.Settings; import android.provider.Settings;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Printer;
import android.view.Display; import android.view.Display;
import android.view.InflateException; import android.view.InflateException;
import android.view.LayoutInflater; import android.view.LayoutInflater;
@ -2517,4 +2518,17 @@ public class Log {
static InternetAddress myAddress() throws UnsupportedEncodingException { static InternetAddress myAddress() throws UnsupportedEncodingException {
return new InternetAddress("marcel+fairemail@faircode.eu", "FairCode", StandardCharsets.UTF_8.name()); return new InternetAddress("marcel+fairemail@faircode.eu", "FairCode", StandardCharsets.UTF_8.name());
} }
static StringBuilder getSpans(CharSequence text) {
StringBuilder sb = new StringBuilder();
TextUtils.dumpSpans(text, new Printer() {
@Override
public void println(String x) {
if (sb.length() > 0)
sb.append(' ');
sb.append(x.replace('\n', '|')).append(']');
}
}, "[");
return sb;
}
} }

Loading…
Cancel
Save