1:viewpager Implementing the Welcome page animation effect
Viewpager implementation of the Welcome page animation Sliding Switch View effect, the page switch to add beautiful animation,
Main code implementation
public void Animatesecondscreenclock (float position) {
if (mcurrentdirection = = Path.Direction.CCW) {
Mcurrentdirection = Path.Direction.CW;
Animpath.reset ();
Initnewpath (Path.Direction.CW);
Invalidate ();
}
if (Math.Abs (position) > 1) {
Mdistance = MPATHLENGTH/2 * (math.abs (position));
} else {
Mdistance = MPATHLENGTH/2 * (math.abs (position));
}
Invalidate ();
}
public void Animatesecondscreenanticlock (float position) {
if (mcurrentdirection = = Path.Direction.CW) {
Mcurrentdirection = Path.Direction.CCW;
Initnewpath (Path.Direction.CCW);
Invalidate ();
}
if (Math.Abs (position) > 1) {
} else {
Mdistance = MPATHLENGTH/2 * (math.abs (1 + position));
}
Invalidate ();
}
650) this.width=650; "src=" Http://www.itlanbao.com/code/users/10000/20151123/2015112310044822178543.gif "alt=" 2015112310044822178543.gif "/>
This project from: http://www.itlanbao.com/code/20151010/10000/100571.html
///////////////
2:viewpager Toggle Add Animation effect
Viewpager Toggle Add animation effect, this project mainly has three kinds of switching effects,
(1): Depthpagetransformer effect
(2): Rotatedownpagetransformer rotation When each view is switched
(3): Zoomoutpagetransformer effect
Main implementation code:
Mviewpager.setpagetransformer (True,new Zoomoutpagetransformer ());
Mviewpager.setpagetransformer (True,new Rotatedownpagetransformer ());
Mviewpager.setpagetransformer (True,new Depthpagetransformer ());
These three sentences achieve these three effects, each of which is encapsulated and can be used directly.
650) this.width=650; "src=" Http://www.itlanbao.com/code/users/10000/20151123/2015112310024633578039.gif "alt=" 2015112310024633578039.gif "/>
Source of this project: http://www.itlanbao.com/code/20151111/10000/100638.html
Viewpager have you studied the following effects?