small refactoring

This commit is contained in:
Nazar-Kutz 2020-08-11 13:18:28 +03:00
parent 20ed7474ab
commit 5865dbe54a

View file

@ -514,14 +514,13 @@ public class UiUtilities {
public static void setupToolbarOverflowIcon(Toolbar toolbar, @DrawableRes int iconId, @ColorRes int colorId) {
Context ctx = toolbar.getContext();
if (ctx != null) {
return;
}
Drawable icon = ContextCompat.getDrawable(ctx, iconId);
toolbar.setOverflowIcon(icon);
if (icon != null) {
int color = ContextCompat.getColor(ctx, colorId);
DrawableCompat.setTint(icon.mutate(), color);
Drawable icon = ContextCompat.getDrawable(ctx, iconId);
toolbar.setOverflowIcon(icon);
if (icon != null) {
int color = ContextCompat.getColor(ctx, colorId);
DrawableCompat.setTint(icon.mutate(), color);
toolbar.setOverflowIcon(icon);
}
}
}