本文整理了Java中android.widget.TextView.drawableStateChanged()
方法的一些代码示例,展示了TextView.drawableStateChanged()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TextView.drawableStateChanged()
方法的具体详情如下:
包路径:android.widget.TextView
类名称:TextView
方法名:drawableStateChanged
暂无
代码示例来源:origin: aa112901/remusic
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
if (getBackground() != null) {
invalidateDrawable(getBackground());
}
}
代码示例来源:origin: ZieIony/Carbon
@Override
protected void drawableStateChanged() {
super.drawableStateChanged();
if (rippleDrawable != null && rippleDrawable.getStyle() != RippleDrawable.Style.Background)
rippleDrawable.setState(getDrawableState());
if (stateAnimator != null)
stateAnimator.setState(getDrawableState());
ColorStateList textColors = getTextColors();
if (textColors instanceof AnimatedColorStateList)
((AnimatedColorStateList) textColors).setState(getDrawableState());
if (tint != null && tint instanceof AnimatedColorStateList)
((AnimatedColorStateList) tint).setState(getDrawableState());
if (backgroundTint != null && backgroundTint instanceof AnimatedColorStateList)
((AnimatedColorStateList) backgroundTint).setState(getDrawableState());
if (ambientShadow != null && ambientShadowColor != null)
ambientShadowColorFilter = new PorterDuffColorFilter(ambientShadowColor.getColorForState(getDrawableState(), ambientShadowColor.getDefaultColor()), PorterDuff.Mode.MULTIPLY);
if (spotShadow != null && spotShadowColor != null)
spotShadowColorFilter = new PorterDuffColorFilter(spotShadowColor.getColorForState(getDrawableState(), spotShadowColor.getDefaultColor()), PorterDuff.Mode.MULTIPLY);
}
内容来源于网络,如有侵权,请联系作者删除!