package android.support.v7.widget;

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

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

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

    public final void n(v vVar) {
        boolean z = true;
        vVar.ao(true);
        if (vVar.apP != null && vVar.apQ == null) {
            vVar.apP = null;
        }
        vVar.apQ = null;
        if (!v.z(vVar)) {
            boolean z2;
            RecyclerView recyclerView = this.aoo;
            View view = vVar.apJ;
            recyclerView.jl();
            v vVar2 = recyclerView.anf;
            int indexOfChild = vVar2.aha.indexOfChild(view);
            if (indexOfChild == -1) {
                vVar2.aX(view);
                z2 = true;
            } else if (vVar2.ahb.get(indexOfChild)) {
                vVar2.ahb.bJ(indexOfChild);
                vVar2.aX(view);
                vVar2.aha.removeViewAt(indexOfChild);
                z2 = true;
            } else {
                z2 = false;
            }
            if (z2) {
                v bn = RecyclerView.bn(view);
                recyclerView.anc.t(bn);
                recyclerView.anc.s(bn);
            }
            if (z2) {
                z = false;
            }
            recyclerView.ak(z);
            if (!z2 && vVar.ks()) {
                this.aoo.removeDetachedView(vVar.apJ, false);
            }
        }
    }
}
