BitmapPalette.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:MusicX-music-player 作者:
private void crossfadeTargetBackground(PaletteTarget target, Pair<View, Integer> t, int newColor) {

        final Drawable oldColor = t.first.getBackground();
        final Drawable[] drawables = new Drawable[2];

        drawables[0] = oldColor != null ? oldColor : new ColorDrawable(t.first.getSolidColor());
        drawables[1] = new ColorDrawable(newColor);
        TransitionDrawable transitionDrawable = new TransitionDrawable(drawables);

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            t.first.setBackground(transitionDrawable);
        } else {
            //noinspection deprecation
            t.first.setBackgroundDrawable(transitionDrawable);
        }
        transitionDrawable.startTransition(target.targetCrossfadeSpeed);
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号