private void update() {
StateListDrawable background = new StateListDrawable();
background.addState(new int[]{android.R.attr.state_pressed}, createDrawable(backgroundColorPressed, cornerColorPressed, cornerWidth, cornerRadius));
background.addState(new int[]{-android.R.attr.state_enabled}, createDrawable(backgroundColorDisabled, cornerColorDisabled, cornerWidth, cornerRadius));
background.addState(StateSet.WILD_CARD, createDrawable(backgroundColor, cornerColor, cornerWidth, cornerRadius));
setBackground(background);
setTextColor(new ColorStateList(
new int[][]{
new int[]{android.R.attr.state_pressed},
new int[]{-android.R.attr.state_enabled},
new int[]{}
},
new int[]{
textColorPressed,
textColorDisabled,
textColor
}
));
}
RoundButton.java 文件源码
java
阅读 35
收藏 0
点赞 0
评论 0
项目:RoundButton
作者:
评论列表
文章目录