private static void ApplyHorizontalScrollAnimation(View view, boolean left, int speed) {
float sign = left ? 1f : -1f;
AnimationSet animationSet = new AnimationSet(true);
animationSet.setRepeatCount(Animation.INFINITE);
animationSet.setRepeatMode(Animation.RESTART);
TranslateAnimation move = new TranslateAnimation(Animation.RELATIVE_TO_PARENT, sign * 0.70f,
Animation.RELATIVE_TO_PARENT, sign * -0.70f, Animation.RELATIVE_TO_PARENT, 0,
Animation.RELATIVE_TO_PARENT, 0);
move.setStartOffset(0);
move.setDuration(speed);
move.setFillAfter(true);
animationSet.addAnimation(move);
view.startAnimation(animationSet);
}
AnimationUtil.java 文件源码
java
阅读 36
收藏 0
点赞 0
评论 0
项目:appinventor-extensions
作者:
评论列表
文章目录