use of android.view.animation.AnimationSet in project weex-example by KalicyZhou.
the class SplashActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
View textView = findViewById(R.id.fullscreen_content);
ScaleAnimation scaleAnimation = new ScaleAnimation(0.0f, 1.0f, 0.0f, 1.0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
AnimationSet animationSet = new AnimationSet(false);
animationSet.addAnimation(scaleAnimation);
animationSet.setDuration(1000);
animationSet.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
startMainActivity();
finish();
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
textView.startAnimation(animationSet);
}
use of android.view.animation.AnimationSet in project android-satellite-menu by siyamed.
the class SatelliteAnimationCreator method createItemOutAnimation.
public static Animation createItemOutAnimation(Context context, int index, long expandDuration, int x, int y) {
AlphaAnimation alphaAnimation = new AlphaAnimation(0f, 1f);
long alphaDuration = 60;
if (expandDuration < 60) {
alphaDuration = expandDuration / 4;
}
alphaAnimation.setDuration(alphaDuration);
alphaAnimation.setStartOffset(0);
TranslateAnimation translate = new TranslateAnimation(0, x, 0, y);
translate.setStartOffset(0);
translate.setDuration(expandDuration);
translate.setInterpolator(context, R.anim.sat_item_overshoot_interpolator);
RotateAnimation rotate = new RotateAnimation(0f, 360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
rotate.setInterpolator(context, R.anim.sat_item_out_rotate_interpolator);
long duration = 100;
if (expandDuration <= 150) {
duration = expandDuration / 3;
}
rotate.setDuration(expandDuration - duration);
rotate.setStartOffset(duration);
AnimationSet animationSet = new AnimationSet(false);
animationSet.setFillAfter(false);
animationSet.setFillBefore(true);
animationSet.setFillEnabled(true);
//animationSet.addAnimation(alphaAnimation);
//animationSet.addAnimation(rotate);
animationSet.addAnimation(translate);
animationSet.setStartOffset(30 * index);
return animationSet;
}
use of android.view.animation.AnimationSet in project JustAndroid by chinaltz.
the class AbAnimationUtil method playRotateAnimation.
/**
* 旋转动画
* @param v
* @param durationMillis
* @param repeatCount Animation.INFINITE
* @param repeatMode Animation.RESTART
*/
public static void playRotateAnimation(View v, long durationMillis, int repeatCount, int repeatMode) {
//创建AnimationSet对象
AnimationSet animationSet = new AnimationSet(true);
//创建RotateAnimation对象
RotateAnimation rotateAnimation = new RotateAnimation(0f, +360f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
//设置动画持续
rotateAnimation.setDuration(durationMillis);
rotateAnimation.setRepeatCount(repeatCount);
//Animation.RESTART
rotateAnimation.setRepeatMode(repeatMode);
//动画插入器
rotateAnimation.setInterpolator(v.getContext(), android.R.anim.decelerate_interpolator);
//添加到AnimationSet
animationSet.addAnimation(rotateAnimation);
//开始动画
v.startAnimation(animationSet);
}
use of android.view.animation.AnimationSet in project smartmodule by carozhu.
the class AnimationController method slideFadeIn.
public void slideFadeIn(View view, long durationMillis, long delayMillis) {
TranslateAnimation animation1 = new TranslateAnimation(rela2, 1, rela2, 0, rela2, 0, rela2, 0);
AlphaAnimation animation2 = new AlphaAnimation(0, 1);
AnimationSet animation = new AnimationSet(false);
animation.addAnimation(animation1);
animation.addAnimation(animation2);
baseIn(view, animation, durationMillis, delayMillis);
}
use of android.view.animation.AnimationSet in project smartmodule by carozhu.
the class AnimationController method slideFadeOut.
public void slideFadeOut(View view, long durationMillis, long delayMillis) {
TranslateAnimation animation1 = new TranslateAnimation(rela2, 0, rela2, -1, rela2, 0, rela2, 0);
AlphaAnimation animation2 = new AlphaAnimation(1, 0);
AnimationSet animation = new AnimationSet(false);
animation.addAnimation(animation1);
animation.addAnimation(animation2);
baseOut(view, animation, durationMillis, delayMillis);
}
Aggregations