Added many messages selected warning

pull/190/head
M66B 4 years ago
parent 8340ac370c
commit 1aca09e74a

@ -4452,7 +4452,19 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
private void updateMore() { private void updateMore() {
if (selectionTracker != null && selectionTracker.hasSelection()) { if (selectionTracker != null && selectionTracker.hasSelection()) {
fabMore.show(); 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); tvSelectedCount.setVisibility(View.VISIBLE);
} else { } else {
fabMore.hide(); fabMore.hide();

Loading…
Cancel
Save