|
|
@ -453,25 +453,25 @@ public class WebViewActivity extends BaseActivity { |
|
|
} |
|
|
} |
|
|
currentVideo.clearAnimation(); |
|
|
currentVideo.clearAnimation(); |
|
|
nextVideo.clearAnimation(); |
|
|
nextVideo.clearAnimation(); |
|
|
|
|
|
|
|
|
if (currentVideo != null && currentVideo.isPlaying()) { |
|
|
|
|
|
currentVideo.pause(); |
|
|
|
|
|
currentVideo.stopPlayback(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
LoggerUtil.e("切换视频", type.trim()); |
|
|
|
|
|
VideoView farVideo; |
|
|
|
|
|
farVideo = currentVideo; |
|
|
|
|
|
currentVideo = nextVideo; |
|
|
|
|
|
|
|
|
// 旧视频淡出
|
|
|
// 旧视频淡出
|
|
|
currentVideo.animate() |
|
|
|
|
|
|
|
|
farVideo.animate() |
|
|
.alpha(0.5f) |
|
|
.alpha(0.5f) |
|
|
.setDuration(300) |
|
|
.setDuration(300) |
|
|
.setListener(new Animator.AnimatorListener() { |
|
|
.setListener(new Animator.AnimatorListener() { |
|
|
@Override |
|
|
@Override |
|
|
public void onAnimationStart(Animator animation) { |
|
|
public void onAnimationStart(Animator animation) { |
|
|
currentVideo.pause(); |
|
|
|
|
|
|
|
|
farVideo.pause(); |
|
|
|
|
|
farVideo.stopPlayback(); |
|
|
} |
|
|
} |
|
|
@Override |
|
|
@Override |
|
|
public void onAnimationEnd(Animator animation) { |
|
|
public void onAnimationEnd(Animator animation) { |
|
|
currentVideo.setVisibility(View.GONE); |
|
|
|
|
|
currentVideo.setAlpha(1f); // 恢复初始状态,以备下次使用
|
|
|
|
|
|
|
|
|
farVideo.setVisibility(View.GONE); |
|
|
|
|
|
farVideo.setAlpha(1f); // 恢复初始状态,以备下次使用
|
|
|
} |
|
|
} |
|
|
@Override |
|
|
@Override |
|
|
public void onAnimationCancel(Animator animation) {} |
|
|
public void onAnimationCancel(Animator animation) {} |
|
|
@ -495,9 +495,8 @@ public class WebViewActivity extends BaseActivity { |
|
|
} |
|
|
} |
|
|
@Override |
|
|
@Override |
|
|
public void onAnimationEnd(Animator animation) { |
|
|
public void onAnimationEnd(Animator animation) { |
|
|
currentVideo = nextVideo; |
|
|
|
|
|
if (!currentVideo.isPlaying()) { |
|
|
|
|
|
currentVideo.start(); |
|
|
|
|
|
|
|
|
if (!nextVideo.isPlaying()) { |
|
|
|
|
|
nextVideo.start(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@Override |
|
|
@Override |
|
|
|