Simplification

This commit is contained in:
M66B
2021-01-23 09:28:51 +01:00
parent fb4d4d51f7
commit eba5b0f839
6 changed files with 20 additions and 22 deletions

View File

@@ -2003,7 +2003,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
else
icon = EntityFolder.getIcon(dX > 0 ? swipes.right_type : swipes.left_type);
Drawable d = getResources().getDrawable(icon, context.getTheme()).mutate();
Drawable d = context.getDrawable(icon).mutate();
d.setTint(Helper.resolveColor(context, android.R.attr.textColorSecondary));
if (dX > 0) {
@@ -4512,7 +4512,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
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());
Drawable w = context.getDrawable(R.drawable.twotone_warning_24);
w.setBounds(0, 0, ts, ts);
w.setTint(tvSelectedCount.getCurrentTextColor());
tvSelectedCount.setCompoundDrawablesRelative(null, null, w, null);
@@ -7999,7 +7999,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
Drawable source = null;
if (sources.size() == 1) {
source = getResources().getDrawable(EntityFolder.getIcon(sources.get(0)), null);
source = getContext().getDrawable(EntityFolder.getIcon(sources.get(0)));
if (source != null)
source.setBounds(0, 0, source.getIntrinsicWidth(), source.getIntrinsicHeight());
if (sourceColor == null)
@@ -8009,7 +8009,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
Drawable target = null;
if (targets.size() == 1) {
target = getResources().getDrawable(EntityFolder.getIcon(targets.get(0)), null);
target = getContext().getDrawable(EntityFolder.getIcon(targets.get(0)));
if (target != null)
target.setBounds(0, 0, target.getIntrinsicWidth(), target.getIntrinsicHeight());
if (targetColor == null)