OneDrawable.java 文件源码

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

项目:OneDrawable 作者:
private static Drawable createBgColor(Context context, @ColorInt int resBackgroundColor, @PressedMode.Mode int mode, @FloatRange(from = 0.0f, to = 1.0f) float alpha) {
    ColorDrawable colorDrawableNormal = new ColorDrawable();
    ColorDrawable colorDrawablePressed = new ColorDrawable();
    ColorDrawable colorDrawableUnable = new ColorDrawable();

    colorDrawableNormal.setColor(resBackgroundColor);
    colorDrawablePressed.setColor(resBackgroundColor);
    colorDrawableUnable.setColor(resBackgroundColor);
    Drawable pressed = getPressedStateDrawable(context, mode, alpha, colorDrawablePressed);
    Drawable unable = getUnableStateDrawable(context, colorDrawableUnable);

    return createStateListDrawable(colorDrawableNormal, pressed, unable);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号