3D桌面效果动画类.docVIP

  • 1
  • 0
  • 约5.94千字
  • 约 5页
  • 2018-11-23 发布于河南
  • 举报
3D桌面效果动画类

Java代码? public?class?CubeAnimation?extends?Animation?implements?? ????????Animation.AnimationListener?{?? ????public?static?final?int?FACE_LEFT?=?0;?? ????public?static?final?int?FACE_RIGHT?=?1;?? ????private?int?mInd;?? ????private?float?mFromDegrees;?? ????private?float?mToDegrees;?? ????private?float?mCenterX;?? ????private?float?mCenterY;?? ????private?int?mHorizonType?=?1;?? ????private?float?mHorizonValue?=?0.5F;?? ????private?Camera?mCamera;?? ????private?View?mView;?? ?? ????public?CubeAnimation(int?ind)?{?? ????????this.mInd?=?ind;?? ????????this.mFromDegrees?=?0.0F;?? ????????this.mToDegrees?=?90.0F;?? ????}?? ?? ????public?CubeAnimation(Context?context,?AttributeSet?attrs)?{?? ????????super(context,?attrs);?? ????????TypedArray?a?=?context.obtainStyledAttributes(attrs,?? ????????????????R.styleable.CubeAnimation);?? ?? ????????this.mFromDegrees?=?0.0F;?? ????????this.mToDegrees?=?90.0F;?? ?? ????????Description?d?=?Description.parseValue(a.peekValue(0));?? ????????this.mHorizonType?=?d.type;?? ????????this.mHorizonValue?=?d.value;?? ?? ????????this.mInd?=?a.getInt(1,?0);?? ?? ????????boolean?t?=?a.getBoolean(2,?true);?? ????????if?(!(t))?{?? ????????????this.mInd?=?(1?-?this.mInd);?? ????????????this.mToDegrees?=?0.0F;?? ????????????this.mFromDegrees?=?90.0F;?? ????????}?? ????????a.recycle();?? ????}?? ?? ????public?void?onAnimationStart(Animation?anim)?{?? ????????this.mView.setVisibility(View.VISIBLE);?? ????}?? ?? ????public?void?onAnimationEnd(Animation?anim)?{?? ????????this.mView.setVisibility((this.mInd?==?0)???0?:?8);?? ????????this.mInd?=?(1?-?this.mInd);?? ????}?? ?? ????public?void?onAnimationRepeat(Animation?anim)?{?? ????}?? ?? ????public?static?void?startCubeAnimation(Context?context,?int?id,?View?view1,?? ????????????View?view2)?{?? ????????XmlPullParser?parser;?? ????????try?{?? ????????????parser?=?context.getResources().getAnimation(id);?? ????????????AttributeSet?attrs?=?Xml.asAttributeSet(parser);?? ?? ????????????int?type?=?parser.ge

文档评论(0)

1亿VIP精品文档

相关文档