package androidx.fragment.app;

import android.animation.Animator;
import android.app.Activity;
import android.content.ComponentCallbacks;
import android.content.Context;
import android.content.Intent;
import android.content.res.Configuration;
import android.content.res.Resources;
import android.os.Build;
import android.os.Bundle;
import android.os.Looper;
import android.os.Parcelable;
import android.util.AttributeSet;
import android.util.Log;
import android.util.SparseArray;
import android.view.ContextMenu;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
import androidx.lifecycle.LiveData;
import androidx.lifecycle.e0;
import androidx.lifecycle.f0;
import androidx.lifecycle.g;
import java.io.FileDescriptor;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;

/* JADX INFO: loaded from: classes.dex */
public class Fragment implements ComponentCallbacks, View.OnCreateContextMenuListener, androidx.lifecycle.k, androidx.lifecycle.d0, androidx.lifecycle.f, g0.e {

    /* JADX INFO: renamed from: b0, reason: collision with root package name */
    static final Object f2135b0 = new Object();
    int A;
    int B;
    String C;
    boolean D;
    boolean E;
    boolean F;
    boolean G;
    boolean H;
    private boolean J;
    ViewGroup K;
    View L;
    boolean M;
    e O;
    boolean P;
    boolean Q;
    float R;
    LayoutInflater S;
    boolean T;
    g.c U;
    androidx.lifecycle.l V;
    z W;
    androidx.lifecycle.p<androidx.lifecycle.k> X;
    g0.d Y;
    private int Z;

    /* JADX INFO: renamed from: a0, reason: collision with root package name */
    private final ArrayList<g> f2136a0;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    Bundle f2138f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    SparseArray<Parcelable> f2139g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    Bundle f2140h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    Boolean f2141i;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    Bundle f2143k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    Fragment f2144l;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    int f2146n;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    boolean f2148p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    boolean f2149q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    boolean f2150r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    boolean f2151s;

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    boolean f2152t;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    boolean f2153u;

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    int f2154v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    m f2155w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    j<?> f2156x;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    Fragment f2158z;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    int f2137e = -1;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    String f2142j = UUID.randomUUID().toString();

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    String f2145m = null;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    private Boolean f2147o = null;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    m f2157y = new n();
    boolean I = true;
    boolean N = true;

    class a implements Runnable {
        a() {
        }

        @Override // java.lang.Runnable
        public void run() {
            Fragment.this.B1();
        }
    }

    class b implements Runnable {
        b() {
        }

        @Override // java.lang.Runnable
        public void run() {
            Fragment.this.e(false);
        }
    }

    class c implements Runnable {

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        final /* synthetic */ b0 f2162e;

        c(Fragment fragment, b0 b0Var) {
            this.f2162e = b0Var;
        }

        @Override // java.lang.Runnable
        public void run() {
            this.f2162e.g();
        }
    }

    class d extends androidx.fragment.app.g {
        d() {
        }

        @Override // androidx.fragment.app.g
        public View g(int i3) {
            View view = Fragment.this.L;
            if (view != null) {
                return view.findViewById(i3);
            }
            throw new IllegalStateException("Fragment " + Fragment.this + " does not have a view");
        }

        @Override // androidx.fragment.app.g
        public boolean h() {
            return Fragment.this.L != null;
        }
    }

    static class e {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        View f2164a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        Animator f2165b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        boolean f2166c;

        /* JADX INFO: renamed from: d, reason: collision with root package name */
        int f2167d;

        /* JADX INFO: renamed from: e, reason: collision with root package name */
        int f2168e;

        /* JADX INFO: renamed from: f, reason: collision with root package name */
        int f2169f;

        /* JADX INFO: renamed from: g, reason: collision with root package name */
        int f2170g;

        /* JADX INFO: renamed from: h, reason: collision with root package name */
        int f2171h;

        /* JADX INFO: renamed from: i, reason: collision with root package name */
        ArrayList<String> f2172i;

        /* JADX INFO: renamed from: j, reason: collision with root package name */
        ArrayList<String> f2173j;

        /* JADX INFO: renamed from: k, reason: collision with root package name */
        Object f2174k = null;

        /* JADX INFO: renamed from: l, reason: collision with root package name */
        Object f2175l;

        /* JADX INFO: renamed from: m, reason: collision with root package name */
        Object f2176m;

        /* JADX INFO: renamed from: n, reason: collision with root package name */
        Object f2177n;

        /* JADX INFO: renamed from: o, reason: collision with root package name */
        Object f2178o;

        /* JADX INFO: renamed from: p, reason: collision with root package name */
        Object f2179p;

        /* JADX INFO: renamed from: q, reason: collision with root package name */
        Boolean f2180q;

        /* JADX INFO: renamed from: r, reason: collision with root package name */
        Boolean f2181r;

        /* JADX INFO: renamed from: s, reason: collision with root package name */
        androidx.core.app.i f2182s;

        /* JADX INFO: renamed from: t, reason: collision with root package name */
        androidx.core.app.i f2183t;

        /* JADX INFO: renamed from: u, reason: collision with root package name */
        float f2184u;

        /* JADX INFO: renamed from: v, reason: collision with root package name */
        View f2185v;

        /* JADX INFO: renamed from: w, reason: collision with root package name */
        boolean f2186w;

        /* JADX INFO: renamed from: x, reason: collision with root package name */
        h f2187x;

        /* JADX INFO: renamed from: y, reason: collision with root package name */
        boolean f2188y;

        e() {
            Object obj = Fragment.f2135b0;
            this.f2175l = obj;
            this.f2176m = null;
            this.f2177n = obj;
            this.f2178o = null;
            this.f2179p = obj;
            this.f2184u = 1.0f;
            this.f2185v = null;
        }
    }

    public static class f extends RuntimeException {
        public f(String str, Exception exc) {
            super(str, exc);
        }
    }

    private static abstract class g {
        private g() {
        }

        abstract void a();
    }

    interface h {
        void a();

        void b();
    }

    public Fragment() {
        new a();
        this.U = g.c.RESUMED;
        this.X = new androidx.lifecycle.p<>();
        new AtomicInteger();
        this.f2136a0 = new ArrayList<>();
        U();
    }

    private int B() {
        g.c cVar = this.U;
        return (cVar == g.c.INITIALIZED || this.f2158z == null) ? cVar.ordinal() : Math.min(cVar.ordinal(), this.f2158z.B());
    }

    private void U() {
        this.V = new androidx.lifecycle.l(this);
        this.Y = g0.d.a(this);
    }

    @Deprecated
    public static Fragment W(Context context, String str, Bundle bundle) {
        try {
            Fragment fragmentNewInstance = i.d(context.getClassLoader(), str).getConstructor(new Class[0]).newInstance(new Object[0]);
            if (bundle != null) {
                bundle.setClassLoader(fragmentNewInstance.getClass().getClassLoader());
                fragmentNewInstance.t1(bundle);
            }
            return fragmentNewInstance;
        } catch (IllegalAccessException e3) {
            throw new f("Unable to instantiate fragment " + str + ": make sure class name exists, is public, and has an empty constructor that is public", e3);
        } catch (InstantiationException e4) {
            throw new f("Unable to instantiate fragment " + str + ": make sure class name exists, is public, and has an empty constructor that is public", e4);
        } catch (NoSuchMethodException e5) {
            throw new f("Unable to instantiate fragment " + str + ": could not find Fragment constructor", e5);
        } catch (InvocationTargetException e6) {
            throw new f("Unable to instantiate fragment " + str + ": calling Fragment constructor caused an exception", e6);
        }
    }

    private e h() {
        if (this.O == null) {
            this.O = new e();
        }
        return this.O;
    }

    private void o1() {
        if (m.E0(3)) {
            Log.d("FragmentManager", "moveto RESTORE_VIEW_STATE: " + this);
        }
        if (this.L != null) {
            p1(this.f2138f);
        }
        this.f2138f = null;
    }

    @Deprecated
    public LayoutInflater A(Bundle bundle) {
        j<?> jVar = this.f2156x;
        if (jVar == null) {
            throw new IllegalStateException("onGetLayoutInflater() cannot be executed until the Fragment is attached to the FragmentManager.");
        }
        LayoutInflater layoutInflaterN = jVar.n();
        androidx.core.view.g.b(layoutInflaterN, this.f2157y.t0());
        return layoutInflaterN;
    }

    public void A0(Menu menu) {
    }

    void A1(ArrayList<String> arrayList, ArrayList<String> arrayList2) {
        h();
        e eVar = this.O;
        eVar.f2172i = arrayList;
        eVar.f2173j = arrayList2;
    }

    public void B0() {
        this.J = true;
    }

    public void B1() {
        if (this.O == null || !h().f2186w) {
            return;
        }
        if (this.f2156x == null) {
            h().f2186w = false;
        } else if (Looper.myLooper() != this.f2156x.l().getLooper()) {
            this.f2156x.l().postAtFrontOfQueue(new b());
        } else {
            e(true);
        }
    }

    int C() {
        e eVar = this.O;
        if (eVar == null) {
            return 0;
        }
        return eVar.f2171h;
    }

    public void C0(boolean z2) {
    }

    public final Fragment D() {
        return this.f2158z;
    }

    public void D0(Menu menu) {
    }

    public final m E() {
        m mVar = this.f2155w;
        if (mVar != null) {
            return mVar;
        }
        throw new IllegalStateException("Fragment " + this + " not associated with a fragment manager.");
    }

    public void E0(boolean z2) {
    }

    boolean F() {
        e eVar = this.O;
        if (eVar == null) {
            return false;
        }
        return eVar.f2166c;
    }

    @Deprecated
    public void F0(int i3, String[] strArr, int[] iArr) {
    }

    int G() {
        e eVar = this.O;
        if (eVar == null) {
            return 0;
        }
        return eVar.f2169f;
    }

    public void G0() {
        this.J = true;
    }

    int H() {
        e eVar = this.O;
        if (eVar == null) {
            return 0;
        }
        return eVar.f2170g;
    }

    public void H0(Bundle bundle) {
    }

    float I() {
        e eVar = this.O;
        if (eVar == null) {
            return 1.0f;
        }
        return eVar.f2184u;
    }

    public void I0() {
        this.J = true;
    }

    public Object J() {
        e eVar = this.O;
        if (eVar == null) {
            return null;
        }
        Object obj = eVar.f2177n;
        return obj == f2135b0 ? w() : obj;
    }

    public void J0() {
        this.J = true;
    }

    public final Resources K() {
        return l1().getResources();
    }

    public void K0(View view, Bundle bundle) {
    }

    public Object L() {
        e eVar = this.O;
        if (eVar == null) {
            return null;
        }
        Object obj = eVar.f2175l;
        return obj == f2135b0 ? t() : obj;
    }

    public void L0(Bundle bundle) {
        this.J = true;
    }

    public Object M() {
        e eVar = this.O;
        if (eVar == null) {
            return null;
        }
        return eVar.f2178o;
    }

    void M0(Bundle bundle) {
        this.f2157y.P0();
        this.f2137e = 3;
        this.J = false;
        f0(bundle);
        if (this.J) {
            o1();
            this.f2157y.y();
        } else {
            throw new d0("Fragment " + this + " did not call through to super.onActivityCreated()");
        }
    }

    public Object N() {
        e eVar = this.O;
        if (eVar == null) {
            return null;
        }
        Object obj = eVar.f2179p;
        return obj == f2135b0 ? M() : obj;
    }

    void N0() {
        Iterator<g> it = this.f2136a0.iterator();
        while (it.hasNext()) {
            it.next().a();
        }
        this.f2136a0.clear();
        this.f2157y.j(this.f2156x, f(), this);
        this.f2137e = 0;
        this.J = false;
        i0(this.f2156x.k());
        if (this.J) {
            this.f2155w.I(this);
            this.f2157y.z();
        } else {
            throw new d0("Fragment " + this + " did not call through to super.onAttach()");
        }
    }

    ArrayList<String> O() {
        ArrayList<String> arrayList;
        e eVar = this.O;
        return (eVar == null || (arrayList = eVar.f2172i) == null) ? new ArrayList<>() : arrayList;
    }

    void O0(Configuration configuration) {
        onConfigurationChanged(configuration);
        this.f2157y.A(configuration);
    }

    ArrayList<String> P() {
        ArrayList<String> arrayList;
        e eVar = this.O;
        return (eVar == null || (arrayList = eVar.f2173j) == null) ? new ArrayList<>() : arrayList;
    }

    boolean P0(MenuItem menuItem) {
        if (this.D) {
            return false;
        }
        if (k0(menuItem)) {
            return true;
        }
        return this.f2157y.B(menuItem);
    }

    public final String Q(int i3) {
        return K().getString(i3);
    }

    void Q0(Bundle bundle) {
        this.f2157y.P0();
        this.f2137e = 1;
        this.J = false;
        if (Build.VERSION.SDK_INT >= 19) {
            this.V.a(new androidx.lifecycle.i() { // from class: androidx.fragment.app.Fragment.5
                @Override // androidx.lifecycle.i
                public void g(androidx.lifecycle.k kVar, g.b bVar) {
                    View view;
                    if (bVar != g.b.ON_STOP || (view = Fragment.this.L) == null) {
                        return;
                    }
                    view.cancelPendingInputEvents();
                }
            });
        }
        this.Y.d(bundle);
        l0(bundle);
        this.T = true;
        if (this.J) {
            this.V.h(g.b.ON_CREATE);
            return;
        }
        throw new d0("Fragment " + this + " did not call through to super.onCreate()");
    }

    @Deprecated
    public final Fragment R() {
        String str;
        Fragment fragment = this.f2144l;
        if (fragment != null) {
            return fragment;
        }
        m mVar = this.f2155w;
        if (mVar == null || (str = this.f2145m) == null) {
            return null;
        }
        return mVar.f0(str);
    }

    boolean R0(Menu menu, MenuInflater menuInflater) {
        boolean z2 = false;
        if (this.D) {
            return false;
        }
        if (this.H && this.I) {
            z2 = true;
            o0(menu, menuInflater);
        }
        return z2 | this.f2157y.D(menu, menuInflater);
    }

    public View S() {
        return this.L;
    }

    void S0(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        this.f2157y.P0();
        this.f2153u = true;
        this.W = new z(this, i());
        View viewP0 = p0(layoutInflater, viewGroup, bundle);
        this.L = viewP0;
        if (viewP0 == null) {
            if (this.W.g()) {
                throw new IllegalStateException("Called getViewLifecycleOwner() but onCreateView() returned null");
            }
            this.W = null;
        } else {
            this.W.f();
            e0.a(this.L, this.W);
            f0.a(this.L, this.W);
            g0.f.a(this.L, this.W);
            this.X.i(this.W);
        }
    }

    public LiveData<androidx.lifecycle.k> T() {
        return this.X;
    }

    void T0() {
        this.f2157y.E();
        this.V.h(g.b.ON_DESTROY);
        this.f2137e = 0;
        this.J = false;
        this.T = false;
        q0();
        if (this.J) {
            return;
        }
        throw new d0("Fragment " + this + " did not call through to super.onDestroy()");
    }

    void U0() {
        this.f2157y.F();
        if (this.L != null && this.W.a().b().isAtLeast(g.c.CREATED)) {
            this.W.e(g.b.ON_DESTROY);
        }
        this.f2137e = 1;
        this.J = false;
        s0();
        if (this.J) {
            androidx.loader.app.a.b(this).c();
            this.f2153u = false;
        } else {
            throw new d0("Fragment " + this + " did not call through to super.onDestroyView()");
        }
    }

    void V() {
        U();
        this.f2142j = UUID.randomUUID().toString();
        this.f2148p = false;
        this.f2149q = false;
        this.f2150r = false;
        this.f2151s = false;
        this.f2152t = false;
        this.f2154v = 0;
        this.f2155w = null;
        this.f2157y = new n();
        this.f2156x = null;
        this.A = 0;
        this.B = 0;
        this.C = null;
        this.D = false;
        this.E = false;
    }

    void V0() {
        this.f2137e = -1;
        this.J = false;
        t0();
        this.S = null;
        if (this.J) {
            if (this.f2157y.D0()) {
                return;
            }
            this.f2157y.E();
            this.f2157y = new n();
            return;
        }
        throw new d0("Fragment " + this + " did not call through to super.onDetach()");
    }

    LayoutInflater W0(Bundle bundle) {
        LayoutInflater layoutInflaterU0 = u0(bundle);
        this.S = layoutInflaterU0;
        return layoutInflaterU0;
    }

    boolean X() {
        e eVar = this.O;
        if (eVar == null) {
            return false;
        }
        return eVar.f2188y;
    }

    void X0() {
        onLowMemory();
        this.f2157y.G();
    }

    final boolean Y() {
        return this.f2154v > 0;
    }

    void Y0(boolean z2) {
        y0(z2);
        this.f2157y.H(z2);
    }

    public final boolean Z() {
        m mVar;
        return this.I && ((mVar = this.f2155w) == null || mVar.G0(this.f2158z));
    }

    boolean Z0(MenuItem menuItem) {
        if (this.D) {
            return false;
        }
        if (this.H && this.I && z0(menuItem)) {
            return true;
        }
        return this.f2157y.J(menuItem);
    }

    @Override // androidx.lifecycle.k
    public androidx.lifecycle.g a() {
        return this.V;
    }

    boolean a0() {
        e eVar = this.O;
        if (eVar == null) {
            return false;
        }
        return eVar.f2186w;
    }

    void a1(Menu menu) {
        if (this.D) {
            return;
        }
        if (this.H && this.I) {
            A0(menu);
        }
        this.f2157y.K(menu);
    }

    public final boolean b0() {
        return this.f2149q;
    }

    void b1() {
        this.f2157y.M();
        if (this.L != null) {
            this.W.e(g.b.ON_PAUSE);
        }
        this.V.h(g.b.ON_PAUSE);
        this.f2137e = 6;
        this.J = false;
        B0();
        if (this.J) {
            return;
        }
        throw new d0("Fragment " + this + " did not call through to super.onPause()");
    }

    final boolean c0() {
        Fragment fragmentD = D();
        return fragmentD != null && (fragmentD.b0() || fragmentD.c0());
    }

    void c1(boolean z2) {
        C0(z2);
        this.f2157y.N(z2);
    }

    @Override // g0.e
    public final g0.c d() {
        return this.Y.b();
    }

    public final boolean d0() {
        m mVar = this.f2155w;
        if (mVar == null) {
            return false;
        }
        return mVar.J0();
    }

    boolean d1(Menu menu) {
        boolean z2 = false;
        if (this.D) {
            return false;
        }
        if (this.H && this.I) {
            z2 = true;
            D0(menu);
        }
        return z2 | this.f2157y.O(menu);
    }

    void e(boolean z2) {
        ViewGroup viewGroup;
        m mVar;
        e eVar = this.O;
        h hVar = null;
        if (eVar != null) {
            eVar.f2186w = false;
            h hVar2 = eVar.f2187x;
            eVar.f2187x = null;
            hVar = hVar2;
        }
        if (hVar != null) {
            hVar.a();
            return;
        }
        if (!m.P || this.L == null || (viewGroup = this.K) == null || (mVar = this.f2155w) == null) {
            return;
        }
        b0 b0VarN = b0.n(viewGroup, mVar);
        b0VarN.p();
        if (z2) {
            this.f2156x.l().post(new c(this, b0VarN));
        } else {
            b0VarN.g();
        }
    }

    void e0() {
        this.f2157y.P0();
    }

    void e1() {
        boolean zH0 = this.f2155w.H0(this);
        Boolean bool = this.f2147o;
        if (bool == null || bool.booleanValue() != zH0) {
            this.f2147o = Boolean.valueOf(zH0);
            E0(zH0);
            this.f2157y.P();
        }
    }

    public final boolean equals(Object obj) {
        return super.equals(obj);
    }

    androidx.fragment.app.g f() {
        return new d();
    }

    @Deprecated
    public void f0(Bundle bundle) {
        this.J = true;
    }

    void f1() {
        this.f2157y.P0();
        this.f2157y.a0(true);
        this.f2137e = 7;
        this.J = false;
        G0();
        if (!this.J) {
            throw new d0("Fragment " + this + " did not call through to super.onResume()");
        }
        androidx.lifecycle.l lVar = this.V;
        g.b bVar = g.b.ON_RESUME;
        lVar.h(bVar);
        if (this.L != null) {
            this.W.e(bVar);
        }
        this.f2157y.Q();
    }

    public void g(String str, FileDescriptor fileDescriptor, PrintWriter printWriter, String[] strArr) {
        printWriter.print(str);
        printWriter.print("mFragmentId=#");
        printWriter.print(Integer.toHexString(this.A));
        printWriter.print(" mContainerId=#");
        printWriter.print(Integer.toHexString(this.B));
        printWriter.print(" mTag=");
        printWriter.println(this.C);
        printWriter.print(str);
        printWriter.print("mState=");
        printWriter.print(this.f2137e);
        printWriter.print(" mWho=");
        printWriter.print(this.f2142j);
        printWriter.print(" mBackStackNesting=");
        printWriter.println(this.f2154v);
        printWriter.print(str);
        printWriter.print("mAdded=");
        printWriter.print(this.f2148p);
        printWriter.print(" mRemoving=");
        printWriter.print(this.f2149q);
        printWriter.print(" mFromLayout=");
        printWriter.print(this.f2150r);
        printWriter.print(" mInLayout=");
        printWriter.println(this.f2151s);
        printWriter.print(str);
        printWriter.print("mHidden=");
        printWriter.print(this.D);
        printWriter.print(" mDetached=");
        printWriter.print(this.E);
        printWriter.print(" mMenuVisible=");
        printWriter.print(this.I);
        printWriter.print(" mHasMenu=");
        printWriter.println(this.H);
        printWriter.print(str);
        printWriter.print("mRetainInstance=");
        printWriter.print(this.F);
        printWriter.print(" mUserVisibleHint=");
        printWriter.println(this.N);
        if (this.f2155w != null) {
            printWriter.print(str);
            printWriter.print("mFragmentManager=");
            printWriter.println(this.f2155w);
        }
        if (this.f2156x != null) {
            printWriter.print(str);
            printWriter.print("mHost=");
            printWriter.println(this.f2156x);
        }
        if (this.f2158z != null) {
            printWriter.print(str);
            printWriter.print("mParentFragment=");
            printWriter.println(this.f2158z);
        }
        if (this.f2143k != null) {
            printWriter.print(str);
            printWriter.print("mArguments=");
            printWriter.println(this.f2143k);
        }
        if (this.f2138f != null) {
            printWriter.print(str);
            printWriter.print("mSavedFragmentState=");
            printWriter.println(this.f2138f);
        }
        if (this.f2139g != null) {
            printWriter.print(str);
            printWriter.print("mSavedViewState=");
            printWriter.println(this.f2139g);
        }
        if (this.f2140h != null) {
            printWriter.print(str);
            printWriter.print("mSavedViewRegistryState=");
            printWriter.println(this.f2140h);
        }
        Fragment fragmentR = R();
        if (fragmentR != null) {
            printWriter.print(str);
            printWriter.print("mTarget=");
            printWriter.print(fragmentR);
            printWriter.print(" mTargetRequestCode=");
            printWriter.println(this.f2146n);
        }
        printWriter.print(str);
        printWriter.print("mPopDirection=");
        printWriter.println(F());
        if (s() != 0) {
            printWriter.print(str);
            printWriter.print("getEnterAnim=");
            printWriter.println(s());
        }
        if (v() != 0) {
            printWriter.print(str);
            printWriter.print("getExitAnim=");
            printWriter.println(v());
        }
        if (G() != 0) {
            printWriter.print(str);
            printWriter.print("getPopEnterAnim=");
            printWriter.println(G());
        }
        if (H() != 0) {
            printWriter.print(str);
            printWriter.print("getPopExitAnim=");
            printWriter.println(H());
        }
        if (this.K != null) {
            printWriter.print(str);
            printWriter.print("mContainer=");
            printWriter.println(this.K);
        }
        if (this.L != null) {
            printWriter.print(str);
            printWriter.print("mView=");
            printWriter.println(this.L);
        }
        if (n() != null) {
            printWriter.print(str);
            printWriter.print("mAnimatingAway=");
            printWriter.println(n());
        }
        if (r() != null) {
            androidx.loader.app.a.b(this).a(str, fileDescriptor, printWriter, strArr);
        }
        printWriter.print(str);
        printWriter.println("Child " + this.f2157y + ":");
        this.f2157y.W(str + "  ", fileDescriptor, printWriter, strArr);
    }

    @Deprecated
    public void g0(int i3, int i4, Intent intent) {
        if (m.E0(2)) {
            Log.v("FragmentManager", "Fragment " + this + " received the following in onActivityResult(): requestCode: " + i3 + " resultCode: " + i4 + " data: " + intent);
        }
    }

    void g1(Bundle bundle) {
        H0(bundle);
        this.Y.e(bundle);
        Parcelable parcelableD1 = this.f2157y.d1();
        if (parcelableD1 != null) {
            bundle.putParcelable("android:support:fragments", parcelableD1);
        }
    }

    @Deprecated
    public void h0(Activity activity) {
        this.J = true;
    }

    void h1() {
        this.f2157y.P0();
        this.f2157y.a0(true);
        this.f2137e = 5;
        this.J = false;
        I0();
        if (!this.J) {
            throw new d0("Fragment " + this + " did not call through to super.onStart()");
        }
        androidx.lifecycle.l lVar = this.V;
        g.b bVar = g.b.ON_START;
        lVar.h(bVar);
        if (this.L != null) {
            this.W.e(bVar);
        }
        this.f2157y.R();
    }

    public final int hashCode() {
        return super.hashCode();
    }

    @Override // androidx.lifecycle.d0
    public androidx.lifecycle.c0 i() {
        if (this.f2155w == null) {
            throw new IllegalStateException("Can't access ViewModels from detached fragment");
        }
        if (B() != g.c.INITIALIZED.ordinal()) {
            return this.f2155w.z0(this);
        }
        throw new IllegalStateException("Calling getViewModelStore() before a Fragment reaches onCreate() when using setMaxLifecycle(INITIALIZED) is not supported");
    }

    public void i0(Context context) {
        this.J = true;
        j<?> jVar = this.f2156x;
        Activity activityJ = jVar == null ? null : jVar.j();
        if (activityJ != null) {
            this.J = false;
            h0(activityJ);
        }
    }

    void i1() {
        this.f2157y.T();
        if (this.L != null) {
            this.W.e(g.b.ON_STOP);
        }
        this.V.h(g.b.ON_STOP);
        this.f2137e = 4;
        this.J = false;
        J0();
        if (this.J) {
            return;
        }
        throw new d0("Fragment " + this + " did not call through to super.onStop()");
    }

    Fragment j(String str) {
        return str.equals(this.f2142j) ? this : this.f2157y.i0(str);
    }

    @Deprecated
    public void j0(Fragment fragment) {
    }

    void j1() {
        K0(this.L, this.f2138f);
        this.f2157y.U();
    }

    public final androidx.fragment.app.e k() {
        j<?> jVar = this.f2156x;
        if (jVar == null) {
            return null;
        }
        return (androidx.fragment.app.e) jVar.j();
    }

    public boolean k0(MenuItem menuItem) {
        return false;
    }

    public final androidx.fragment.app.e k1() {
        androidx.fragment.app.e eVarK = k();
        if (eVarK != null) {
            return eVarK;
        }
        throw new IllegalStateException("Fragment " + this + " not attached to an activity.");
    }

    public boolean l() {
        Boolean bool;
        e eVar = this.O;
        if (eVar == null || (bool = eVar.f2181r) == null) {
            return true;
        }
        return bool.booleanValue();
    }

    public void l0(Bundle bundle) {
        this.J = true;
        n1(bundle);
        if (this.f2157y.I0(1)) {
            return;
        }
        this.f2157y.C();
    }

    public final Context l1() {
        Context contextR = r();
        if (contextR != null) {
            return contextR;
        }
        throw new IllegalStateException("Fragment " + this + " not attached to a context.");
    }

    public boolean m() {
        Boolean bool;
        e eVar = this.O;
        if (eVar == null || (bool = eVar.f2180q) == null) {
            return true;
        }
        return bool.booleanValue();
    }

    public Animation m0(int i3, boolean z2, int i4) {
        return null;
    }

    public final View m1() {
        View viewS = S();
        if (viewS != null) {
            return viewS;
        }
        throw new IllegalStateException("Fragment " + this + " did not return a View from onCreateView() or this was called before onCreateView().");
    }

    View n() {
        e eVar = this.O;
        if (eVar == null) {
            return null;
        }
        return eVar.f2164a;
    }

    public Animator n0(int i3, boolean z2, int i4) {
        return null;
    }

    void n1(Bundle bundle) {
        Parcelable parcelable;
        if (bundle == null || (parcelable = bundle.getParcelable("android:support:fragments")) == null) {
            return;
        }
        this.f2157y.b1(parcelable);
        this.f2157y.C();
    }

    Animator o() {
        e eVar = this.O;
        if (eVar == null) {
            return null;
        }
        return eVar.f2165b;
    }

    public void o0(Menu menu, MenuInflater menuInflater) {
    }

    @Override // android.content.ComponentCallbacks
    public void onConfigurationChanged(Configuration configuration) {
        this.J = true;
    }

    @Override // android.view.View.OnCreateContextMenuListener
    public void onCreateContextMenu(ContextMenu contextMenu, View view, ContextMenu.ContextMenuInfo contextMenuInfo) {
        k1().onCreateContextMenu(contextMenu, view, contextMenuInfo);
    }

    @Override // android.content.ComponentCallbacks
    public void onLowMemory() {
        this.J = true;
    }

    public final Bundle p() {
        return this.f2143k;
    }

    public View p0(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        int i3 = this.Z;
        if (i3 != 0) {
            return layoutInflater.inflate(i3, viewGroup, false);
        }
        return null;
    }

    final void p1(Bundle bundle) {
        SparseArray<Parcelable> sparseArray = this.f2139g;
        if (sparseArray != null) {
            this.L.restoreHierarchyState(sparseArray);
            this.f2139g = null;
        }
        if (this.L != null) {
            this.W.h(this.f2140h);
            this.f2140h = null;
        }
        this.J = false;
        L0(bundle);
        if (this.J) {
            if (this.L != null) {
                this.W.e(g.b.ON_CREATE);
            }
        } else {
            throw new d0("Fragment " + this + " did not call through to super.onViewStateRestored()");
        }
    }

    public final m q() {
        if (this.f2156x != null) {
            return this.f2157y;
        }
        throw new IllegalStateException("Fragment " + this + " has not been attached yet.");
    }

    public void q0() {
        this.J = true;
    }

    void q1(View view) {
        h().f2164a = view;
    }

    public Context r() {
        j<?> jVar = this.f2156x;
        if (jVar == null) {
            return null;
        }
        return jVar.k();
    }

    public void r0() {
    }

    void r1(int i3, int i4, int i5, int i6) {
        if (this.O == null && i3 == 0 && i4 == 0 && i5 == 0 && i6 == 0) {
            return;
        }
        h().f2167d = i3;
        h().f2168e = i4;
        h().f2169f = i5;
        h().f2170g = i6;
    }

    int s() {
        e eVar = this.O;
        if (eVar == null) {
            return 0;
        }
        return eVar.f2167d;
    }

    public void s0() {
        this.J = true;
    }

    void s1(Animator animator) {
        h().f2165b = animator;
    }

    public Object t() {
        e eVar = this.O;
        if (eVar == null) {
            return null;
        }
        return eVar.f2174k;
    }

    public void t0() {
        this.J = true;
    }

    public void t1(Bundle bundle) {
        if (this.f2155w != null && d0()) {
            throw new IllegalStateException("Fragment already added and state has been saved");
        }
        this.f2143k = bundle;
    }

    public String toString() {
        StringBuilder sb = new StringBuilder(128);
        sb.append(getClass().getSimpleName());
        sb.append("{");
        sb.append(Integer.toHexString(System.identityHashCode(this)));
        sb.append("}");
        sb.append(" (");
        sb.append(this.f2142j);
        if (this.A != 0) {
            sb.append(" id=0x");
            sb.append(Integer.toHexString(this.A));
        }
        if (this.C != null) {
            sb.append(" tag=");
            sb.append(this.C);
        }
        sb.append(")");
        return sb.toString();
    }

    androidx.core.app.i u() {
        e eVar = this.O;
        if (eVar == null) {
            return null;
        }
        return eVar.f2182s;
    }

    public LayoutInflater u0(Bundle bundle) {
        return A(bundle);
    }

    void u1(View view) {
        h().f2185v = view;
    }

    int v() {
        e eVar = this.O;
        if (eVar == null) {
            return 0;
        }
        return eVar.f2168e;
    }

    public void v0(boolean z2) {
    }

    void v1(boolean z2) {
        h().f2188y = z2;
    }

    public Object w() {
        e eVar = this.O;
        if (eVar == null) {
            return null;
        }
        return eVar.f2176m;
    }

    @Deprecated
    public void w0(Activity activity, AttributeSet attributeSet, Bundle bundle) {
        this.J = true;
    }

    void w1(int i3) {
        if (this.O == null && i3 == 0) {
            return;
        }
        h();
        this.O.f2171h = i3;
    }

    androidx.core.app.i x() {
        e eVar = this.O;
        if (eVar == null) {
            return null;
        }
        return eVar.f2183t;
    }

    public void x0(Context context, AttributeSet attributeSet, Bundle bundle) {
        this.J = true;
        j<?> jVar = this.f2156x;
        Activity activityJ = jVar == null ? null : jVar.j();
        if (activityJ != null) {
            this.J = false;
            w0(activityJ, attributeSet, bundle);
        }
    }

    void x1(h hVar) {
        h();
        e eVar = this.O;
        h hVar2 = eVar.f2187x;
        if (hVar == hVar2) {
            return;
        }
        if (hVar != null && hVar2 != null) {
            throw new IllegalStateException("Trying to set a replacement startPostponedEnterTransition on " + this);
        }
        if (eVar.f2186w) {
            eVar.f2187x = hVar;
        }
        if (hVar != null) {
            hVar.b();
        }
    }

    View y() {
        e eVar = this.O;
        if (eVar == null) {
            return null;
        }
        return eVar.f2185v;
    }

    public void y0(boolean z2) {
    }

    void y1(boolean z2) {
        if (this.O == null) {
            return;
        }
        h().f2166c = z2;
    }

    public final Object z() {
        j<?> jVar = this.f2156x;
        if (jVar == null) {
            return null;
        }
        return jVar.m();
    }

    public boolean z0(MenuItem menuItem) {
        return false;
    }

    void z1(float f3) {
        h().f2184u = f3;
    }
}
