Skip to content

Commit 9159ecb

Browse files
committed
Use different strategies for MaterialYou and regular themes for popup icon colors
1 parent 677b408 commit 9159ecb

File tree

1 file changed

+6
-4
lines changed
  • app/src/main/kotlin/com/simplemobiletools/launcher/extensions

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import com.simplemobiletools.commons.extensions.getPopupMenuTheme
2525
import com.simplemobiletools.commons.extensions.getProperTextColor
2626
import com.simplemobiletools.commons.extensions.showErrorToast
2727
import com.simplemobiletools.commons.helpers.isQPlus
28+
import com.simplemobiletools.commons.helpers.isSPlus
2829
import com.simplemobiletools.launcher.R
2930
import com.simplemobiletools.launcher.activities.SettingsActivity
3031
import com.simplemobiletools.launcher.helpers.ITEM_TYPE_FOLDER
@@ -90,12 +91,13 @@ fun Activity.handleGridItemPopupMenu(anchorView: View, gridItem: HomeScreenGridI
9091

9192
inflate(R.menu.menu_app_icon)
9293
menu.forEach {
93-
val color = MaterialColors.getColor(contextTheme, android.R.attr.textColorPrimary, getProperTextColor())
94-
if (color != -1) {
95-
it.iconTintList = ColorStateList.valueOf(color)
94+
val default = getProperTextColor()
95+
val color = if (isSPlus() && config.isUsingSystemTheme) {
96+
default
9697
} else {
97-
it.iconTintList = ColorStateList.valueOf(getProperTextColor())
98+
MaterialColors.getColor(contextTheme, android.R.attr.actionMenuTextColor, default)
9899
}
100+
it.iconTintList = ColorStateList.valueOf(color)
99101
}
100102
menu.findItem(R.id.rename).isVisible = (gridItem.type == ITEM_TYPE_ICON || gridItem.type == ITEM_TYPE_FOLDER) && !isOnAllAppsFragment
101103
menu.findItem(R.id.hide_icon).isVisible = gridItem.type == ITEM_TYPE_ICON && isOnAllAppsFragment

0 commit comments

Comments
 (0)