package com.tencent.mm.plugin.appbrand.wxawidget.console;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.FrameLayout;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.aa.h;
import com.tencent.mm.ipcinvoker.f;
import com.tencent.mm.ipcinvoker.type.IPCInteger;
import com.tencent.mm.kernel.g;
import com.tencent.mm.modelappbrand.e;
import com.tencent.mm.plugin.appbrand.dynamic.widget.b;
import com.tencent.mm.ui.widget.MMSwitchBtn;

public class SettingsPanel extends FrameLayout {
    private Button jqg;
    private Button jqh;
    private OnClickListener jqi;
    private Runnable jqj;

    static /* synthetic */ void a(SettingsPanel settingsPanel, int i) {
        AppMethodBeat.i(11201);
        settingsPanel.rf(i);
        AppMethodBeat.o(11201);
    }

    static /* synthetic */ void b(SettingsPanel settingsPanel, int i) {
        AppMethodBeat.i(11202);
        settingsPanel.rg(i);
        AppMethodBeat.o(11202);
    }

    public SettingsPanel(Context context, AttributeSet attributeSet) {
        super(context, attributeSet);
        AppMethodBeat.i(11196);
        init();
        AppMethodBeat.o(11196);
    }

    public SettingsPanel(Context context, AttributeSet attributeSet, int i) {
        super(context, attributeSet, i);
        AppMethodBeat.i(11197);
        init();
        AppMethodBeat.o(11197);
    }

    private void init() {
        AppMethodBeat.i(11198);
        LayoutInflater.from(getContext()).inflate(2130970639, this, true);
        findViewById(2131827404).setOnClickListener(new 1(this));
        MMSwitchBtn mMSwitchBtn = (MMSwitchBtn) findViewById(2131827407);
        mMSwitchBtn.setCheck(((e) g.K(e.class)).abz().abE());
        mMSwitchBtn.setSwitchListener(new 2(this));
        this.jqg = (Button) findViewById(2131827411);
        rf(b.aAl());
        this.jqg.setOnClickListener(new 3(this));
        this.jqh = (Button) findViewById(2131827409);
        rg(h.QE());
        this.jqh.setOnClickListener(new 4(this));
        findViewById(2131827412).setOnClickListener(new 5(this));
        if (((e) g.K(e.class)).abz().abF()) {
            findViewById(2131827406).setVisibility(0);
            findViewById(2131827410).setVisibility(0);
            findViewById(2131827408).setVisibility(0);
        }
        AppMethodBeat.o(11198);
    }

    public void setOnCloseDebuggerClickListener(OnClickListener onClickListener) {
        this.jqi = onClickListener;
    }

    public void setOnResetDebuggerRunnable(Runnable runnable) {
        this.jqj = runnable;
    }

    private void rf(int i) {
        AppMethodBeat.i(11199);
        this.jqg.setTag(Integer.valueOf(i));
        switch (i) {
            case 1:
                this.jqg.setText("MTextureView");
                b.nR(1);
                AppMethodBeat.o(11199);
                return;
            case 2:
                this.jqg.setText("MSurfaceView");
                b.nR(2);
                AppMethodBeat.o(11199);
                return;
            case 3:
                this.jqg.setText("MCanvasView");
                b.nR(3);
                AppMethodBeat.o(11199);
                return;
            case 4:
                this.jqg.setText("MDrawableView");
                b.nR(4);
                AppMethodBeat.o(11199);
                return;
            default:
                this.jqg.setText("MHADrawableView");
                b.nR(0);
                AppMethodBeat.o(11199);
                return;
        }
    }

    private void rg(int i) {
        CharSequence charSequence;
        int i2;
        AppMethodBeat.i(11200);
        this.jqh.setTag(Integer.valueOf(i));
        switch (i) {
            case 1:
                charSequence = "Minimal-json";
                i2 = 1;
                break;
            default:
                charSequence = "Normal";
                i2 = 0;
                break;
        }
        this.jqh.setText(charSequence);
        h.jM(i2);
        f.a("com.tencent.mm:support", new IPCInteger(i2), a.class, null);
        AppMethodBeat.o(11200);
    }
}
