forked from upstream-mirrors/quik
Fix initial selected state for pager title view
This commit is contained in:
@@ -70,6 +70,10 @@ class PagerTitleView @JvmOverloads constructor(context: Context, attrs: Attribut
|
|||||||
addView(view)
|
addView(view)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
childCount.forEach { index ->
|
||||||
|
getChildAt(index).isSelected = index == pager?.currentItem
|
||||||
|
}
|
||||||
|
|
||||||
pager?.addOnPageChangeListener(object : ViewPager.SimpleOnPageChangeListener() {
|
pager?.addOnPageChangeListener(object : ViewPager.SimpleOnPageChangeListener() {
|
||||||
override fun onPageSelected(position: Int) {
|
override fun onPageSelected(position: Int) {
|
||||||
childCount.forEach { index ->
|
childCount.forEach { index ->
|
||||||
|
|||||||
Reference in New Issue
Block a user