Fix ContextMenuAdapter crash
This commit is contained in:
parent
1e23752217
commit
194ed37f51
1 changed files with 6 additions and 2 deletions
|
@ -186,8 +186,12 @@ public class ContextMenuAdapter {
|
||||||
} else {
|
} else {
|
||||||
if (item.getIcon() != ContextMenuItem.INVALID_ID) {
|
if (item.getIcon() != ContextMenuItem.INVALID_ID) {
|
||||||
int colorRes = item.getColorRes();
|
int colorRes = item.getColorRes();
|
||||||
if (colorRes == ContextMenuItem.INVALID_ID && !item.shouldSkipPainting()) {
|
if (colorRes == ContextMenuItem.INVALID_ID) {
|
||||||
colorRes = lightTheme ? R.color.icon_color : R.color.color_white;
|
if (!item.shouldSkipPainting()) {
|
||||||
|
colorRes = lightTheme ? R.color.icon_color : R.color.color_white;
|
||||||
|
} else {
|
||||||
|
colorRes = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
final Drawable drawable = mIconsCache.getIcon(item.getIcon(), colorRes);
|
final Drawable drawable = mIconsCache.getIcon(item.getIcon(), colorRes);
|
||||||
((AppCompatImageView) convertView.findViewById(R.id.icon)).setImageDrawable(drawable);
|
((AppCompatImageView) convertView.findViewById(R.id.icon)).setImageDrawable(drawable);
|
||||||
|
|
Loading…
Reference in a new issue