package android.support.v7.widget;

import android.support.v7.widget.RecyclerView.v;
import android.support.v7.widget.v.b;
import android.view.View;
import android.view.ViewGroup.LayoutParams;

class RecyclerView$5 implements b {
    final /* synthetic */ RecyclerView aoo;

    RecyclerView$5(RecyclerView recyclerView) {
        this.aoo = recyclerView;
    }

    public final int getChildCount() {
        return this.aoo.getChildCount();
    }

    public final void addView(View view, int i) {
        this.aoo.addView(view, i);
        RecyclerView recyclerView = this.aoo;
        v bn = RecyclerView.bn(view);
        if (!(recyclerView.Yq == null || bn == null)) {
            recyclerView.Yq.k(bn);
        }
        if (recyclerView.anz != null) {
            for (int size = recyclerView.anz.size() - 1; size >= 0; size--) {
                recyclerView.anz.get(size);
            }
        }
    }

    public final int indexOfChild(View view) {
        return this.aoo.indexOfChild(view);
    }

    public final void removeViewAt(int i) {
        View childAt = this.aoo.getChildAt(i);
        if (childAt != null) {
            this.aoo.bs(childAt);
            childAt.clearAnimation();
        }
        this.aoo.removeViewAt(i);
    }

    public final View getChildAt(int i) {
        return this.aoo.getChildAt(i);
    }

    public final v aZ(View view) {
        return RecyclerView.bn(view);
    }

    public final void attachViewToParent(View view, int i, LayoutParams layoutParams) {
        v bn = RecyclerView.bn(view);
        if (bn != null) {
            if (bn.ks() || bn.kh()) {
                bn.kp();
            } else {
                throw new IllegalArgumentException("Called attach on a child which is not detached: " + bn + this.aoo.ji());
            }
        }
        RecyclerView.a(this.aoo, view, i, layoutParams);
    }

    public final void detachViewFromParent(int i) {
        View childAt = getChildAt(i);
        if (childAt != null) {
            v bn = RecyclerView.bn(childAt);
            if (bn != null) {
                if (!bn.ks() || bn.kh()) {
                    bn.addFlags(256);
                } else {
                    throw new IllegalArgumentException("called detach on an already detached child " + bn + this.aoo.ji());
                }
            }
        }
        RecyclerView.b(this.aoo, i);
    }

    public final void ba(View view) {
        v bn = RecyclerView.bn(view);
        if (bn != null) {
            v.a(bn, this.aoo);
        }
    }

    public final void bb(View view) {
        v bn = RecyclerView.bn(view);
        if (bn != null) {
            v.b(bn, this.aoo);
        }
    }

    public final void removeAllViews() {
        int childCount = this.aoo.getChildCount();
        for (int i = 0; i < childCount; i++) {
            View childAt = getChildAt(i);
            this.aoo.bs(childAt);
            childAt.clearAnimation();
        }
        this.aoo.removeAllViews();
    }
}
