EasyTabs
EasyTabs copied to clipboard
bug: setCurrentItem() does not scroll tab to proper position
hi i found a bug when setting current page of viewpager programatically. i have this piece of code:
`EasyTabsBuilder.with(mTabs)
.addTabs(tabsArray)
.setTabLayoutScrollable(true)
.Build();
mTabs.getViewPager().setCurrentItem(tabToSelect);`
the content is fine, it shows the tabToSelect fragment. however the tablayout is not scrolling and still showing original position.
see these photo:

notice that the content says "10" - thats the content for tab number 10, but the tab layout is still in the initial position
this is working:
EasyTabsBuilder.with(mTabs)
.addTabs(tabsArray)
.setTabLayoutScrollable(true)
.Build();
mTabs.post(new Runnable()
{
@Override
public void run()
{
mTabs.getViewPager().setCurrentItem(tabToSelect);
}
});