Android ViewPager that respects height of wrap_content.
The WrapContentViewPager is an almost in-place replacement for a android.support.v4.view.ViewPager. When used with wrap_content height the WrapContentViewPager will resize to the height of the selected child view and smoothly change its height when ViewPager is Scrolled.
UPDATE BREAKING CHANGE! Support24: As of support library 24 there has been a change in PagerAdapter preventing the posibility to wrap it, in order to use WrapContentViewPager your PagerAdapter needs to implement the ObjectAtPositionInterface or extend the ObjectAtPositionPagerAdapter.
Solution was inspired by answers to this StackOverflow question: http://stackoverflow.com/questions/8394681/android-i-am-unable-to-have-viewpager-wrap-content
This is a work in progress, so there still might be bugs and edge cases not covered. If you find a bug and open an Issue, please provide instructions how to reproduce it.
At the moment the easiest way to include the library is to copy the classes into your project.
The implementation relies the v4 support library ViewPager.
Just like a ViewPager, either in an XML or Code. UPDATE Support24: Your PagerAdapter needs to implement ObjectAtPositionInterface
A simple Sample (using TextViews and ImageViews) project is available for reference under app. You can install the APK to see it in action.
This project is licensed under the terms of the MIT license.