Reputation: 37579
android-support-v4.jar has a size of 750kb, thats a lot, and i only need it to use ViewPager and PageAdapter.
My app only haves a size of 50kb, it is a huge size increase if i use the support library.
It is possible to use ViewPager and PagerAdapter without using that .jar library?
Thanks
Upvotes: 3
Views: 1103
Reputation: 766
You may extract and modify any view, widget or other component from support library. Look in your sdk directory for sources. If you have not downloaded sources yet, you may use Android SDK Manager to download. You could then just copy appropriate java (in this case, ViewPager.java and PagerAdapter.java, and dependencies) files to your project or, even better, create new packages for different purposes.
I did this for DrawerLayout in order to save space. Gained 900 kB. Lost a couple of hours and have to redo the work for each new API version. In this case - it's worth it.
Read about ProGuard and DexGuard.
Upvotes: 1
Reputation: 157437
No, those components are, so far, just part of the support library. From the documentation:
This lesson shows you how to do screen slides with a ViewPager provided by the support library. ViewPagers can animate screen slides automatically.
Upvotes: 4