My application does the following:
There ViewPageris a set of "cards". The user can scroll through maps / pages using animation PageTransformerwhen the user searches left and right.
The user can switch between viewing the front and back of the cards using animation with map translation (as described in this Android tutorial )
I need to support API 14+
I tried various approaches, but every problem has it.
Approach 1: Nested Fragments
I have ViewPagera top level that runs between fragments of a map container. Each fragment of the container is responsible for processing paging, replacing the contents with FrameLayouteither a fragment of the front / back card.
Problem: this works fine, but only on API 17+, I need to support API 14+.
Approach 2: Nested Snippets with v4 Support Library
Change all fragments, actions, etc. on alternatives, v4 eliminates the compiler warning about API 17 requirement, but the flip card animation no longer works, and I get the error message "java.lang.RuntimeException: Unknown animation name: objectAnimator"
( ViewPager v13), , .
3: ViewPager
. ViewPager, FragmentStatePagerAdapter , , , /.
, ViewPager , FragmentStatePagerAdapter getItem(), . , .
, , -, ViewPager , .
, : ( ) ViewPager public Fragment getItem(int i) { ... }?
!