Using GridLayoutAnimationControl

how can i use the GridLayoutAnimationController in my gridview child. I want to apply two different animations to two gridview columns when I click on gridview. One gridview column can animate from top to bottom, and one column from botton to top.

How can i achieve this?

Please help me.

I use GridLayoutAnimationController, but it can give attribute errors.

I put my code below.

public GridLayoutAnimationController(Context context, AttributeSet attrs) {
    super(context, attrs);

    TypedArray a = context.obtainStyledAttributes(attrs,
            com.android.internal.R.styleable.GridLayoutAnimation);

    Animation.Description d = Animation.Description.parseValue(
            a.peekValue(com.android.internal.R.styleable.GridLayoutAnimation_columnDelay));
    mColumnDelay = d.value;
    d = Animation.Description.parseValue(
            a.peekValue(com.android.internal.R.styleable.GridLayoutAnimation_rowDelay));
    mRowDelay = d.value;
    //noinspection PointlessBitwiseExpression
    mDirection = a.getInt(com.android.internal.R.styleable.GridLayoutAnimation_direction,
            DIRECTION_LEFT_TO_RIGHT | DIRECTION_TOP_TO_BOTTOM);
    mDirectionPriority = a.getInt(com.android.internal.R.styleable.GridLayoutAnimation_directionPriority,
            PRIORITY_NONE);

    a.recycle();
}
+4
source share

All Articles