Exemple #1
0
  @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();
  }
Exemple #2
0
  @Override
  protected void drawableStateChanged() {
    super.drawableStateChanged();

    final int[] myDrawableState = getDrawableState();

    if (mThumbDrawable != null) {
      mThumbDrawable.setState(myDrawableState);
    }

    if (mTrackDrawable != null) {
      mTrackDrawable.setState(myDrawableState);
    }

    invalidate();
  }