ViewPager Implementation of animation from entry to mastery (1), viewpager Animation

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.