Skip to content

Commit 677b408

Browse files
committed
Fix popup menu colors when MaterialColors returns -1
1 parent 8202e5d commit 677b408

File tree

1 file changed

+5
-1
lines changed
  • app/src/main/kotlin/com/simplemobiletools/launcher/extensions

1 file changed

+5
-1
lines changed

app/src/main/kotlin/com/simplemobiletools/launcher/extensions/Activity.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,11 @@ fun Activity.handleGridItemPopupMenu(anchorView: View, gridItem: HomeScreenGridI
9191
inflate(R.menu.menu_app_icon)
9292
menu.forEach {
9393
val color = MaterialColors.getColor(contextTheme, android.R.attr.textColorPrimary, getProperTextColor())
94-
it.iconTintList = ColorStateList.valueOf(color)
94+
if (color != -1) {
95+
it.iconTintList = ColorStateList.valueOf(color)
96+
} else {
97+
it.iconTintList = ColorStateList.valueOf(getProperTextColor())
98+
}
9599
}
96100
menu.findItem(R.id.rename).isVisible = (gridItem.type == ITEM_TYPE_ICON || gridItem.type == ITEM_TYPE_FOLDER) && !isOnAllAppsFragment
97101
menu.findItem(R.id.hide_icon).isVisible = gridItem.type == ITEM_TYPE_ICON && isOnAllAppsFragment

0 commit comments

Comments
 (0)