Skip to content

Commit

Permalink
说明文件
Browse files Browse the repository at this point in the history
添加调用示例
  • Loading branch information
GcsSloop committed May 13, 2015
1 parent 4bd8e4d commit c1d3ed4
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,38 @@

#基于谷歌官方提供的3D翻转示例进行修改,修复了在不同像素密度的设备上显示效果差异过大的问题。

#调用示例:



// 计算中心点(这里是使用view的中心作为旋转的中心点)
final float centerX = view.getWidth() / 2.0f;
final float centerY = view.getHeight() / 2.0f;

//括号内参数分别为(上下文,开始角度,结束角度,x轴中心点,y轴中心点,深度,是否扭曲)
final Rotate3dAnimation rotation = new Rotate3dAnimation(this, start, end, centerX, centerY, 1.0f, true);
rotation.setDuration(1500); //设置动画时长
rotation.setFillAfter(true); //保持旋转后效果
rotation.setInterpolator(new AccelerateInterpolator()); //设置插值器

rotation.setAnimationListener(new AnimationListener() { //设置监听器

@Override
public void onAnimationStart(Animation animation) {
}

@Override
public void onAnimationRepeat(Animation animation) {
}

@Override
public void onAnimationEnd(Animation animation) {
}
});
view.startAnimation(rotation); //开始动画

##修正后
![image](https://github.com/GcsSloop/Rotate3dAnimation/blob/master/Pic/%E4%BF%AE%E6%AD%A3%E5%90%8E.gif)
##修正前
Expand Down

0 comments on commit c1d3ed4

Please sign in to comment.