GradientUtils.java 文件源码

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

项目:music-player 作者:
public static GradientDrawable create(@ColorInt int startColor, @ColorInt int endColor, int radius,
                                      @FloatRange(from = 0f, to = 1f) float centerX,
                                      @FloatRange(from = 0f, to = 1f) float centerY) {
    GradientDrawable gradientDrawable = new GradientDrawable();
    gradientDrawable.setColors(new int[]{
            startColor,
            endColor
    });
    gradientDrawable.setGradientType(GradientDrawable.RADIAL_GRADIENT);
    gradientDrawable.setGradientRadius(radius);
    gradientDrawable.setGradientCenter(centerX, centerY);
    return gradientDrawable;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号