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);
}
OneDrawable.java 文件源码
java
阅读 54
收藏 0
点赞 0
评论 0
项目:OneDrawable
作者:
评论列表
文章目录