Always use the same color as text uses in popups

This commit is contained in:
Ensar Sarajčić 2023-09-06 10:29:38 +02:00
parent 73224b436f
commit 9bfff57405
1 changed files with 3 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import android.view.Gravity
import android.view.View import android.view.View
import android.widget.PopupMenu import android.widget.PopupMenu
import androidx.core.view.forEach import androidx.core.view.forEach
import com.google.android.material.color.MaterialColors
import com.simplemobiletools.commons.extensions.getPopupMenuTheme import com.simplemobiletools.commons.extensions.getPopupMenuTheme
import com.simplemobiletools.commons.extensions.getProperTextColor import com.simplemobiletools.commons.extensions.getProperTextColor
import com.simplemobiletools.commons.extensions.showErrorToast import com.simplemobiletools.commons.extensions.showErrorToast
@ -81,7 +82,8 @@ fun Activity.handleGridItemPopupMenu(anchorView: View, gridItem: HomeScreenGridI
inflate(R.menu.menu_app_icon) inflate(R.menu.menu_app_icon)
menu.forEach { menu.forEach {
it.iconTintList = ColorStateList.valueOf(getProperTextColor()) val color = MaterialColors.getColor(contextTheme, android.R.attr.textColorPrimary, getProperTextColor())
it.iconTintList = ColorStateList.valueOf(color)
} }
menu.findItem(R.id.rename).isVisible = (gridItem.type == ITEM_TYPE_ICON || gridItem.type == ITEM_TYPE_FOLDER) && !isOnAllAppsFragment menu.findItem(R.id.rename).isVisible = (gridItem.type == ITEM_TYPE_ICON || gridItem.type == ITEM_TYPE_FOLDER) && !isOnAllAppsFragment
menu.findItem(R.id.hide_icon).isVisible = gridItem.type == ITEM_TYPE_ICON && isOnAllAppsFragment menu.findItem(R.id.hide_icon).isVisible = gridItem.type == ITEM_TYPE_ICON && isOnAllAppsFragment