mirror of https://github.com/M66B/FairEmail.git
Small font size for less likely move target
This commit is contained in:
parent
599f0f1712
commit
6eefebb8bb
|
@ -228,6 +228,7 @@ import java.util.Collections;
|
|||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
@ -3283,9 +3284,13 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
if (result.hasTrash == null) result.hasTrash = false;
|
||||
if (result.hasJunk == null) result.hasJunk = false;
|
||||
|
||||
result.accounts = new ArrayList<>();
|
||||
if (!result.hasPop)
|
||||
result.accounts.addAll(db.account().getSynchronizingAccounts(EntityAccount.TYPE_IMAP));
|
||||
result.accounts = new LinkedHashMap<>();
|
||||
if (!result.hasPop) {
|
||||
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)
|
||||
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)
|
||||
.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);
|
||||
SpannableString ss = new SpannableString(title);
|
||||
SpannableString ssb = new SpannableString(title);
|
||||
if (account.name != null && account.color != null) {
|
||||
int i = title.indexOf(account.name);
|
||||
int first = title.codePointAt(i);
|
||||
int count = Character.charCount(first);
|
||||
ss.setSpan(new ForegroundColorSpan(account.color), i, i + count, 0);
|
||||
ss.setSpan(new StyleSpan(Typeface.BOLD), i, i + count, 0);
|
||||
ss.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_LARGE), i, i + count, 0);
|
||||
ssb.setSpan(new ForegroundColorSpan(account.color), i, i + count, 0);
|
||||
ssb.setSpan(new StyleSpan(Typeface.BOLD), 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);
|
||||
item.setIntent(new Intent().putExtra("account", account.id));
|
||||
}
|
||||
|
@ -9096,7 +9103,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
Boolean leave_deleted;
|
||||
boolean read_only;
|
||||
List<Long> folders;
|
||||
List<EntityAccount> accounts;
|
||||
Map<EntityAccount, Boolean> accounts;
|
||||
EntityAccount copyto;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue