package com.tencent.mm.plugin.setting.ui.setting;

import android.app.ProgressDialog;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.f;
import com.tencent.mm.kernel.g;
import com.tencent.mm.model.r;
import com.tencent.mm.plugin.setting.model.d;
import com.tencent.mm.pluginsdk.ui.a.b;
import com.tencent.mm.pluginsdk.ui.e.j;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.storage.ad;
import com.tencent.mm.ui.MMActivity;
import com.tencent.mm.ui.base.h;
import com.tencent.mm.ui.q;

public class SettingsAliasUI extends MMActivity implements f {
    private String dFl;
    private ProgressDialog ehJ = null;
    private ImageView ejo;
    private TextView ejp;
    private TextView gGA;
    private EditText qmS;
    private d qmT;
    private boolean qmU = false;
    private TextView qmV;
    private f qmb = null;

    public void onWindowFocusChanged(boolean z) {
        super.onWindowFocusChanged(z);
        AppMethodBeat.at(this, z);
    }

    public void onCreate(Bundle bundle) {
        AppMethodBeat.i(127191);
        super.onCreate(bundle);
        this.qmU = getIntent().getBooleanExtra("KFromSetAliasTips", false);
        initView();
        g.Rg().a(177, this);
        AppMethodBeat.o(127191);
    }

    public final int getLayoutId() {
        return 2130970630;
    }

    public void onPause() {
        AppMethodBeat.i(127192);
        super.onPause();
        AppMethodBeat.o(127192);
    }

    public void onDestroy() {
        AppMethodBeat.i(127193);
        if (this.qmT != null) {
            g.Rg().c(this.qmT);
        }
        g.Rg().b(177, this);
        super.onDestroy();
        AppMethodBeat.o(127193);
    }

    public final void initView() {
        AppMethodBeat.i(127194);
        setMMTitle(2131301491);
        this.ejo = (ImageView) findViewById(2131821183);
        this.ejp = (TextView) findViewById(2131823149);
        this.gGA = (TextView) findViewById(2131826877);
        this.qmV = (TextView) findViewById(2131827381);
        this.qmS = (EditText) findViewById(2131827380);
        String Yz = r.Yz();
        if (!ad.aoA(Yz)) {
            this.qmS.setText(r.Yz());
            this.gGA.setText(getString(2131296520, new Object[]{Yz}));
        }
        this.qmS.setSelection(this.qmS.getText().length());
        this.qmS.setFocusable(true);
        this.qmS.setFocusableInTouchMode(true);
        this.qmS.addTextChangedListener(new 1(this));
        this.ejp.setText(j.b(this, bo.nullAsNil(r.YB()), this.ejp.getTextSize()));
        b.b(this.ejo, Yz);
        setBackBtn(new 2(this));
        a(0, getString(2131297038), new 3(this), q.b.ymu);
        enableOptionMenu(false);
        AppMethodBeat.o(127194);
    }

    public void onSceneEnd(int r7, int r8, java.lang.String r9, com.tencent.mm.ai.m r10) {
        /*
        r6 = this;
        r1 = 0;
        r0 = 1;
        r5 = 127195; // 0x1f0db float:1.78238E-40 double:6.28427E-319;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r5);
        if (r7 != 0) goto L_0x004c;
    L_0x000a:
        if (r8 != 0) goto L_0x004c;
    L_0x000c:
        r2 = r6.qmU;
        if (r2 == 0) goto L_0x001a;
    L_0x0010:
        r2 = com.tencent.mm.plugin.report.service.h.pYm;
        r3 = 10358; // 0x2876 float:1.4515E-41 double:5.1175E-320;
        r4 = "1";
        r2.X(r3, r4);
    L_0x001a:
        r6.aqX();
        r2 = com.tencent.mm.kernel.g.RP();
        r2 = r2.Ry();
        r3 = 42;
        r4 = r6.dFl;
        r2.set(r3, r4);
        r2 = com.tencent.mm.kernel.g.Rg();
        r3 = 255; // 0xff float:3.57E-43 double:1.26E-321;
        r4 = new com.tencent.mm.plugin.setting.ui.setting.SettingsAliasUI$5;
        r4.<init>(r6);
        r6.qmb = r4;
        r2.a(r3, r4);
        r2 = new com.tencent.mm.modelsimple.r;
        r2.<init>(r0);
        r0 = com.tencent.mm.kernel.g.Rg();
        r0.a(r2, r1);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r5);
    L_0x004b:
        return;
    L_0x004c:
        r2 = r6.ehJ;
        if (r2 == 0) goto L_0x0058;
    L_0x0050:
        r2 = r6.ehJ;
        r2.dismiss();
        r2 = 0;
        r6.ehJ = r2;
    L_0x0058:
        r2 = com.tencent.mm.plugin.setting.b.gkF;
        r3 = r6.mController;
        r3 = r3.ylL;
        r2 = r2.a(r3, r7, r8, r9);
        if (r2 == 0) goto L_0x006a;
    L_0x0064:
        if (r0 == 0) goto L_0x0084;
    L_0x0066:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r5);
        goto L_0x004b;
    L_0x006a:
        switch(r7) {
            case 4: goto L_0x006f;
            default: goto L_0x006d;
        };
    L_0x006d:
        r0 = r1;
        goto L_0x0064;
    L_0x006f:
        r2 = -7;
        if (r8 == r2) goto L_0x0076;
    L_0x0072:
        r2 = -10;
        if (r8 != r2) goto L_0x006d;
    L_0x0076:
        r1 = r6.mController;
        r1 = r1.ylL;
        r2 = 2131302221; // 0x7f09174d float:1.8222522E38 double:1.0530032083E-314;
        r3 = 2131301495; // 0x7f091477 float:1.822105E38 double:1.0530028496E-314;
        com.tencent.mm.ui.base.h.g(r1, r2, r3);
        goto L_0x0064;
    L_0x0084:
        com.tencent.matrix.trace.core.AppMethodBeat.o(r5);
        goto L_0x004b;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.setting.ui.setting.SettingsAliasUI.onSceneEnd(int, int, java.lang.String, com.tencent.mm.ai.m):void");
    }

    static /* synthetic */ void e(SettingsAliasUI settingsAliasUI) {
        AppMethodBeat.i(127196);
        if (settingsAliasUI.dFl.equals(r.Yz())) {
            h.g(settingsAliasUI.mController.ylL, 2131301493, 2131301491);
            AppMethodBeat.o(127196);
        } else if (bo.amX(settingsAliasUI.dFl)) {
            AppCompatActivity appCompatActivity = settingsAliasUI.mController.ylL;
            settingsAliasUI.getString(2131301491);
            settingsAliasUI.ehJ = h.b(appCompatActivity, settingsAliasUI.getString(2131301490), true, new 4(settingsAliasUI));
            if (settingsAliasUI.qmT != null) {
                g.Rg().c(settingsAliasUI.qmT);
            }
            settingsAliasUI.qmT = new d(settingsAliasUI.dFl);
            g.Rg().a(settingsAliasUI.qmT, 0);
            AppMethodBeat.o(127196);
        } else {
            h.g(settingsAliasUI.mController.ylL, 2131304227, 2131302223);
            AppMethodBeat.o(127196);
        }
    }
}
