Mirkoddd / TabBarView

An Android Library to help you create actionbar tabs like "Capitaine train" app by Cyril Mottier
504 stars 93 forks source link

Fix not use addOnGlobalLayoutListener to get mSelectedTab #9

Open xingstarx opened 8 years ago

xingstarx commented 8 years ago

In some devices, mSelectedTab from PageListener onPageScrolled is not always equals pager.getCurrentItem()

afater debug OnPageChangeListener onPageScrolled event. i get mSelectedTab values is only 0, 0 , 1 when I scroll the three Tab in one samsung device but after I call notifyDataSetChanged() I get mSelectedTab = mViewPager.getCurrentItem() is 1 when the tab selected in the second Tab , is't not equals 0

and not need use addOnGlobalLayoutListener to get mSelectedTab values

mSelectedTab always record afater onPageScrolled called