CircleView.java 文件源码

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

项目:GitHub 作者:
private void update(@ColorInt int color) {
    innerPaint.setColor(color);
    outerPaint.setColor(shiftColorDown(color));

    Drawable selector = createSelector(color);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
        int[][] states = new int[][]{
                new int[]{android.R.attr.state_pressed}
        };
        int[] colors = new int[]{shiftColorUp(color)};
        ColorStateList rippleColors = new ColorStateList(states, colors);
        setForeground(new RippleDrawable(rippleColors, selector, null));
    } else {
        setForeground(selector);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号