public AlbumPictureController(Context context, final ImageSwitcher view, int size) {
this.view = view;
this.size = size;
this.context = context;
this.cache = new BitmapCache(context, BitmapCache.CACHE_ALBUM_VISUALIZER_IMAGE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
defaultColor = context.getColor(R.color.default_play_bg_color);
defaultTextColor = context.getColor(R.color.default_play_text_color);
} else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
defaultColor = context.getResources().getColor(R.color.default_play_bg_color, null);
defaultTextColor = context.getResources().getColor(R.color.default_play_text_color, null);
} else {
defaultColor = context.getResources().getColor(R.color.default_play_bg_color);
defaultTextColor = context.getResources().getColor(R.color.default_play_text_color);
}
this.bitmapProducer = new BitmapProducer(context);
colors = new int[]{
defaultColor,
defaultTextColor,
defaultColor,
defaultTextColor
};
rotateAnim = ObjectAnimator.ofFloat(0, 360);
rotateAnim.setDuration(45 * 1000);
rotateAnim.setRepeatMode(ValueAnimator.RESTART);
rotateAnim.setRepeatCount(ValueAnimator.INFINITE);
rotateAnim.setInterpolator(new LinearInterpolator());
rotateAnim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float value = (float) animation.getAnimatedValue();
view.getCurrentView().setRotation(value);
}
});
}
AlbumPictureController.java 文件源码
java
阅读 36
收藏 0
点赞 0
评论 0
项目:Musicoco
作者:
评论列表
文章目录