mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-02 13:14:39 +00:00
Added menu item icon disable state
This commit is contained in:
parent
cdc0cba3f2
commit
32b0094388
1 changed files with 8 additions and 2 deletions
|
@ -106,8 +106,14 @@ public class PopupMenuLifecycle extends PopupMenu implements LifecycleObserver {
|
|||
|
||||
if (icon == null)
|
||||
icon = new ColorDrawable(Color.TRANSPARENT);
|
||||
else
|
||||
icon.setTint(Helper.resolveColor(context, R.attr.colorAccent));
|
||||
else {
|
||||
int color = Helper.resolveColor(context, R.attr.colorAccent);
|
||||
icon.setTint(color);
|
||||
if (!menuItem.isEnabled()) {
|
||||
icon.mutate();
|
||||
icon.setAlpha(Math.round(Helper.LOW_LIGHT * 255));
|
||||
}
|
||||
}
|
||||
|
||||
int iconSize = context.getResources().getDimensionPixelSize(R.dimen.menu_item_icon_size);
|
||||
icon.setBounds(0, 0, iconSize, iconSize);
|
||||
|
|
Loading…
Reference in a new issue