1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-02-24 23:12:55 +00:00

Added span logging

This commit is contained in:
M66B 2022-01-03 19:23:36 +01:00
parent ff8f3c8dcb
commit c7b60c3c7b

View file

@ -55,6 +55,7 @@ import android.os.RemoteException;
import android.os.TransactionTooLargeException;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Printer;
import android.view.Display;
import android.view.InflateException;
import android.view.LayoutInflater;
@ -2517,4 +2518,17 @@ public class Log {
static InternetAddress myAddress() throws UnsupportedEncodingException {
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;
}
}