Small improvements

pull/212/head
M66B 2 years ago
parent 06d18dc758
commit 284e1e181e

@ -334,7 +334,7 @@ public class EntityAnswer implements Serializable {
continue; continue;
order++; order++;
SpannableStringBuilder ssb = new SpannableStringBuilder(answer.name); SpannableStringBuilder ssb = new SpannableStringBuilderEx(answer.name);
if (answer.color != null) { if (answer.color != null) {
Drawable d = new ColorDrawable(answer.color); Drawable d = new ColorDrawable(answer.color);
@ -434,7 +434,7 @@ public class EntityAnswer implements Serializable {
icon.setTint(color); icon.setTint(color);
for (EntityAnswer answer : favorites) { for (EntityAnswer answer : favorites) {
SpannableStringBuilder ssb = new SpannableStringBuilder(answer.name); SpannableStringBuilder ssb = new SpannableStringBuilderEx(answer.name);
if (answer.color != null) { if (answer.color != null) {
Drawable d = new ColorDrawable(answer.color); Drawable d = new ColorDrawable(answer.color);

@ -3485,7 +3485,7 @@ public class FragmentMessages extends FragmentBase
if (data.answers != null) { if (data.answers != null) {
int order = 100; int order = 100;
for (EntityAnswer answer : data.answers) { for (EntityAnswer answer : data.answers) {
SpannableStringBuilder ssb = new SpannableStringBuilder(answer.name); SpannableStringBuilder ssb = new SpannableStringBuilderEx(answer.name);
if (answer.color != null) { if (answer.color != null) {
int first = answer.name.codePointAt(0); int first = answer.name.codePointAt(0);

@ -700,7 +700,7 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
args.putBoolean("import_settings", vme.getOption("settings")); args.putBoolean("import_settings", vme.getOption("settings"));
new SimpleTask<Void>() { new SimpleTask<Void>() {
private SpannableStringBuilder ssb = new SpannableStringBuilder(); private SpannableStringBuilder ssb = new SpannableStringBuilderEx();
@Override @Override
protected void onProgress(CharSequence status, Bundle data) { protected void onProgress(CharSequence status, Bundle data) {
@ -868,7 +868,7 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
EntityAccount existing = db.account().getAccountByUUID(account.uuid); EntityAccount existing = db.account().getAccountByUUID(account.uuid);
if (existing != null) { if (existing != null) {
SpannableStringBuilder ssb = new SpannableStringBuilder(); SpannableStringBuilder ssb = new SpannableStringBuilderEx();
ssb.append(context.getString(R.string.title_importing_exists)); ssb.append(context.getString(R.string.title_importing_exists));
ssb.setSpan(new StyleSpan(Typeface.BOLD), 0, ssb.length(), 0); ssb.setSpan(new StyleSpan(Typeface.BOLD), 0, ssb.length(), 0);
postProgress(ssb); postProgress(ssb);
@ -879,7 +879,7 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
if (account.auth_type == AUTH_TYPE_GMAIL && if (account.auth_type == AUTH_TYPE_GMAIL &&
GmailState.getAccount(context, account.user) == null) { GmailState.getAccount(context, account.user) == null) {
SpannableStringBuilder ssb = new SpannableStringBuilder(); SpannableStringBuilder ssb = new SpannableStringBuilderEx();
ssb.append(account.name).append(": "); ssb.append(account.name).append(": ");
ssb.append(context.getString(R.string.title_importing_wizard)); ssb.append(context.getString(R.string.title_importing_wizard));
ssb.setSpan(new StyleSpan(Typeface.BOLD), 0, ssb.length(), 0); ssb.setSpan(new StyleSpan(Typeface.BOLD), 0, ssb.length(), 0);
@ -1230,7 +1230,7 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
ServiceSynchronize.eval(context, "import"); ServiceSynchronize.eval(context, "import");
Log.i("Imported data"); Log.i("Imported data");
SpannableStringBuilder ssb = new SpannableStringBuilder(); SpannableStringBuilder ssb = new SpannableStringBuilderEx();
ssb.append(context.getString(R.string.title_setup_imported)); ssb.append(context.getString(R.string.title_setup_imported));
ssb.setSpan(new StyleSpan(Typeface.BOLD), 0, ssb.length(), 0); ssb.setSpan(new StyleSpan(Typeface.BOLD), 0, ssb.length(), 0);
postProgress(ssb, null); postProgress(ssb, null);
@ -1242,7 +1242,7 @@ public class FragmentOptionsBackup extends FragmentBase implements SharedPrefere
if (ex instanceof NoStreamException) if (ex instanceof NoStreamException)
((NoStreamException) ex).report(getActivity()); ((NoStreamException) ex).report(getActivity());
else { else {
SpannableStringBuilder ssb = new SpannableStringBuilder(); SpannableStringBuilder ssb = new SpannableStringBuilderEx();
if (ex.getCause() instanceof BadPaddingException /* GCM: AEADBadTagException */) if (ex.getCause() instanceof BadPaddingException /* GCM: AEADBadTagException */)
ssb.append(getString(R.string.title_setup_password_invalid)); ssb.append(getString(R.string.title_setup_password_invalid));
else if (ex instanceof IOException && ex.getCause() instanceof IllegalBlockSizeException) else if (ex instanceof IOException && ex.getCause() instanceof IllegalBlockSizeException)

Loading…
Cancel
Save