forked from upstream-mirrors/quik
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:
@@ -71,13 +71,13 @@ class PagerTitleView @JvmOverloads constructor(context: Context, attrs: Attribut
|
||||
}
|
||||
|
||||
childCount.forEach { index ->
|
||||
getChildAt(index).isSelected = index == pager?.currentItem
|
||||
getChildAt(index).isActivated = index == pager?.currentItem
|
||||
}
|
||||
|
||||
pager?.addOnPageChangeListener(object : ViewPager.SimpleOnPageChangeListener() {
|
||||
override fun onPageSelected(position: Int) {
|
||||
childCount.forEach { index ->
|
||||
getChildAt(index).isSelected = index == position
|
||||
getChildAt(index).isActivated = index == position
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -87,8 +87,8 @@ class PagerTitleView @JvmOverloads constructor(context: Context, attrs: Attribut
|
||||
super.onAttachedToWindow()
|
||||
|
||||
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))
|
||||
|
||||
threadId
|
||||
.distinctUntilChanged()
|
||||
|
||||
Reference in New Issue
Block a user