예제 #1
0
파일: Switch.java 프로젝트: 30962088/c11_as
  @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();
  }
예제 #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();
  }