@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()); Drawable[] drawables = getCompoundDrawables(); for (Drawable d : drawables) if (d != null) d.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); }
@Override protected void drawableStateChanged() { super.drawableStateChanged(); if (mManager != null) { mManager.onRefreshStyles(); } }