use of android.view.animation.RotateAnimation in project appintroduction by eluleci.
the class TextBaloon method rotate.
private void rotate(float degree) {
final RotateAnimation rotateAnim = new RotateAnimation(0.0f, degree, RotateAnimation.RELATIVE_TO_SELF, 0.5f, RotateAnimation.RELATIVE_TO_SELF, 0.5f);
rotateAnim.setDuration(0);
rotateAnim.setFillAfter(true);
indicator.startAnimation(rotateAnim);
}
use of android.view.animation.RotateAnimation in project LuaViewSDK by alibaba.
the class UDAnimation method build.
/**
* build an animation
*
* @return
*/
public Animation build(View view) {
Animation animation = null;
if (view != null) {
switch(mAnimationType) {
case TYPE_ALPHA:
if (this.mValues != null && this.mValues.length > 0) {
animation = new AlphaAnimation(view.getAlpha(), this.mValues[0]);
}
break;
case TYPE_ROTATE:
if (this.mValues != null && this.mValues.length > 0) {
animation = new RotateAnimation(view.getRotation(), this.mValues[0]);
}
break;
case TYPE_SCALE:
if (this.mValues != null && this.mValues.length > 1) {
animation = new ScaleAnimation(view.getScaleX(), this.mValues[0], view.getScaleY(), this.mValues[1]);
}
break;
case TYPE_TRANSLATE:
if (this.mValues != null && this.mValues.length > 1) {
animation = new TranslateAnimation(view.getX(), DimenUtil.dpiToPx(this.mValues[0]), view.getY(), DimenUtil.dpiToPx(this.mValues[1]));
}
break;
}
if (animation != null) {
animation.setFillEnabled(true);
// 默认结束后设置属性
animation.setFillAfter(true);
animation.setFillBefore(true);
animation.setDuration(mDuration);
animation.setStartOffset(mStartOffset);
animation.setRepeatCount(mRepeatCount);
if (mOnStartCallback != null || mOnRepeatCallback != null || mOnEndCallback != null) {
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
LuaUtil.callFunction(mOnStartCallback);
}
@Override
public void onAnimationEnd(Animation animation) {
LuaUtil.callFunction(mOnEndCallback);
}
@Override
public void onAnimationRepeat(Animation animation) {
LuaUtil.callFunction(mOnRepeatCallback);
}
});
}
}
}
return animation;
}
use of android.view.animation.RotateAnimation in project smartmodule by carozhu.
the class AnimationController method scaleRotateOut.
public void scaleRotateOut(View view, long durationMillis, long delayMillis) {
ScaleAnimation animation1 = new ScaleAnimation(1, 0, 1, 0, rela1, 0.5f, rela1, 0.5f);
RotateAnimation animation2 = new RotateAnimation(0, 360, rela1, 0.5f, rela1, 0.5f);
AnimationSet animation = new AnimationSet(false);
animation.addAnimation(animation1);
animation.addAnimation(animation2);
baseOut(view, animation, durationMillis, delayMillis);
}
use of android.view.animation.RotateAnimation in project smartmodule by carozhu.
the class AnimationController method scaleRotateIn.
public void scaleRotateIn(View view, long durationMillis, long delayMillis) {
ScaleAnimation animation1 = new ScaleAnimation(0, 1, 0, 1, rela1, 0.5f, rela1, 0.5f);
RotateAnimation animation2 = new RotateAnimation(0, 360, rela1, 0.5f, rela1, 0.5f);
AnimationSet animation = new AnimationSet(false);
animation.addAnimation(animation1);
animation.addAnimation(animation2);
baseIn(view, animation, durationMillis, delayMillis);
}
use of android.view.animation.RotateAnimation in project KJFrameForAndroid by kymjs.
the class HeaderLoadingLayout method init.
private void init(Context context) {
mHeaderContainer = (RelativeLayout) findViewById(R.id.pull_to_refresh_header_content);
mArrowImageView = (ImageView) findViewById(R.id.pull_to_refresh_header_arrow);
mHintTextView = (TextView) findViewById(R.id.pull_to_refresh_header_hint_textview);
mArrowImageView.setScaleType(ScaleType.CENTER);
mArrowImageView.setImageResource(R.drawable.default_ptr_rotate);
// SUPPRESS CHECKSTYLE
float pivotValue = 0.5f;
// SUPPRESS CHECKSTYLE
float toDegree = 720.0f;
mRotateAnimation = new RotateAnimation(0.0f, toDegree, Animation.RELATIVE_TO_SELF, pivotValue, Animation.RELATIVE_TO_SELF, pivotValue);
mRotateAnimation.setFillAfter(true);
mRotateAnimation.setInterpolator(ANIMATION_INTERPOLATOR);
mRotateAnimation.setDuration(ROTATION_ANIMATION_DURATION);
mRotateAnimation.setRepeatCount(Animation.INFINITE);
mRotateAnimation.setRepeatMode(Animation.RESTART);
}
Aggregations