package com.ss.android.ugc.aweme.journey.step.adexperience;

import X.0Bs;
import X.0Bv;
import X.0Bx;
import X.0By;
import X.0HH;
import X.1hK;
import X.7he;
import X.AnonymousClass2GD;
import X.AnonymousClass2UX;
import X.AnonymousClass36H;
import X.AnonymousClass36I;
import X.AnonymousClass36J;
import X.AnonymousClass4FI;
import X.C12422nK;
import X.C213834g;
import X.CbG;
import X.Crj;
import X.M12;
import X.QeY;
import X.Qeg;
import android.content.Context;
import android.graphics.Paint;
import android.os.Bundle;
import android.util.SparseArray;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.CompoundButton;
import android.widget.RelativeLayout;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.base.fragment.AmeBaseFragment;
import com.ss.android.ugc.aweme.journey.step.ComponentDependencies;
import kotlin.h.b.n;

public final class AdExperienceFragment extends AmeBaseFragment implements View.OnClickListener, CompoundButton.OnCheckedChangeListener {
    public final Crj LIZ = 7he.LIZ(AnonymousClass36J.LIZ);
    public SparseArray LIZIZ;

    static {
        Covode.recordClassIndex(88877);
    }

    public final View LIZ(int i) {
        if (this.LIZIZ == null) {
            this.LIZIZ = new SparseArray();
        }
        View view = (View) this.LIZIZ.get(i);
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i);
        this.LIZIZ.put(i, findViewById);
        return findViewById;
    }

    public final /* synthetic */ void onDestroyView() {
        AdExperienceFragment.super.onDestroyView();
        SparseArray sparseArray = this.LIZIZ;
        if (sparseArray != null) {
            sparseArray.clear();
        }
    }

    private final void LIZ(View view) {
        C213834g r1 = C213834g.LIZ;
        Context context = view.getContext();
        n.LIZIZ(context, "");
        QeY qeY = new QeY(view.getResources().getColor(2131099659), r1.LIZ(context));
        Context context2 = view.getContext();
        n.LIZIZ(context2, "");
        qeY.LIZ(context2.getResources().getColor(2131099719));
        view.setBackground(qeY);
        view.setLayerType(1, (Paint) null);
    }

    public final void onClick(View view) {
        Integer valueOf;
        CbG LIZ2 = LIZ(2131367998);
        n.LIZIZ(LIZ2, "");
        LIZ2.setEnabled(true);
        if (view != null && (valueOf = Integer.valueOf(view.getId())) != null) {
            if (valueOf.intValue() == 2131368435) {
                AnonymousClass4FI r0 = (AnonymousClass4FI) LIZ(2131368436);
                n.LIZIZ(r0, "");
                r0.setChecked(true);
            } else if (valueOf.intValue() == 2131365260) {
                AnonymousClass4FI r02 = (AnonymousClass4FI) LIZ(2131365261);
                n.LIZIZ(r02, "");
                r02.setChecked(true);
            }
        }
    }

    public final void onCheckedChanged(CompoundButton compoundButton, boolean z) {
        Integer valueOf;
        if (z) {
            CbG LIZ2 = LIZ(2131367998);
            n.LIZIZ(LIZ2, "");
            LIZ2.setEnabled(true);
            if (compoundButton != null && (valueOf = Integer.valueOf(compoundButton.getId())) != null) {
                if (valueOf.intValue() == 2131368436) {
                    AnonymousClass4FI r0 = (AnonymousClass4FI) LIZ(2131365261);
                    n.LIZIZ(r0, "");
                    r0.setChecked(false);
                } else if (valueOf.intValue() == 2131365261) {
                    AnonymousClass4FI r02 = (AnonymousClass4FI) LIZ(2131368436);
                    n.LIZIZ(r02, "");
                    r02.setChecked(false);
                }
            }
        }
    }

    public final void onViewCreated(View view, Bundle bundle) {
        String string;
        String string2;
        String string3;
        String string4;
        String string5;
        String string6;
        M12.LIZ(view);
        AdExperienceFragment.super.onViewCreated(view, bundle);
        RelativeLayout relativeLayout = (RelativeLayout) LIZ(2131368435);
        n.LIZIZ(relativeLayout, "");
        LIZ((View) relativeLayout);
        RelativeLayout relativeLayout2 = (RelativeLayout) LIZ(2131365260);
        n.LIZIZ(relativeLayout2, "");
        LIZ((View) relativeLayout2);
        1hK requireActivity = requireActivity();
        0Bx LIZ2 = 0By.LIZ(requireActivity, (0Bv) null);
        if (AnonymousClass2GD.LIZ) {
            0Bs.LIZ(LIZ2, requireActivity);
        }
        AnonymousClass36I r5 = LIZ2.LIZ(ComponentDependencies.class).LJII;
        Qeg LIZ3 = LIZ(2131368329);
        n.LIZIZ(LIZ3, "");
        if (r5 == null || (string = r5.LIZIZ) == null || string.length() <= 0) {
            string = getString(2131831133);
        }
        LIZ3.setText(string);
        Qeg LIZ4 = LIZ(2131368437);
        n.LIZIZ(LIZ4, "");
        if (r5 == null || (string2 = r5.LIZJ) == null || string2.length() <= 0) {
            string2 = getString(2131831128);
        }
        LIZ4.setText(string2);
        Qeg LIZ5 = LIZ(2131368434);
        n.LIZIZ(LIZ5, "");
        if (r5 == null || (string3 = r5.LIZLLL) == null || string3.length() <= 0) {
            string3 = getString(2131831129);
        }
        LIZ5.setText(string3);
        Qeg LIZ6 = LIZ(2131365262);
        n.LIZIZ(LIZ6, "");
        if (r5 == null || (string4 = r5.LJ) == null || string4.length() <= 0) {
            string4 = getString(2131831130);
        }
        LIZ6.setText(string4);
        Qeg LIZ7 = LIZ(2131365259);
        n.LIZIZ(LIZ7, "");
        if (r5 == null || (string5 = r5.LJFF) == null || string5.length() <= 0) {
            string5 = getString(2131831131);
        }
        LIZ7.setText(string5);
        Qeg LIZ8 = LIZ(2131365141);
        n.LIZIZ(LIZ8, "");
        if (r5 == null || (string6 = r5.LJI) == null || string6.length() <= 0) {
            string6 = getString(2131831132);
        }
        LIZ8.setText(string6);
        ((RelativeLayout) LIZ(2131368435)).setOnClickListener(this);
        ((RelativeLayout) LIZ(2131365260)).setOnClickListener(this);
        ((AnonymousClass4FI) LIZ(2131368436)).setOnCheckedChangeListener(this);
        ((AnonymousClass4FI) LIZ(2131365261)).setOnCheckedChangeListener(this);
        LIZ(2131367998).setOnClickListener(new AnonymousClass36H(this));
        C12422nK.LIZ("pa_1p_prompt_v1_show", new AnonymousClass2UX().LIZ);
    }

    public final View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        M12.LIZ(layoutInflater);
        return 0HH.LIZ(layoutInflater, 2131560218, viewGroup, false);
    }
}
