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

import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ListView;
import android.widget.Toast;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.f;
import com.tencent.mm.ai.m;
import com.tencent.mm.model.aw;
import com.tencent.mm.plugin.ipcall.a.d.d;
import com.tencent.mm.protocal.protobuf.aqk;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.ui.MMActivity;
import com.tencent.mm.ui.base.h;

public class IPCallMyGiftCardUI extends MMActivity implements f {
    private View Ek;
    private ProgressDialog gqo;
    private ListView mListView;
    private a nDx;
    private d nDy;

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

    public final int getForceOrientation() {
        return 1;
    }

    public void onActivityResult(int i, int i2, Intent intent) {
    }

    public void onCreate(Bundle bundle) {
        AppMethodBeat.i(22216);
        super.onCreate(bundle);
        aw.Rg().a(288, this);
        setMMTitle(2131300810);
        setBackBtn(new 1(this));
        addTextOptionMenu(0, this.mController.ylL.getString(2131300808), new 2(this));
        this.Ek = findViewById(2131825169);
        this.mListView = (ListView) findViewById(2131825168);
        this.nDx = new a(this);
        this.mListView.setAdapter(this.nDx);
        AppCompatActivity appCompatActivity = this.mController.ylL;
        getString(2131297061);
        this.gqo = h.b(appCompatActivity, getString(2131300739), true, new 3(this));
        this.nDy = new d();
        aw.Rg().a(this.nDy, 0);
        AppMethodBeat.o(22216);
    }

    public void onResume() {
        AppMethodBeat.i(22217);
        super.onResume();
        AppMethodBeat.o(22217);
    }

    public void onDestroy() {
        AppMethodBeat.i(22218);
        super.onDestroy();
        aw.Rg().b(288, this);
        AppMethodBeat.o(22218);
    }

    public final int getLayoutId() {
        return 2130969901;
    }

    public void onSceneEnd(int i, int i2, String str, m mVar) {
        AppMethodBeat.i(22219);
        ab.i("MicroMsg.IPCallMyGiftCardUI", "onSceneEnd>errCode:%d,onSceneEnd>errMsg:%s", new Object[]{Integer.valueOf(i2), str});
        if (mVar instanceof d) {
            if (i == 0 && i2 == 0) {
                aqk aqk = ((d) mVar).nym;
                if (this.gqo != null && this.gqo.isShowing()) {
                    this.gqo.dismiss();
                }
                this.nDx.ngC = aqk.wuj;
                this.nDx.nDB = aqk;
                this.nDx.notifyDataSetChanged();
                if (aqk.wuj.size() == 0) {
                    this.Ek.setVisibility(0);
                }
                AppMethodBeat.o(22219);
                return;
            }
            if (this.gqo != null && this.gqo.isShowing()) {
                this.gqo.dismiss();
            }
            this.Ek.setVisibility(0);
            Toast.makeText(this.mController.ylL, getString(2131300736), 0).show();
        }
        AppMethodBeat.o(22219);
    }
}
