package com.ss.android.ugc.aweme.shortvideo.mvtemplate.choosemedia;

import X.022;
import X.070;
import X.0HH;
import X.6co;
import X.78e;
import X.7he;
import X.C0636Mcf;
import X.C0637Mcg;
import X.C0642Mcl;
import X.C0651Mcu;
import X.C0653Mcw;
import X.C0654Mcx;
import X.C1079Mjy;
import X.C1481MqS;
import X.C1593MsG;
import X.C1594MsH;
import X.C1595MsI;
import X.C1636Msx;
import X.C1643Mt4;
import X.C1644Mt5;
import X.C4366Nvt;
import X.C4690O2r;
import X.Crj;
import X.HeD;
import X.Ls2;
import X.M12;
import X.MbK;
import X.Qen;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageButton;
import android.widget.RelativeLayout;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.ss.android.ugc.aweme.shortvideo.ShortVideoContext;
import com.ss.android.ugc.effectmanager.effect.model.ProviderEffect;
import java.util.HashMap;
import kotlin.h.b.n;

public final class MvChooseGiphyFragment extends Fragment {
    public static final C1594MsH LJFF = new C1594MsH((byte) 0);
    public C1595MsI LIZ;
    public ShortVideoContext LIZIZ;
    public final Crj LIZJ = 7he.LIZ(C0636Mcf.LIZ);
    public final Crj LIZLLL = 7he.LIZ(new C0637Mcg(this));
    public C4690O2r LJ;
    public ViewGroup LJI;
    public Context LJII;
    public C1636Msx LJIIIIZZ;
    public View LJIIIZ;
    public View LJIIJ;
    public final Crj LJIIJJI = 7he.LIZ(new C0651Mcu(this));
    public final Crj LJIIL = 7he.LIZ(new C0653Mcw(this));
    public final C1079Mjy LJIILIIL = new C1079Mjy();
    public HashMap LJIILJJIL;

    static {
        Covode.recordClassIndex(111163);
    }

    public final C0654Mcx<ProviderEffect> LIZ() {
        return (C0654Mcx) this.LJIIJJI.getValue();
    }

    public final MbK<ProviderEffect> LIZIZ() {
        return (MbK) this.LJIIL.getValue();
    }

    public final /* synthetic */ void onDestroyView() {
        MvChooseGiphyFragment.super.onDestroyView();
        HashMap hashMap = this.LJIILJJIL;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

    public static final /* synthetic */ C1595MsI LIZ(MvChooseGiphyFragment mvChooseGiphyFragment) {
        C1595MsI msI = mvChooseGiphyFragment.LIZ;
        if (msI == null) {
            n.LIZ("");
        }
        return msI;
    }

    public final void onActivityCreated(Bundle bundle) {
        MvChooseGiphyFragment.super.onActivityCreated(bundle);
        C1595MsI msI = this.LIZ;
        if (msI == null) {
            n.LIZ("");
        }
        msI.LJFF();
    }

    public final void onCreate(Bundle bundle) {
        ShortVideoContext shortVideoContext;
        MvChooseGiphyFragment.super.onCreate(bundle);
        if (getArguments() != null) {
            Bundle arguments = getArguments();
            if (arguments != null) {
                shortVideoContext = (ShortVideoContext) arguments.getParcelable("key_short_video_context");
            } else {
                shortVideoContext = null;
            }
            this.LIZIZ = shortVideoContext;
        }
    }

    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        MethodCollector.i(6416);
        LayoutInflater layoutInflater2 = layoutInflater;
        M12.LIZ(layoutInflater2);
        View LIZ2 = 0HH.LIZ(layoutInflater2, 2131559837, viewGroup, false);
        if (LIZ2 != null) {
            ViewGroup viewGroup2 = (ViewGroup) LIZ2;
            this.LJI = viewGroup2;
            if (viewGroup2 == null) {
                n.LIZ("");
            }
            Context context = viewGroup2.getContext();
            n.LIZIZ(context, "");
            this.LJII = context;
            if (context == null) {
                n.LIZ("");
            }
            ViewGroup viewGroup3 = this.LJI;
            if (viewGroup3 == null) {
                n.LIZ("");
            }
            View findViewById = viewGroup3.findViewById(2131365291);
            n.LIZIZ(findViewById, "");
            FrameLayout frameLayout = (FrameLayout) findViewById;
            ViewGroup viewGroup4 = this.LJI;
            if (viewGroup4 == null) {
                n.LIZ("");
            }
            View findViewById2 = viewGroup4.findViewById(2131365292);
            n.LIZIZ(findViewById2, "");
            RelativeLayout relativeLayout = (RelativeLayout) findViewById2;
            C0654Mcx<ProviderEffect> LIZ3 = LIZ();
            MbK<ProviderEffect> LIZIZ2 = LIZIZ();
            ViewGroup viewGroup5 = this.LJI;
            if (viewGroup5 == null) {
                n.LIZ("");
            }
            C1595MsI msI = new C1595MsI(context, this, LIZ3, LIZIZ2, viewGroup5, C1481MqS.LIZ);
            msI.LJIJI();
            this.LIZ = msI;
            Ls2 msG = new C1593MsG(this);
            ViewGroup viewGroup6 = this.LJI;
            if (viewGroup6 == null) {
                n.LIZ("");
            }
            Context context2 = viewGroup6.getContext();
            if (!(context2 instanceof Activity)) {
                context2 = null;
            }
            FrameLayout frameLayout2 = frameLayout;
            Ls2 ls2 = msG;
            C1636Msx msx = new C1636Msx(relativeLayout, ls2, frameLayout2, (Activity) context2, getString(2131825428), false);
            msx.LIZ(true);
            this.LJIIIIZZ = msx;
            View LIZLLL2 = msx.LIZLLL();
            this.LJIIJ = LIZLLL2;
            if (LIZLLL2 == null) {
                n.LIZ("");
            }
            Qen.LIZIZ(LIZLLL2, 0, Integer.valueOf((int) HeD.LIZIZ(getContext(), -3.0f)), (Integer) null, (Integer) null, false);
            View view = this.LJIIJ;
            if (view == null) {
                n.LIZ("");
            }
            6co findViewById3 = view.findViewById(2131372286);
            Context context3 = getContext();
            if (context3 != null) {
                View view2 = this.LJIIJ;
                if (view2 == null) {
                    n.LIZ("");
                }
                View findViewById4 = view2.findViewById(2131366623);
                n.LIZIZ(findViewById4, "");
                ((C4366Nvt) findViewById4).setBackground(022.LIZIZ(context3, 2131232631));
                View view3 = this.LJIIJ;
                if (view3 == null) {
                    n.LIZ("");
                }
                View findViewById5 = view3.findViewById(2131362962);
                n.LIZIZ(findViewById5, "");
                ((ImageButton) findViewById5).setBackground(022.LIZIZ(context3, 2131232630));
                findViewById3.setHintTextColor(070.LIZJ(context3, 2131099758));
                findViewById3.setTextColor(070.LIZJ(context3, 2131099750));
                n.LIZIZ(findViewById3, "");
                Qen.LIZIZ(findViewById3, Integer.valueOf((int) HeD.LIZIZ(context3, 42.0f)), (Integer) null, Integer.valueOf((int) HeD.LIZIZ(context3, 30.0f)), (Integer) null, false, 26);
                View view4 = this.LJIIJ;
                if (view4 == null) {
                    n.LIZ("");
                }
                View findViewById6 = view4.findViewById(2131369676);
                n.LIZIZ(findViewById6, "");
                ((FrameLayout) findViewById6).setBackground(022.LIZIZ(context3, 2131232279));
            }
            C1595MsI msI2 = this.LIZ;
            if (msI2 == null) {
                n.LIZ("");
            }
            View LJIIL2 = msI2.LJIIL();
            this.LJIIIZ = LJIIL2;
            if (LJIIL2 == null) {
                n.LIZ("");
            }
            RecyclerView findViewById7 = LJIIL2.findViewById(2131370702);
            n.LIZIZ(findViewById7, "");
            findViewById7.setVerticalFadingEdgeEnabled(false);
            View view5 = this.LJIIIZ;
            if (view5 == null) {
                n.LIZ("");
            }
            frameLayout.addView(view5);
            C1079Mjy mjy = this.LJIILIIL;
            C1595MsI msI3 = this.LIZ;
            if (msI3 == null) {
                n.LIZ("");
            }
            mjy.LIZ(msI3.LIZ().LIZ(new C0642Mcl(this), 78e.LIZ));
            C1079Mjy mjy2 = this.LJIILIIL;
            C1595MsI msI4 = this.LIZ;
            if (msI4 == null) {
                n.LIZ("");
            }
            mjy2.LIZ(msI4.LJII().LIZ(new C1644Mt5(this, context), 78e.LIZ));
            C1079Mjy mjy3 = this.LJIILIIL;
            C1595MsI msI5 = this.LIZ;
            if (msI5 == null) {
                n.LIZ("");
            }
            mjy3.LIZ(msI5.LJIIIIZZ().LIZ(new C1643Mt4(context), 78e.LIZ));
            ViewGroup viewGroup7 = this.LJI;
            if (viewGroup7 == null) {
                n.LIZ("");
            }
            MethodCollector.o(6416);
            return viewGroup7;
        }
        NullPointerException nullPointerException = new NullPointerException("null cannot be cast to non-null type android.view.ViewGroup");
        MethodCollector.o(6416);
        throw nullPointerException;
    }
}
