Android adds animation transitions for Viewpager

Source: Internet
Author: User

In the development of Android application, Viewpager can achieve a lot of beautiful switching functions, such as banner unlimited ads scroll bar, novice boot, etc. are used to get, the use of the frequency is self-evident. Rely on Google to provide the auxiliary code, Viewpager switch effect can be more brilliant, the implementation process is quite simple.


First in the browser to enter the URL provided by Google, links such as: http://developer.android.com/training/animation/screen-slide.html, if not smooth open, you'd better prepare a circumvention tool, keep the requirements.


In the site you can see some of the Viewpager animation, as well as the corresponding animation to implement the source code.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/F5/wKiom1WMxwGSkzr_AAOvtjEtofg694.jpg "style=" float: none; "title=" QQ picture 20150626112737.png "alt=" Wkiom1wmxwgskzr_aaovtjetofg694.jpg "/>



Take Zoomoutpagetransformer as an example, as long as you copy the code that corresponds to the animation effect class to your project, you can use it directly. In particular, this feature is only applicable to android3.0 above, but with 3.0 of the mobile phone gradually fade out of the market, I think in the near future, you just need to consider the 4.0 and above models. See the data provided by a group of Friends: (Address: Http://www.umindex.com/devices/android_os)

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6E/F2/wKioL1WMz77CSioQAAF-_tgXpz8337.jpg "title=" QQ picture 20150626115810.png "alt=" Wkiol1wmz77csioqaaf-_tgxpz8337.jpg "/>

The latest statistics show that less than 3% active users below android4.0, of course, if you encounter a slightly harsh product manager, perseverance under 3.0 users, can also find the corresponding open source project to be compatible with the low version, is more tired.


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6E/F5/wKiom1WMx-jQFvRiAARfAUv3Opc338.jpg "title=" r{c${@ H33~e4~b8mthm ' Nos.png "alt=" wkiom1wmx-jqfvriaarfauv3opc338.jpg "/>650) this.width=650;" src= "http:// S3.51cto.com/wyfs02/m01/6e/f1/wkiol1wmyiwqesb3aacow1szt8o241.jpg "title=" qq picture 20150626113341.png "alt=" Wkiol1wmyiwqesb3aacow1szt8o241.jpg "/>


The introduction of animations to the Viewpager implementation code is quite simple, altogether in this sentence:

Mviewpager.setpagetransformer (True, New Zoomoutpagetransformer ());

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6E/F5/wKiom1WMylzTdtvxAAJ4bTEsSrc856.jpg "title=" QQ picture 20150626113937.png "alt=" Wkiom1wmylztdtvxaaj4btessrc856.jpg "/>

Look at the effect:


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6E/F5/wKiom1WMzs7TMPAuAALl7FBI3Gg933.jpg "style=" float: none; "title=" QQ picture 20150626120055.jpg "alt=" Wkiom1wmzs7tmpauaall7fbi3gg933.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/F2/wKioL1WM0IvACkcTAAL_Clr4CfA706.jpg "style=" float: none; "title=" 0dnwe$0~1v@0pqx18w3i6]b.jpg "alt=" Wkiol1wm0ivackctaal_clr4cfa706.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6E/F5/wKiom1WMzs_TRdp2AAP8XJy0QRk822.jpg "style=" float: none; "title=" QQ picture 20150626120114.jpg "alt=" Wkiom1wmzs_trdp2aap8xjy0qrk822.jpg "/>


Android adds animation transitions for Viewpager

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.