diff --git a/main/src/main/java/com/yunbao/main/views/FloatBannerView.java b/main/src/main/java/com/yunbao/main/views/FloatBannerView.java index f6f53dbca..b0e63d1b0 100644 --- a/main/src/main/java/com/yunbao/main/views/FloatBannerView.java +++ b/main/src/main/java/com/yunbao/main/views/FloatBannerView.java @@ -33,7 +33,7 @@ public class FloatBannerView extends FrameLayout { private ClipPathCircleImage clipImage1, clipImage2, clipImage3; private List list = new ArrayList<>(); //默认定时器时间 - private int delayMillis = 1500; + private int delayMillis = 1000; //Handler定时加载下一张的数据 private Handler bannerHandler = new Handler(); private int index = 0; @@ -96,18 +96,19 @@ public class FloatBannerView extends FrameLayout { ImgLoader.displayAvatar(getContext(), list.get(next).getAvatar(), clipImage3); ImgLoader.displayAvatar(getContext(), list.get(next).getAvatar(), clipImage2); ImgLoader.displayAvatar(getContext(), list.get(index).getAvatar(), clipImage1); - TranslateAnimation animationTranslate = new TranslateAnimation(0, -30, 0, 0.2f); + TranslateAnimation animationTranslate = new TranslateAnimation(0, -32f, 0, 0.2f); + TranslateAnimation animationTranslate3 = new TranslateAnimation(0, -20f, 0, 0.2f); AnimationSet animationSet1 = new AnimationSet(true); animationSet1.setFillAfter(true); - animationSet1.setDuration(650); + animationSet1.setDuration(200); animationSet1.addAnimation(animationTranslate); AlphaAnimation animationAlpha = new AlphaAnimation(1, 0); AnimationSet animationSet2 = new AnimationSet(true); animationSet2.setFillAfter(true); - animationSet2.setDuration(850); + animationSet2.setDuration(200); animationSet2.addAnimation(animationAlpha); - animationSet2.addAnimation(animationTranslate); - bannerLayout1.startAnimation(animationSet2); + animationSet2.addAnimation(animationTranslate3); + int finalNext = next; animationSet1.setAnimationListener(new Animation.AnimationListener() { @Override @@ -124,6 +125,7 @@ public class FloatBannerView extends FrameLayout { int page3 = finalNext + 1; page3 = (page3 == list.size() ? 0 : page3); ImgLoader.displayAvatar(getContext(), list.get(page3).getAvatar(), clipImage3); + bannerLayout1.clearAnimation(); } @Override @@ -140,7 +142,8 @@ public class FloatBannerView extends FrameLayout { @Override public void onAnimationEnd(Animation animation) { - bannerLayout1.clearAnimation(); + + } @Override @@ -148,6 +151,7 @@ public class FloatBannerView extends FrameLayout { } }); + bannerLayout1.startAnimation(animationSet2); bannerLayout3.startAnimation(animationSet1); index = index + 1; bannerHandler.postDelayed(mFlipRunnable, delayMillis);