I'm using TabPageIndicator from ViewPagerIndicator lib with ViewPager to display 6 fragments. Suppose I'm on 1st page, if I click 6th tab I'll see all my pages scrolled. Is it possible to disable this animation? Maybe I can somehow disable it in ViewPager?
Here is code of adapter:
public class TabBarFragmentPagerAdapter extends FragmentPagerAdapter implements IconPagerAdapter {
private final List<Fragment> items;
private static final String[] TITLES = new String[] { "Home", "Profile", "Explore", "Contacts", "Beacon" };
private static final int[] ICONS = new int[] {
R.drawable.icon_tabbar_home_bg,
R.drawable.icon_tabbar_profile_bg,
R.drawable.icon_tabbar_explore_bg,
R.drawable.icon_tabbar_contacts_bg,
R.drawable.icon_tabbar_beacon_bg
};
public TabBarFragmentPagerAdapter(FragmentManager fm, List<Fragment> items) {
super(fm);
this.items = items;
}
@Override
public Fragment getItem(int position) {
return items.get(position);
}
@Override
public int getIconResId(int index) {
return ICONS[index];
}
@Override
public CharSequence getPageTitle(int position) {
return TITLES[position];
}
@Override
public int getCount() {
return items.size();
}
}