本文整理汇总了Java中android.graphics.drawable.AnimationDrawable.setExitFadeDuration方法的典型用法代码示例。如果您正苦于以下问题:Java AnimationDrawable.setExitFadeDuration方法的具体用法?Java AnimationDrawable.setExitFadeDuration怎么用?Java AnimationDrawable.setExitFadeDuration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.graphics.drawable.AnimationDrawable
的用法示例。
在下文中一共展示了AnimationDrawable.setExitFadeDuration方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initAnim
import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
private void initAnim() {
animationDrawable = new AnimationDrawable();
animationDrawable.addFrame(getResources().getDrawable(R.mipmap.explode1), 100);
animationDrawable.addFrame(getResources().getDrawable(R.mipmap.explode2), 100);
animationDrawable.addFrame(getResources().getDrawable(R.mipmap.explode3), 100);
animationDrawable.addFrame(getResources().getDrawable(R.mipmap.explode4), 100);
animationDrawable.addFrame(getResources().getDrawable(R.mipmap.explode5), 100);
animationDrawable.setOneShot(true);
animationDrawable.setExitFadeDuration(300);
animationDrawable.setEnterFadeDuration(100);
ObjectAnimator objectAnimator1 = ObjectAnimator.ofFloat(null, "scaleX", 1.f, 0.f);
ObjectAnimator objectAnimator2 = ObjectAnimator.ofFloat(null, "scaleY", 1.f, 0.f);
animatorSet = new AnimatorSet();
animatorSet.setDuration(300l);
animatorSet.playTogether(objectAnimator1, objectAnimator2);
objectAnimator = ObjectAnimator.ofFloat(null, "alpha", 1.f, 0.f);
objectAnimator.setDuration(2000l);
}
示例2: init
import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
private void init() {
setBackgroundResource(draw);
final AnimationDrawable frameAnimation = (AnimationDrawable) getBackground();
frameAnimation.setEnterFadeDuration(duration);
frameAnimation.setExitFadeDuration(duration);
post(new Runnable(){
public void run(){
frameAnimation.start();
}
});
}
示例3: ItemConversationAdapter
import android.graphics.drawable.AnimationDrawable; //导入方法依赖的package包/类
public ItemConversationAdapter(Context context, List<ConversationEntity> objects) {
this.context = context;
this.layoutInflater = LayoutInflater.from(context);
this.objects = objects;
animationDrawable = new AnimationDrawable();
animationDrawable.addFrame(context.getResources().getDrawable(R.mipmap.explode1), 100);
animationDrawable.addFrame(context.getResources().getDrawable(R.mipmap.explode2), 100);
animationDrawable.addFrame(context.getResources().getDrawable(R.mipmap.explode3), 100);
animationDrawable.addFrame(context.getResources().getDrawable(R.mipmap.explode4), 100);
animationDrawable.addFrame(context.getResources().getDrawable(R.mipmap.explode5), 100);
animationDrawable.setOneShot(true);
animationDrawable.setExitFadeDuration(300);
animationDrawable.setEnterFadeDuration(100);
}