Example usage for android.view.animation GridLayoutAnimationController GridLayoutAnimationController

List of usage examples for android.view.animation GridLayoutAnimationController GridLayoutAnimationController

Introduction

In this page you can find the example usage for android.view.animation GridLayoutAnimationController GridLayoutAnimationController.

Prototype

public GridLayoutAnimationController(Context context, AttributeSet attrs) 

Source Link

Document

Creates a new grid layout animation controller from external resources.

Usage

From source file:Main.java

private static LayoutAnimationController createLayoutAnimationFromXml(Context c, XmlPullParser parser,
        AttributeSet attrs) throws XmlPullParserException, IOException {

    LayoutAnimationController controller = null;

    int type;/* w w  w.ja v  a 2s.  c om*/
    int depth = parser.getDepth();

    while (((type = parser.next()) != XmlPullParser.END_TAG || parser.getDepth() > depth)
            && type != XmlPullParser.END_DOCUMENT) {

        if (type != XmlPullParser.START_TAG) {
            continue;
        }

        String name = parser.getName();

        if ("layoutAnimation".equals(name)) {
            controller = new LayoutAnimationController(c, attrs);
        } else if ("gridLayoutAnimation".equals(name)) {
            controller = new GridLayoutAnimationController(c, attrs);
        } else {
            throw new RuntimeException("Unknown layout animation name: " + name);
        }
    }

    return controller;
}