I have a tabLayout with three tabs I want to be able the selected tab to move to index zero after selection just as demonstrated here
private val fragList by lazy {
arrayListOf<Fragment>(
MainFragment.newInstance("Hello", "Fragment $0"),
MainFragment.newInstance("Hello", "Fragment $1"),
MainFragment.newInstance("Hello", "Fragment $2")
)
}
private val bottomSheetViewPagerAdapter by lazy {
ViewPagerAdapter(this, 3) {
fragList[it]
}
}
private val viewPagerScrollListener by lazy {
object :ViewPager2.OnPageChangeCallback(){
override fun onPageSelected(position: Int) {
super.onPageSelected(position)
Log.i("ViewPagerScroll", "$position")
}
}
}
Any suggestion on how to achieve that
question from:
https://stackoverflow.com/questions/65626094/rearranging-tabs-in-tablayout 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…