درود و وقت بخیر به دوستان گلم
در پروژه این جلسه بجای استفاده از متد setFillAfter برای animationSet از setRepeatCount و setRepeatMode استفاده کردم ولی جالبه هیچکدوم روی animationSet جواب نمیدن.
علت چیه؟
RotateAnimation rotateAnimation = new RotateAnimation(0, 360, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
ScaleAnimation scaleAnimation = new ScaleAnimation(1, 3, 1, 3, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
AlphaAnimation alphaAnimation = new AlphaAnimation(1, 0);
AnimationSet animationSet=new AnimationSet(true);
animationSet.addAnimation(rotateAnimation);
animationSet.addAnimation(scaleAnimation);
animationSet.addAnimation(alphaAnimation);
animationSet.setDuration(1000);
animationSet.setInterpolator(new AccelerateInterpolator());
//animationSet.setFillAfter(true);
animationSet.setRepeatCount(5);
animationSet.setRepeatMode(Animation.REVERSE);
سلام و احترام
وقتی repeatMode و fillBefore و fillAfter و duration بر روی AnimationSet ست کنیم این ویژگی ها بر روی تمامی فرزندان override میشوند پس روی خود AnimationSet تاثیری نداشته و روی فرزندان override خواهند شد.
نکته دوم ست کردن repeatCount و fillEnabled بر روی AnimationSet تاثیری ندارند
موفق و سالم باشید.