Use account colored letter

pull/194/merge
M66B 3 years ago
parent 3a8c44a94b
commit d3a9f3b1bb

@ -20,6 +20,7 @@ package eu.faircode.email;
*/ */
import static android.app.Activity.RESULT_OK; import static android.app.Activity.RESULT_OK;
import static android.graphics.Typeface.BOLD;
import static android.text.format.DateUtils.DAY_IN_MILLIS; import static android.text.format.DateUtils.DAY_IN_MILLIS;
import static android.text.format.DateUtils.FORMAT_SHOW_DATE; import static android.text.format.DateUtils.FORMAT_SHOW_DATE;
import static android.text.format.DateUtils.FORMAT_SHOW_WEEKDAY; import static android.text.format.DateUtils.FORMAT_SHOW_WEEKDAY;
@ -3356,6 +3357,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
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); 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);
} }
MenuItem item = popupMenu.getMenu().add(Menu.FIRST, R.string.title_move_to_account, order++, ss) MenuItem item = popupMenu.getMenu().add(Menu.FIRST, R.string.title_move_to_account, order++, ss)
.setIcon(R.drawable.twotone_drive_file_move_24); .setIcon(R.drawable.twotone_drive_file_move_24);
@ -5021,7 +5024,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
SpannableStringBuilder all = new SpannableStringBuilderEx(getString(R.string.title_language_all)); SpannableStringBuilder all = new SpannableStringBuilderEx(getString(R.string.title_language_all));
if (current == null) { if (current == null) {
all.setSpan(new StyleSpan(Typeface.BOLD), 0, all.length(), 0); all.setSpan(new StyleSpan(BOLD), 0, all.length(), 0);
all.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_LARGE), 0, all.length(), 0); all.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_LARGE), 0, all.length(), 0);
} }
@ -5032,7 +5035,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
String language = locale.getLanguage(); String language = locale.getLanguage();
SpannableStringBuilder title = new SpannableStringBuilderEx(locale.getDisplayLanguage()); SpannableStringBuilder title = new SpannableStringBuilderEx(locale.getDisplayLanguage());
if (language.equals(current)) { if (language.equals(current)) {
title.setSpan(new StyleSpan(Typeface.BOLD), 0, title.length(), 0); title.setSpan(new StyleSpan(BOLD), 0, title.length(), 0);
title.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_LARGE), 0, title.length(), 0); title.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_LARGE), 0, title.length(), 0);
} }
popupMenu.getMenu() popupMenu.getMenu()

Loading…
Cancel
Save