Refactor View.selected usage to View.activated

The View documentation recommends using activated to indicate whether or not a view is selected: https://developer.android.com/reference/android/view/View#setActivated(boolean)
This commit is contained in:
Moez Bhatti
2018-08-14 16:49:44 +02:00
parent a646291c51
commit 7be398ee06
8 changed files with 19 additions and 19 deletions
@@ -67,8 +67,8 @@ class MenuItemAdapter @Inject constructor(private val context: Context, private
val view = layoutInflater.inflate(R.layout.menu_list_item, parent, false)
val states = arrayOf(
intArrayOf(android.R.attr.state_selected),
intArrayOf(-android.R.attr.state_selected))
intArrayOf(android.R.attr.state_activated),
intArrayOf(-android.R.attr.state_activated))
val text = parent.context.resolveThemeColor(android.R.attr.textColorTertiary)
view.check.imageTintList = ColorStateList(states, intArrayOf(colors.theme().theme, text))
@@ -86,7 +86,7 @@ class MenuItemAdapter @Inject constructor(private val context: Context, private
val view = holder.itemView
view.title.text = menuItem.title
view.check.isSelected = (menuItem.actionId == selectedItem)
view.check.isActivated = (menuItem.actionId == selectedItem)
view.check.setVisible(selectedItem != null)
}