docs: private void inflateLayers(Resources r, XmlPullParser parser, AttributeSet attrs, Resources.Theme theme)
              throws XmlPullParserException, IOException {
          final LayerState state = mLayerState;
  
          final int innerDepth = parser.getDepth() + 1;
          int type;
          int depth;
          while ((type = parser.next()) != XmlPullParser.END_DOCUMENT
                  && ((depth = parser.getDepth()) >= innerDepth || type != XmlPullParser.END_TAG)) {
              if (type != XmlPullParser.START_TAG) {
                  continue;
              }
  
              if (depth > innerDepth || !parser.getName().equals("item")) {
                  continue;
              }
  
              final ChildDrawable layer = new ChildDrawable();
              final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.LayerDrawableItem);
              updateLayerFromTypedArray(layer, a);
              a.recycle();
  
              // If the layer doesn't have a drawable or unresolved theme
              // attribute for a drawable, attempt to parse one from the child
              // element.
              if (layer.mDrawable == null && (layer.mThemeAttrs == null ||
                      layer.mThemeAttrs[R.styleable.LayerDrawableItem_android_drawable] == 0)) {
                  while ((type = parser.next()) == XmlPullParser.TEXT) {
                  }
                  if (type != XmlPullParser.START_TAG) {
                      throw new XmlPullParserException(parser.getPositionDescription()
                              + ": <item> tag requires a 'drawable' attribute or "
                              + "child tag defining a drawable");
                  }
                  layer.mDrawable = LollipopDrawablesCompat.createFromXmlInner(r, parser, attrs, theme);
              }
  
              if (layer.mDrawable != null) {
                  state.mChildrenChangingConfigurations |=
                          layer.mDrawable.getChangingConfigurations();
                  layer.mDrawable.setCallback(this);
              }
  
              addLayer(layer);
          }
      }