code: public void setDrawable(int index, Drawable drawable) {
          if (index >= mLayerState.mNum) {
              throw new IndexOutOfBoundsException();
          }
  
          final ChildDrawable[] layers = mLayerState.mChildren;
          final ChildDrawable childDrawable = layers[index];
          if (childDrawable.mDrawable != null) {
              if (drawable != null) {
                  final Rect bounds = childDrawable.mDrawable.getBounds();
                  drawable.setBounds(bounds);
              }
  
              childDrawable.mDrawable.setCallback(null);
          }
  
          if (drawable != null) {
              drawable.setCallback(this);
          }
  
          childDrawable.mDrawable = drawable;
          mLayerState.invalidateCache();
  
          refreshChildPadding(index, childDrawable);
      }
docs: Sets the drawable for the layer at the specified index.
  
  @param index    The index of the layer to modify, must be in the range {@code
  0...getNumberOfLayers()-1}.
  @param drawable The drawable to set for the layer.
  @attr ref android.R.styleable#LayerDrawableItem_drawable
  @see #getDrawable(int)