@Override protected void drawableStateChanged() { super.drawableStateChanged(); int[] myDrawableState = getDrawableState(); // Set the state of the Drawable // Drawable may be null when checked state is set from XML, from super constructor if (mThumbDrawable != null) mThumbDrawable.setState(myDrawableState); if (mTrackDrawable != null) mTrackDrawable.setState(myDrawableState); invalidate(); }
@Override protected void drawableStateChanged() { super.drawableStateChanged(); final int[] myDrawableState = getDrawableState(); if (mThumbDrawable != null) { mThumbDrawable.setState(myDrawableState); } if (mTrackDrawable != null) { mTrackDrawable.setState(myDrawableState); } invalidate(); }