ViewPager如下效果你研究过吗
1:ViewPager实现欢迎页面动画效果
ViewPager实现欢迎页面动画滑动切换view效果,页面切换添加优美的动画,
//主要代码实现
publicvoidanimateSecondScreenClock(floatposition){
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();
}
publicvoidanimateSecondScreenAntiClock(floatposition){
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();
}
本项目来自:http://www.itlanbao.com/code/20151010/10000/100571.html
///////////////
2:viewpager切换添加动画效果viewpager切换添加动画效果,本项目中主要有三种切换特效,
(1):DepthPageTransformer效果
(2):RotateDownPageTransformer每一个view切换的时候旋转
(3):ZoomOutPageTransformer效果
主要实现代码:
mViewPager.setPageTransformer(true,newZoomOutPageTransformer());
mViewPager.setPageTransformer(true,newRotateDownPageTransformer());
mViewPager.setPageTransformer(true,newDepthPageTransformer());
这三句实现这三个效果,其中每一个类都封装好了,直接可以使用。
本项目来源:http://www.itlanbao.com/code/20151111/10000/100638.html
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。