mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 14:40:06 +08:00
fix: GroupPagerAdapter crash
This commit is contained in:
parent
1b15199ee2
commit
2c6bfc1e51
@ -886,16 +886,18 @@ class ConfigurationFragment @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val runFunc = if (now) requireActivity()::runOnUiThread else groupPager::post
|
val runFunc = if (now) activity?.let { it::runOnUiThread } else groupPager::post
|
||||||
runFunc {
|
if (runFunc != null) {
|
||||||
groupList = newGroupList
|
runFunc {
|
||||||
notifyDataSetChanged()
|
groupList = newGroupList
|
||||||
if (set) groupPager.setCurrentItem(selectedGroupIndex, false)
|
notifyDataSetChanged()
|
||||||
val hideTab = groupList.size < 2
|
if (set) groupPager.setCurrentItem(selectedGroupIndex, false)
|
||||||
tabLayout.isGone = hideTab
|
val hideTab = groupList.size < 2
|
||||||
toolbar.elevation = if (hideTab) 0F else dp2px(4).toFloat()
|
tabLayout.isGone = hideTab
|
||||||
if (!select) {
|
toolbar.elevation = if (hideTab) 0F else dp2px(4).toFloat()
|
||||||
groupPager.registerOnPageChangeCallback(updateSelectedCallback)
|
if (!select) {
|
||||||
|
groupPager.registerOnPageChangeCallback(updateSelectedCallback)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user