ViewPager Implementation of animation from entry to mastery (1), viewpager Animation
Three methods of ViewPager OnPageChangeListener:
OnPageSelected (int arg0): this parameter is called after the slide is stopped. arg0 indicates the position of the currently selected page.
OnPageScrollStateChanged (int arg0): it is called when the sliding status changes. There are three states: 1 starting to slide. 2. After sliding, 0 remains unchanged. So the order of change in the Sliding Process is: 1-2-0.
OnPageScrolled (int position, float positionOffset, int positionOffsetPixels): called during sliding:
Where: arg0: indicates the position of the Left page displayed on the current screen
Arg1: Percentage of the Offset displayed on the left of the current screen.
Arg2: The pixel position of the Offset on the left side of the current screen
OnPageSelected slide to the right to the head and then to the left to change arg0
OnPageScrollStateChanged sliding Variation Law
OnPageScrolled sliding to the right
OnPageScrolled sliding to the left
Focus: onPageScrolled position the index positionOffset of the view on the left of the current interface is the percentage of positionOffsetPixels on the left of the view offset.