I want to use PagerSlidingTabStrip in my toolbar widget in a "filter way".
To do this, I instanciate programmatically a "fake" view pager to allow PagerSlidingTabStrip working as this:
final ViewPager vViewPager = new ViewPager(this);
vViewPager.setAdapter(new PagerSlidingTabStripAdapter(getSupportFragmentManager()));
mSlidingTabStrip = (PagerSlidingTabStrip) findViewById(R.id.widget_toolbar_sliding_tab_strip);
mSlidingTabStrip.setViewPager(vViewPager);
mSlidingTabStrip.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
@Override
public void onPageSelected(int pPosition) {
OLSLog.i("user has changed his default filter");
// TODO not working, question posted on relative forum
vViewPager.setCurrentItem(pPosition, true);
}
});
In my PagerSlidingTabStripAdapter, I have a "fake" list of fragments which I instanciate when I create relative adapter.
Everything works fine as I want but I have no scroll at all when I click on a different tab.
Hi,
I want to use PagerSlidingTabStrip in my toolbar widget in a "filter way".
To do this, I instanciate programmatically a "fake" view pager to allow PagerSlidingTabStrip working as this:
final ViewPager vViewPager = new ViewPager(this); vViewPager.setAdapter(new PagerSlidingTabStripAdapter(getSupportFragmentManager())); mSlidingTabStrip = (PagerSlidingTabStrip) findViewById(R.id.widget_toolbar_sliding_tab_strip); mSlidingTabStrip.setViewPager(vViewPager); mSlidingTabStrip.setOnPageChangeListener(new ViewPager.SimpleOnPageChangeListener() {
In my PagerSlidingTabStripAdapter, I have a "fake" list of fragments which I instanciate when I create relative adapter.
Everything works fine as I want but I have no scroll at all when I click on a different tab.
What is missing to work?
Best regards.