Small font size for less likely move target

pull/194/merge
M66B 4 years ago
parent 599f0f1712
commit 6eefebb8bb

@ -228,6 +228,7 @@ import java.util.Collections;
import java.util.Comparator; import java.util.Comparator;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Map; import java.util.Map;
@ -3283,9 +3284,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
if (result.hasTrash == null) result.hasTrash = false; if (result.hasTrash == null) result.hasTrash = false;
if (result.hasJunk == null) result.hasJunk = false; if (result.hasJunk == null) result.hasJunk = false;
result.accounts = new ArrayList<>(); result.accounts = new LinkedHashMap<>();
if (!result.hasPop) if (!result.hasPop) {
result.accounts.addAll(db.account().getSynchronizingAccounts(EntityAccount.TYPE_IMAP)); List<EntityAccount> syncing = db.account().getSynchronizingAccounts(EntityAccount.TYPE_IMAP);
if (syncing != null)
for (EntityAccount a : syncing)
result.accounts.put(a, accounts.containsKey(a.id));
}
if (result.folders.size() > 1) if (result.folders.size() > 1)
result.folders = new ArrayList<>(); result.folders = new ArrayList<>();
@ -3372,18 +3377,20 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
leave ? R.string.title_trash : R.string.title_delete_permanently) leave ? R.string.title_trash : R.string.title_delete_permanently)
.setIcon(leave ? R.drawable.twotone_delete_24 : R.drawable.twotone_delete_forever_24); .setIcon(leave ? R.drawable.twotone_delete_24 : R.drawable.twotone_delete_forever_24);
for (EntityAccount account : result.accounts) { for (EntityAccount account : result.accounts.keySet()) {
String title = getString(R.string.title_move_to_account, account.name); String title = getString(R.string.title_move_to_account, account.name);
SpannableString ss = new SpannableString(title); SpannableString ssb = new SpannableString(title);
if (account.name != null && account.color != null) { if (account.name != null && account.color != null) {
int i = title.indexOf(account.name); int i = title.indexOf(account.name);
int first = title.codePointAt(i); int first = title.codePointAt(i);
int count = Character.charCount(first); int count = Character.charCount(first);
ss.setSpan(new ForegroundColorSpan(account.color), i, i + count, 0); ssb.setSpan(new ForegroundColorSpan(account.color), i, i + count, 0);
ss.setSpan(new StyleSpan(Typeface.BOLD), i, i + count, 0); ssb.setSpan(new StyleSpan(Typeface.BOLD), i, i + count, 0);
ss.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_LARGE), i, i + count, 0); ssb.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_LARGE), i, i + count, 0);
} }
MenuItem item = popupMenu.getMenu().add(Menu.FIRST, R.string.title_move_to_account, order++, ss) if (!result.accounts.get(account))
ssb.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_SMALL), 0, ssb.length(), 0);
MenuItem item = popupMenu.getMenu().add(Menu.FIRST, R.string.title_move_to_account, order++, ssb)
.setIcon(R.drawable.twotone_drive_file_move_24); .setIcon(R.drawable.twotone_drive_file_move_24);
item.setIntent(new Intent().putExtra("account", account.id)); item.setIntent(new Intent().putExtra("account", account.id));
} }
@ -9096,7 +9103,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
Boolean leave_deleted; Boolean leave_deleted;
boolean read_only; boolean read_only;
List<Long> folders; List<Long> folders;
List<EntityAccount> accounts; Map<EntityAccount, Boolean> accounts;
EntityAccount copyto; EntityAccount copyto;
} }

Loading…
Cancel
Save