private void setScanBtnBg(){
int defColor = CustomAttrValueUtil.getAttrColorValue(R.attr.colorAccent,R.color.colorAccent,this);
int pressColor = CustomAttrValueUtil.getAttrColorValue(R.attr.press_color,R.color.colorAccent,this);
Drawable backgroundDrawable = scanBtn.getBackground();
StateListDrawable sld = (StateListDrawable) backgroundDrawable;// 通过向下转型,转回原型,selector对应的Java类为:StateListDrawable
SelectorUtil.changeViewColor(sld,new int[]{pressColor,defColor});
}
ScanActivity.java 文件源码
java
阅读 38
收藏 0
点赞 0
评论 0
项目:MeetMusic
作者:
评论列表
文章目录