mirror of
https://github.com/SimpleMobileTools/Simple-Clock.git
synced 2025-04-08 23:51:00 +02:00
Merge pull request #495 from esensar/fix/sort-rotation
Fix issue with sort not working after rotating device
This commit is contained in:
commit
c88b9af155
@ -15,8 +15,14 @@ class ViewPagerAdapter(fm: FragmentManager) : FragmentStatePagerAdapter(fm) {
|
|||||||
private val fragments = HashMap<Int, Fragment>()
|
private val fragments = HashMap<Int, Fragment>()
|
||||||
|
|
||||||
override fun getItem(position: Int): Fragment {
|
override fun getItem(position: Int): Fragment {
|
||||||
val fragment = getFragment(position)
|
return getFragment(position)
|
||||||
fragments[position] = fragment
|
}
|
||||||
|
|
||||||
|
override fun instantiateItem(container: ViewGroup, position: Int): Any {
|
||||||
|
val fragment = super.instantiateItem(container, position)
|
||||||
|
if (fragment is Fragment) {
|
||||||
|
fragments[position] = fragment
|
||||||
|
}
|
||||||
return fragment
|
return fragment
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user