android - Disable smooth animation when clicking on tabs using ViewPagerIndicator -


i'm using tabpageindicator viewpagerindicator lib viewpager display 6 fragments. suppose i'm on 1st page, if click 6th tab i'll see pages scrolled. possible disable animation? maybe can somehow disable in viewpager?

here 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(); } } 

another option override setcurrentitem(int i) in customviewpager class subclassing viewpager this:

@override public void setcurrentitem(int item) {     super.setcurrentitem(item,false); } 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -