Closed nawanirakshit closed 3 weeks ago
I am trying to add an item at the 0th position, but after adding the item, the
The code looks like the following for the adapter.
inner class ScreenSlidePagerAdapter(fa: FragmentActivity) : FragmentStateAdapter(fa) { override fun getItemCount(): Int { return list.size } override fun createFragment(position: Int): Fragment = ScrollFragment(list[position]) fun addFragment(string: String) { list.add(string) notifyItemInserted(list.size) } fun addAtPreviousFragment(string: String) { list.add(0, string) notifyItemInserted(0) } }
Captured a screenshot for the same https://drive.google.com/file/d/19-jY-xKx8IYXH2pk3-p0qtUPZJPavyZy/view
Sample code repository https://github.com/nawanirakshit/ViewPagerCheck
I am trying to add an item at the 0th position, but after adding the item, the
The code looks like the following for the adapter.
Captured a screenshot for the same https://drive.google.com/file/d/19-jY-xKx8IYXH2pk3-p0qtUPZJPavyZy/view
Sample code repository https://github.com/nawanirakshit/ViewPagerCheck