astuetz/PagerSlidingTabStrip — pull request #101 by giordanoapps (2014-06-07 20:06:07+00:00)
Title: Added suport for custom views

I've added support for custom views in the tab.
Now it is possible to create an adapter with custom views inside.

Sample:

public class MyPagerAdapter extends FragmentPagerAdapter
implements PagerSlidingTabStrip.ViewTabProvider {

private View[] TABS;

public MyPagerAdapter(FragmentManager fm, LayoutInflater if) {
super(fm);

TABS = new View[2]

TABS[0] = if.inflate(R.layout.someLayout, null);
TABS[1] = if.inflate(R.layout.someOtherLayout, null);

/* do something with those layouts */
}

@Override
public int getCount() {
return TABS.length;
}

@Override
public Fragment getItem(int position) {
return SomeFragmentHere.newInstance(position);
}

public static void setTabs(View[] tabs) {
TABS = tabs;
}

@Override
public View getPageView(int position) {
return TABS[position];
}
}