Added many messages selected warning

This commit is contained in:
M66B 2020-12-04 08:50:33 +01:00
parent 8340ac370c
commit 1aca09e74a
1 changed files with 13 additions and 1 deletions

View File

@ -4452,7 +4452,19 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
private void updateMore() {
if (selectionTracker != null && selectionTracker.hasSelection()) {
fabMore.show();
tvSelectedCount.setText(NF.format(selectionTracker.getSelection().size()));
Context context = tvSelectedCount.getContext();
int count = selectionTracker.getSelection().size();
tvSelectedCount.setText(NF.format(count));
if (count > (BuildConfig.DEBUG ? 10 : MAX_MORE)) {
int ts = Math.round(tvSelectedCount.getTextSize());
Drawable w = context.getResources().getDrawable(R.drawable.twotone_warning_24, context.getTheme());
w.setBounds(0, 0, ts, ts);
w.setTint(tvSelectedCount.getCurrentTextColor());
tvSelectedCount.setCompoundDrawablesRelative(null, null, w, null);
tvSelectedCount.setCompoundDrawablePadding(ts / 2);
} else
tvSelectedCount.setCompoundDrawablesRelative(null, null, null, null);
tvSelectedCount.setVisibility(View.VISIBLE);
} else {
fabMore.hide();