I’m using both ViewPagerIndicator and ActionBarSherlock in my projects.
Is there an easy way to make ViewPagerIndicator tabs become a spinner in ActionBarSherlock when the device is rotated to landscape? You know, so as to make more room available for the rest of content.
Do I have to do all the work manually capturing the event @onConfigurationChanged?
If this is really what you want, rather than using
ViewPagerIndicator, you should be using tabs in the action bar. Those will automatically convert to a drop-down list in the action bar in different circumstances. Here is a sample project demonstrating tyingViewPagerto action bar tabs: https://github.com/commonsguy/cw-omnibus/tree/master/ViewPager/TabPagerNote, though, that there is a bug in Android, reproduced in ActionBarSherlock for compatibility, that will mean that swipe events in the
ViewPagerwill not be reflected in the action bar when in drop-down list mode.If you really want to use ViewPagerIndicator instead of action bar tabs, not only are you on your own, but you will suffer from the same bug that I mentioned in the previous paragraph.
Personally, I recommend using tabs (whether
PagerTabStripor ViewPagerIndicator) in all cases, rather than switching back and forth.