Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ViewPager with indicator without Android's support library

Right now I'm using the ViewPagerIndicator for swipe-able fragments with an indicator in my program and it's working like a charm. But since Google is pushing more and more into the direction of Fragments without using the Android support library and e.g. PreferenceFragments aren't available in the support library, I'm wondering if there is something similar to the ViewPagerIndicator that's using the standard Android library.

like image 827
Kris Avatar asked Jul 17 '12 10:07

Kris


1 Answers

Google is pushing more and more into the direction of Fragments without using the Android support library

And your proof of this is... what, exactly?

e.g. PreferenceFragments aren't available in the support library

It is not possible to backport PreferenceFragment very easily, as there are many other requirements to make that useful (e.g., backporting the new PreferenceActvity). I have personally looked into backporting the preference fragment system and concluded that it would be significantly more pain than it is worth to me.

I'm wondering if there is something similar to the ViewPageIndicator that's using the standard Android library

By definition, that is impossible, as ViewPager is in the Android Support package, which means any indicator for ViewPager must use the Android Support package.

However, there is nothing about ViewPager that requires you to use fragments. You are welcome to create your own PagerAdapter implementation that does not use any fragments, or uses native API Level 11 fragments, if you so choose.

like image 147
CommonsWare Avatar answered Oct 20 '22 16:10

CommonsWare