package com.google.android.material.bottomsheet;

import android.view.View;
import androidx.core.view.f3;
import androidx.core.view.l0;
import java.util.ArrayList;

/* JADX INFO: loaded from: classes2.dex */
public final class j implements l0 {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ o f22320a;

    public j(o oVar) {
        this.f22320a = oVar;
    }

    @Override // androidx.core.view.l0
    public final f3 i(View view, f3 f3Var) {
        o oVar = this.f22320a;
        n nVar = oVar.f22333m;
        if (nVar != null) {
            oVar.f22326f.f22294w0.remove(nVar);
        }
        if (f3Var != null) {
            n nVar2 = new n(oVar.f22329i, f3Var);
            oVar.f22333m = nVar2;
            nVar2.setWindow(oVar.getWindow());
            BottomSheetBehavior bottomSheetBehavior = oVar.f22326f;
            n nVar3 = oVar.f22333m;
            ArrayList arrayList = bottomSheetBehavior.f22294w0;
            if (!arrayList.contains(nVar3)) {
                arrayList.add(nVar3);
            }
        }
        return f3Var;
    }
}
