Example usage for android.graphics.drawable Drawable createFromXmlInner

List of usage examples for android.graphics.drawable Drawable createFromXmlInner

Introduction

In this page you can find the example usage for android.graphics.drawable Drawable createFromXmlInner.

Prototype

@NonNull
public static Drawable createFromXmlInner(@NonNull Resources r, @NonNull XmlPullParser parser,
        @NonNull AttributeSet attrs) throws XmlPullParserException, IOException 

Source Link

Document

Create from inside an XML document.

Usage

From source file:android.content.res.VectorResources.java

private Drawable createDrawableFromXmlInner(XmlPullParser parser, AttributeSet attrs)
        throws XmlPullParserException, IOException {
    final Drawable drawable;
    final String name = parser.getName();
    switch (name) {
    case "vector":
        VectorDrawable vectorDrawable = new VectorDrawable();
        vectorDrawable.inflate(this, parser, attrs);
        drawable = vectorDrawable;/*from w ww  . j a  v  a2s.  co  m*/
        break;
    case "animated-vector":
        AnimatedVectorDrawable animatedVectorDrawable = new AnimatedVectorDrawable();
        animatedVectorDrawable.inflate(mContext, parser, attrs);
        drawable = animatedVectorDrawable;
        break;
    default:
        drawable = Drawable.createFromXmlInner(this, parser, attrs);
    }
    return drawable;
}