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

import android.content.Intent;
import android.database.Cursor;
import android.graphics.Rect;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.View;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.Toast;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.g.a.qb;
import com.tencent.mm.g.a.sd;
import com.tencent.mm.model.aw;
import com.tencent.mm.model.r;
import com.tencent.mm.model.t;
import com.tencent.mm.plugin.appbrand.report.AppBrandStatObject;
import com.tencent.mm.plugin.exdevice.a.b;
import com.tencent.mm.plugin.exdevice.f.a.j;
import com.tencent.mm.plugin.exdevice.f.a.j.a;
import com.tencent.mm.plugin.exdevice.f.b.a.c;
import com.tencent.mm.plugin.exdevice.f.b.a.d;
import com.tencent.mm.plugin.exdevice.f.b.e;
import com.tencent.mm.plugin.exdevice.f.b.f;
import com.tencent.mm.plugin.exdevice.model.ac;
import com.tencent.mm.plugin.exdevice.model.ad;
import com.tencent.mm.plugin.messenger.a.g;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.ui.MMActivity;
import com.tencent.mm.ui.base.MMPullDownView;
import com.tencent.mm.ui.base.h;
import com.tencent.mm.ui.base.l;
import com.tencent.mm.ui.base.n;
import com.tencent.mm.ui.base.p;
import com.tencent.ytcommon.BuildConfig;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import junit.framework.Assert;

public class ExdeviceRankInfoUI extends MMActivity implements a, e, f, d {
    private static int lCl = 128;
    private boolean UP;
    private String hZn;
    private String igi;
    private ImageView lBT;
    private View lBZ;
    private Map<String, String> lCE = new HashMap();
    private String lCb;
    private String lCc;
    private b<j> lDA = new 12(this);
    private int lDB;
    private ListView lDf;
    private b lDg;
    private View lDh;
    private ExdeviceRankListHeaderView lDi;
    private ExdeviceRankChampionInfoView lDj;
    private View lDk;
    private String lDl;
    private String lDm;
    private String lDn;
    private String lDo;
    private com.tencent.mm.plugin.exdevice.f.b.a.a lDp;
    private String lDq;
    private int lDr;
    private List<e> lDs;
    private ArrayList<c> lDt;
    private ArrayList<d> lDu;
    private boolean lDv;
    private boolean lDw;
    private String lDx;
    private boolean lDy;
    private j lDz;
    private boolean lvJ;
    public boolean lvV;
    public String lvW;
    private p lzK = null;

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

    public ExdeviceRankInfoUI() {
        AppMethodBeat.i(20163);
        AppMethodBeat.o(20163);
    }

    static /* synthetic */ void g(ExdeviceRankInfoUI exdeviceRankInfoUI) {
        AppMethodBeat.i(20190);
        exdeviceRankInfoUI.gP(false);
        AppMethodBeat.o(20190);
    }

    static /* synthetic */ void h(ExdeviceRankInfoUI exdeviceRankInfoUI) {
        AppMethodBeat.i(20191);
        exdeviceRankInfoUI.bpV();
        AppMethodBeat.o(20191);
    }

    static /* synthetic */ void m(ExdeviceRankInfoUI exdeviceRankInfoUI) {
        AppMethodBeat.i(20193);
        exdeviceRankInfoUI.bqb();
        AppMethodBeat.o(20193);
    }

    static /* synthetic */ void r(ExdeviceRankInfoUI exdeviceRankInfoUI) {
        AppMethodBeat.i(20197);
        exdeviceRankInfoUI.bpY();
        AppMethodBeat.o(20197);
    }

    static /* synthetic */ void s(ExdeviceRankInfoUI exdeviceRankInfoUI) {
        AppMethodBeat.i(20198);
        exdeviceRankInfoUI.bpP();
        AppMethodBeat.o(20198);
    }

    static /* synthetic */ void t(ExdeviceRankInfoUI exdeviceRankInfoUI) {
        AppMethodBeat.i(20199);
        exdeviceRankInfoUI.bpZ();
        AppMethodBeat.o(20199);
    }

    static /* synthetic */ void u(ExdeviceRankInfoUI exdeviceRankInfoUI) {
        AppMethodBeat.i(20200);
        exdeviceRankInfoUI.gQ(true);
        AppMethodBeat.o(20200);
    }

    private void gP(boolean z) {
        AppMethodBeat.i(20164);
        if (!this.lDw || z) {
            ad.bpe();
            this.lDu = com.tencent.mm.plugin.exdevice.f.b.c.Kn(this.lDo);
            this.lDt = ad.boY().bpk();
            this.lDs = this.lDg.b(this.lDt, this.lDu, this.lvV);
            runOnUiThread(new 1(this));
            AppMethodBeat.o(20164);
            return;
        }
        AppMethodBeat.o(20164);
    }

    public void onCreate(Bundle bundle) {
        AppMethodBeat.i(20165);
        super.onCreate(bundle);
        this.UP = false;
        this.igi = r.Yz();
        Intent intent = getIntent();
        this.lDl = intent.getStringExtra("key_rank_info");
        this.lDm = intent.getStringExtra("key_rank_semi");
        this.lDn = intent.getStringExtra("app_username");
        this.lDo = intent.getStringExtra("rank_id");
        this.lDv = intent.getBooleanExtra("key_is_latest", false);
        this.lDq = intent.getStringExtra("key_champioin_username");
        this.lDr = intent.getIntExtra("device_type", 0);
        this.lDx = intent.getStringExtra("locate_to_username");
        this.lDw = intent.getBooleanExtra("key_only_show_latest_rank", false);
        if (bo.isNullOrNil(this.lDo) || "#".equals(this.lDo)) {
            if (!this.lDw) {
                d dVar;
                com.tencent.mm.plugin.exdevice.f.b.b.d boX = ad.boX();
                Cursor a = boX.bSd.a(String.format("select * from %s order by %s desc limit 1", new Object[]{"HardDeviceRankInfo", "rankID"}), null, 2);
                if (a == null) {
                    ab.e("MicroMsg.ExdeviceRankInfoStg", "Get no rank in DB");
                    dVar = null;
                } else {
                    if (a.moveToFirst()) {
                        dVar = new d();
                        dVar.d(a);
                    } else {
                        ab.d("MicroMsg.ExdeviceRankInfoStg", "hy: no record");
                        dVar = null;
                    }
                    a.close();
                }
                if (dVar != null) {
                    this.lDo = dVar.field_rankID;
                    this.lDn = dVar.field_appusername;
                }
            }
            this.lDq = null;
            this.lDv = true;
        }
        ad.bpe();
        this.lDu = com.tencent.mm.plugin.exdevice.f.b.c.Kn(this.lDo);
        if (!this.lDw) {
            if (this.lDu == null || this.lDu.size() <= 0) {
                this.lDt = new ArrayList();
                this.lDu = com.tencent.mm.plugin.exdevice.f.a.a.a(this.lDo, this.lDn, this.lDl, this.lDm, this.lCE, this.lDt);
                ad.bpe();
                com.tencent.mm.plugin.exdevice.f.b.c.f(this.lDo, this.lDu);
            } else {
                com.tencent.mm.plugin.exdevice.f.a.a.d(this.lDl, this.lDm, this.lCE);
            }
            this.lDt = ad.boY().bpk();
        }
        this.lDg = new b(this, this.lDn);
        this.lDg.lCE = this.lCE;
        this.lDs = this.lDg.b(this.lDt, this.lDu, this.lvV);
        this.lDg.lCD = this.lDs;
        if (bo.isNullOrNil(this.lDq)) {
            bpW();
        }
        this.lDp = ad.bpa().Kr(this.lDq);
        if (this.lDp == null && !bo.isNullOrNil(this.lDq)) {
            this.lDp = new com.tencent.mm.plugin.exdevice.f.b.a.a();
            this.lDp.field_username = this.lDq;
            this.lDp.field_championMotto = getIntent().getStringExtra("key_champion_info");
            this.lDp.field_championUrl = getIntent().getStringExtra("key_champion_coverimg");
            ad.bpe();
            ad.bpa().a(this.lDp);
        }
        initView();
        if (this.lDu != null && this.lDu.size() > 0) {
            this.lDj.KF(((d) this.lDu.get(0)).field_username);
        }
        ad.bpf().a(this);
        ad.bpe().lwf = this;
        bpU();
        setBackBtn(new 18(this));
        setMMTitle(2131299401);
        showOptionMenu(true);
        bpV();
        sd sdVar = new sd();
        sdVar.cOe.action = 2;
        com.tencent.mm.sdk.b.a.xxA.a(sdVar, com.tencent.mm.sdk.g.d.xDG.cin());
        AppMethodBeat.o(20165);
    }

    private void bpU() {
        AppMethodBeat.i(20166);
        ab.i("MicroMsg.Sport.ExdeviceRankInfoUI", "updateRankInfoUIFromServer");
        this.lDz = new j(this.lDo, this.lDn, this.lDq, this.lDv, this.lDA);
        this.lDz.lvY = this;
        aw.Rg().a(this.lDz, 0);
        AppMethodBeat.o(20166);
    }

    private void bpV() {
        AppMethodBeat.i(20167);
        ab.i("MicroMsg.Sport.ExdeviceRankInfoUI", "try2LocateToUser, locate2User(%s), username(%s).", new Object[]{this.lDx, this.igi});
        if (bo.isNullOrNil(this.lDx) || KH(this.lDx) < 0) {
            ab.d("MicroMsg.Sport.ExdeviceRankInfoUI", "locate to username is null or nil.");
            AppMethodBeat.o(20167);
            return;
        }
        AppMethodBeat.o(20167);
    }

    private int KH(String str) {
        AppMethodBeat.i(20168);
        ab.i("MicroMsg.Sport.ExdeviceRankInfoUI", "locateToUser, locate2User(%s), username(%s).", new Object[]{str, this.igi});
        if (bo.isNullOrNil(str)) {
            AppMethodBeat.o(20168);
            return -1;
        } else if (this.lDs == null || this.lDs.size() == 0) {
            AppMethodBeat.o(20168);
            return -2;
        } else {
            int i = 0;
            while (i < this.lDs.size()) {
                d dVar = ((e) this.lDs.get(i)).lFy;
                int i2 = ((e) this.lDs.get(i)).lFz;
                if (dVar == null || !str.equalsIgnoreCase(dVar.field_username) || str.equalsIgnoreCase(this.igi) || (i2 & 2) == 2) {
                    i++;
                } else {
                    DisplayMetrics displayMetrics = new DisplayMetrics();
                    getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
                    ab.i("MicroMsg.Sport.ExdeviceRankInfoUI", "locateToUser pos(%d).(h : %d)", new Object[]{Integer.valueOf(i), Integer.valueOf(displayMetrics.heightPixels)});
                    this.lDf.setSelectionFromTop(i, i2 / 4);
                    this.lDg.lCF = str;
                    this.lDg.notifyDataSetInvalidated();
                    bpY();
                    AppMethodBeat.o(20168);
                    return i;
                }
            }
            this.lDg.lCF = null;
            AppMethodBeat.o(20168);
            return -3;
        }
    }

    private void bpP() {
        AppMethodBeat.i(20169);
        if (this.lDp == null || this.igi == null || !this.igi.equals(this.lDp.field_username) || !bo.isNullOrNil(this.lDp.field_championUrl)) {
            if (this.lBZ != null) {
                this.lBZ.setVisibility(8);
            }
            if (!(this.lDp == null || bo.bc(this.lDp.field_username, BuildConfig.FLAVOR).equals(this.igi) || bo.isNullOrNil(this.lDp.field_championUrl))) {
                this.lDi.setOnViewClickListener(new 22(this));
            }
        } else {
            if (this.lBZ != null) {
                this.lBZ.setVisibility(0);
            }
            if (this.lDi != null) {
                this.lDi.setOnViewClickListener(new 21(this));
                AppMethodBeat.o(20169);
                return;
            }
        }
        AppMethodBeat.o(20169);
    }

    private void bpW() {
        AppMethodBeat.i(20170);
        String bpX = bpX();
        if (!bo.isNullOrNil(bpX)) {
            this.lDq = bpX;
        }
        AppMethodBeat.o(20170);
    }

    private String bpX() {
        AppMethodBeat.i(20171);
        if (this.lDs != null) {
            for (e eVar : this.lDs) {
                d dVar = eVar.lFy;
                if (dVar != null && dVar.field_ranknum == 1) {
                    String str = dVar.field_username;
                    AppMethodBeat.o(20171);
                    return str;
                }
            }
        }
        AppMethodBeat.o(20171);
        return null;
    }

    public final void initView() {
        int dimensionPixelSize;
        int size;
        boolean z;
        AppMethodBeat.i(20172);
        this.lDh = findViewById(2131823712);
        ExdeviceRankListHeaderView exdeviceRankListHeaderView = new ExdeviceRankListHeaderView(this);
        Rect rect = new Rect();
        getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);
        int i = rect.top;
        if (i == 0) {
            i = com.tencent.mm.plugin.exdevice.j.b.J(this, getResources().getDimensionPixelSize(2131427616));
        }
        DisplayMetrics displayMetrics = getResources().getDisplayMetrics();
        if (displayMetrics.widthPixels > displayMetrics.heightPixels) {
            dimensionPixelSize = getResources().getDimensionPixelSize(2131427562);
        } else {
            dimensionPixelSize = getResources().getDimensionPixelSize(2131427563);
        }
        Display defaultDisplay = getWindowManager().getDefaultDisplay();
        i = ((defaultDisplay.getHeight() / 2) - i) - dimensionPixelSize;
        if (defaultDisplay.getHeight() <= 0 || i <= 0) {
            i = getResources().getDimensionPixelSize(2131427610);
        }
        exdeviceRankListHeaderView.setMinimumHeight(i);
        exdeviceRankListHeaderView.setMinimumWidth(defaultDisplay.getWidth());
        exdeviceRankListHeaderView.setTag(Integer.valueOf(i));
        this.lDi = exdeviceRankListHeaderView;
        MMPullDownView mMPullDownView = (MMPullDownView) findViewById(2131823710);
        this.lDf = (ListView) findViewById(2131823711);
        this.lDj = (ExdeviceRankChampionInfoView) findViewById(2131823713);
        this.lBZ = findViewById(2131823701);
        this.lBZ.setOnClickListener(new 23(this));
        this.lDi.setIsShowTip(false);
        bpP();
        mMPullDownView.setIsBottomShowAll(false);
        mMPullDownView.setTopViewVisible(false);
        mMPullDownView.setBottomViewVisible(false);
        mMPullDownView.setIsBottomShowAll(false);
        mMPullDownView.setIsTopShowAll(false);
        mMPullDownView.setCanOverScrool(true);
        mMPullDownView.setOnInterceptTouchEventListener(new 24(this));
        mMPullDownView.setAtBottomCallBack(new 2(this));
        mMPullDownView.setOnScrollChangedListener(new 3(this));
        mMPullDownView.setAtTopCallBack(new 4(this));
        this.lDf.setOnScrollListener(new 5(this));
        this.lDf.addHeaderView(this.lDi, null, false);
        View inflate = getLayoutInflater().inflate(2130969440, null);
        this.lDk = inflate.findViewById(2131823707);
        inflate.findViewById(2131823708).setOnClickListener(new 6(this));
        this.lDk.setVisibility(8);
        this.lDf.addFooterView(inflate);
        if (this.lDt != null) {
            dimensionPixelSize = this.lDt.size();
        } else {
            dimensionPixelSize = 0;
        }
        if (this.lDu != null) {
            size = this.lDu.size();
        } else {
            size = 0;
        }
        if (dimensionPixelSize + size == 0) {
            this.lDs = new ArrayList();
            this.lDg.lCD = this.lDs;
            getString(2131297061);
            this.lzK = h.b(this, getString(2131300968), true, new 7(this));
        }
        this.lDf.setAdapter(this.lDg);
        this.lDg.lCG = this;
        if (this.lDr == 1) {
            this.lDf.setVisibility(0);
            this.lDh.setVisibility(8);
            z = true;
        } else {
            this.lDf.setVisibility(8);
            this.lDh.setVisibility(0);
            z = false;
        }
        if (z) {
            this.lBT = (ImageView) findViewById(2131823700);
            mMPullDownView.setCanOverScrool(false);
            dimensionPixelSize = com.tencent.mm.bz.a.gd(this);
            i = ((Integer) this.lDi.getTag()).intValue();
            if (this.lvV) {
                i += (getResources().getDimensionPixelSize(2131427626) / 2) + getResources().getDimensionPixelSize(2131427625);
            }
            this.lBT.setLayoutParams(new LayoutParams(dimensionPixelSize, i));
            bpZ();
            gQ(false);
            AppMethodBeat.o(20172);
            return;
        }
        ab.d("MicroMsg.Sport.ExdeviceRankInfoUI", "hy: cannot handle this device type");
        finish();
        AppMethodBeat.o(20172);
    }

    private void bpY() {
        AppMethodBeat.i(20173);
        View childAt = this.lDf.getChildAt(0);
        int[] iArr = new int[2];
        if (childAt != null) {
            if (this.lDf.getFirstVisiblePosition() == 0) {
                childAt.getLocationOnScreen(iArr);
                if (bo.isNullOrNil(this.lDx) && lCl == 128) {
                    lCl = iArr[1];
                }
                int i = iArr[1];
                if (i > 0) {
                    float f;
                    if (i >= lCl) {
                        f = 1.0f;
                    } else {
                        f = ((float) i) / ((float) lCl);
                    }
                    ab.d("MicroMsg.Sport.ExdeviceRankInfoUI", "ap-alpha: %s", new Object[]{Float.valueOf(f)});
                    this.lDj.setAlpha(f);
                    this.lDj.setVisibility(0);
                    this.lBZ.setAlpha(f);
                    AppMethodBeat.o(20173);
                    return;
                }
            }
            this.lDj.setAlpha(0.0f);
            this.lBZ.setAlpha(0.0f);
            this.lDj.setVisibility(8);
        }
        AppMethodBeat.o(20173);
    }

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

    /* Access modifiers changed, original: protected */
    public void onRestart() {
        AppMethodBeat.i(20175);
        super.onRestart();
        gP(true);
        AppMethodBeat.o(20175);
    }

    public void onDestroy() {
        AppMethodBeat.i(20176);
        this.UP = true;
        if (this.lDg != null) {
            b.finish();
        }
        super.onDestroy();
        if (this.lDz != null) {
            this.lDz.lvY = null;
        }
        ad.bpf().b(this);
        ad.bpe().lwf = null;
        ad.bpe().lwg = null;
        if (this.lDB > 0) {
            int i = this.lDB;
            ab.v("MicroMsg.Sport.SportReportLogic", "reportLikeCount count=%d", new Object[]{Integer.valueOf(i)});
            com.tencent.mm.plugin.report.e.pXa.e(13168, new Object[]{Integer.valueOf(0), Integer.valueOf(i)});
        }
        AppMethodBeat.o(20176);
    }

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

    public final int getLayoutId() {
        return 2130969442;
    }

    private void bpZ() {
        AppMethodBeat.i(20178);
        if (this.lDp == null) {
            this.lBT.setImageResource(2131689920);
            this.hZn = null;
        } else if (this.hZn != this.lDp.field_championUrl && (this.hZn == null || !this.hZn.equals(this.lDp.field_championUrl))) {
            com.tencent.mm.plugin.exdevice.f.a.e.a(this, this.lBT, this.lDp.field_championUrl);
            this.hZn = this.lDp.field_championUrl;
            AppMethodBeat.o(20178);
            return;
        }
        AppMethodBeat.o(20178);
    }

    private void gQ(boolean z) {
        AppMethodBeat.i(20179);
        if (z) {
            bpW();
        }
        if (bo.isNullOrNil(this.lDn)) {
            this.lDj.setVisibility(8);
            AppMethodBeat.o(20179);
            return;
        }
        this.lDj.KF(this.lDq);
        this.lDj.setVisibility(0);
        AppMethodBeat.o(20179);
    }

    public final void b(String str, com.tencent.mm.plugin.exdevice.f.b.d dVar) {
        AppMethodBeat.i(20180);
        boolean z = (dVar == null || bo.isNullOrNil(str)) ? false : true;
        Assert.assertTrue(z);
        if ("HardDeviceRankInfo".equals(str)) {
            if (this.lDo != null && this.lDo.equals(dVar.lvL)) {
                ab.i("MicroMsg.Sport.ExdeviceRankInfoUI", "onRankChange, rankId(%s).", new Object[]{this.lDo});
                gP(true);
                if (bo.isNullOrNil(this.lDq) || !this.lDq.equals(bpX())) {
                    bpW();
                    this.lDp = ad.bpa().Kr(this.lDq);
                    runOnUiThread(new 8(this));
                }
                runOnUiThread(new 9(this));
                AppMethodBeat.o(20180);
                return;
            }
        } else if ("HardDeviceChampionInfo".equals(str) && !bo.isNullOrNil(this.lDq) && this.lDq.equals(dVar.username)) {
            this.lDp = ad.bpa().Kr(this.lDq);
            runOnUiThread(new 10(this));
        }
        AppMethodBeat.o(20180);
    }

    public final void Ko(String str) {
        AppMethodBeat.i(20181);
        ab.d("MicroMsg.Sport.ExdeviceRankInfoUI", "hy: rank changed to %s", new Object[]{str});
        this.lDo = str;
        AppMethodBeat.o(20181);
    }

    public final void KI(String str) {
        AppMethodBeat.i(20182);
        com.tencent.mm.plugin.sport.a.d.kT(6);
        Intent intent = new Intent(this, ExdeviceProfileUI.class);
        intent.putExtra("username", str);
        intent.putExtra("usernickname", (String) this.lCE.get(str));
        intent.putExtra("app_username", this.lDn);
        intent.putExtra("rank_id", this.lDo);
        startActivityForResult(intent, 4);
        AppMethodBeat.o(20182);
    }

    public final void bqa() {
        AppMethodBeat.i(20183);
        com.tencent.mm.plugin.sport.a.d.kT(31);
        bqb();
        AppMethodBeat.o(20183);
    }

    public final void cd(String str, int i) {
        AppMethodBeat.i(20184);
        ad.bpe();
        String str2 = this.lDo;
        String str3 = this.lDn;
        com.tencent.mm.plugin.exdevice.f.b.b.d boX = ad.boX();
        boolean z = (bo.isNullOrNil(str2) || bo.isNullOrNil(str) || (i != 1 && i != 0 && i != 2)) ? false : true;
        Assert.assertTrue(z);
        d a = boX.a(new com.tencent.mm.plugin.exdevice.f.b.d(str2, null, str));
        if (a == null) {
            ab.w("MicroMsg.ExdeviceRankInfoStg", "hy: info is null. abort");
        } else {
            a.field_selfLikeState = i;
            switch (a.field_selfLikeState) {
                case 0:
                    a.field_likecount--;
                    break;
                case 1:
                    a.field_likecount++;
                    break;
                default:
                    ab.w("MicroMsg.ExdeviceRankInfoStg", "hy: still loading...abort");
                    break;
            }
            boX.a(a, true);
        }
        com.tencent.mm.plugin.exdevice.f.b.c.d(str2, str3, str, i);
        this.lDB++;
        AppMethodBeat.o(20184);
    }

    public void onActivityResult(int i, int i2, Intent intent) {
        AppMethodBeat.i(20185);
        super.onActivityResult(i, i2, intent);
        if (com.tencent.mm.plugin.exdevice.f.a.e.a(this, i, i2, intent, this.lDn)) {
            AppMethodBeat.o(20185);
            return;
        }
        if (i2 == -1) {
            String stringExtra;
            switch (i) {
                case 1:
                    if (intent == null) {
                        ab.e("MicroMsg.Sport.ExdeviceRankInfoUI", "onActivityResult, data is null.(reqestCode : %d)", new Object[]{Integer.valueOf(i)});
                        AppMethodBeat.o(20185);
                        return;
                    }
                    stringExtra = intent == null ? null : intent.getStringExtra("Select_Conv_User");
                    if (stringExtra == null || stringExtra.length() == 0) {
                        ab.e("MicroMsg.Sport.ExdeviceRankInfoUI", "select conversation failed, toUser is null.");
                        AppMethodBeat.o(20185);
                        return;
                    }
                    ac.a(this, stringExtra, ac.dG(this), intent.getStringExtra("custom_send_text"), this.lCc);
                    h.bQ(this.mController.ylL, getResources().getString(2131297050));
                    ab.d("MicroMsg.Sport.ExdeviceRankInfoUI", "Select conversation return.");
                    AppMethodBeat.o(20185);
                    return;
                case 2:
                    h.bQ(this.mController.ylL, getResources().getString(2131297050));
                    ab.d("MicroMsg.Sport.ExdeviceRankInfoUI", "Share to timeline return.");
                    AppMethodBeat.o(20185);
                    return;
                case 3:
                    if (intent != null) {
                        ArrayList<String> P = bo.P(intent.getStringExtra("received_card_name").split(","));
                        String stringExtra2 = intent.getStringExtra("custom_send_text");
                        for (String stringExtra3 : P) {
                            g.bOk().q("gh_43f2581f6fd6", stringExtra3, t.kH(stringExtra3));
                            if (!bo.isNullOrNil(stringExtra2)) {
                                qb qbVar = new qb();
                                qbVar.cMq.cMr = stringExtra3;
                                qbVar.cMq.content = stringExtra2;
                                qbVar.cMq.type = t.nK(stringExtra3);
                                qbVar.cMq.flags = 0;
                                com.tencent.mm.sdk.b.a.xxA.m(qbVar);
                            }
                        }
                        AppMethodBeat.o(20185);
                        return;
                    }
                    break;
                case 4:
                    if (intent != null && intent.getBooleanExtra("KeyNeedUpdateRank", false)) {
                        bpU();
                        break;
                    }
            }
        }
        AppMethodBeat.o(20185);
    }

    public final boolean KJ(String str) {
        AppMethodBeat.i(20186);
        if (bo.isNullOrNil(this.lDo) || "#".equals(this.lDo)) {
            ab.d("MicroMsg.Sport.ExdeviceRankInfoUI", "hy: rank id is not valid.abort the event");
            Toast.makeText(this, getString(2131299366), 0).show();
            AppMethodBeat.o(20186);
            return true;
        } else if (r.Yz().equals(str)) {
            ab.d("MicroMsg.Sport.ExdeviceRankInfoUI", "hy: is self. see who likes me");
            Intent intent = new Intent(this, ExdeviceLikeUI.class);
            intent.putExtra("app_username", this.lDn);
            intent.putExtra("rank_id", this.lDo);
            intent.putExtra("key_is_like_read_only", true);
            startActivity(intent);
            AppMethodBeat.o(20186);
            return true;
        } else {
            AppMethodBeat.o(20186);
            return false;
        }
    }

    private void bqb() {
        AppMethodBeat.i(20187);
        if (bo.isNullOrNil(this.lvW)) {
            com.tencent.mm.plugin.exdevice.f.b.a.a Kr = ad.bpa().Kr(this.igi);
            if (Kr != null) {
                this.lvW = Kr.field_championUrl;
            }
        }
        d h = b.h(this.igi, this.lDu);
        String str = "--";
        String str2 = "0";
        if (h != null) {
            str = String.valueOf(h.field_ranknum);
            str2 = String.valueOf(h.field_score);
        }
        new ac().a(this, str, str2, this.lvW, new 11(this));
        AppMethodBeat.o(20187);
    }

    public final void a(j jVar) {
        AppMethodBeat.i(20188);
        runOnUiThread(new Runnable() {
            public final void run() {
                AppMethodBeat.i(20152);
                if (ExdeviceRankInfoUI.this.lzK != null && ExdeviceRankInfoUI.this.lzK.isShowing()) {
                    ExdeviceRankInfoUI.this.lzK.dismiss();
                    ExdeviceRankInfoUI.this.lzK = null;
                    ab.d("MicroMsg.Sport.ExdeviceRankInfoUI", "dismiss tips dialog.");
                }
                AppMethodBeat.o(20152);
            }
        });
        this.lCb = jVar.lvz;
        this.lCc = jVar.lvA;
        this.lvW = jVar.lvW;
        this.lvV = jVar.lvV;
        this.lvJ = jVar.lvJ;
        this.lDu = jVar.lvO;
        this.lDt = jVar.lvP;
        this.lDs = this.lDg.b(this.lDt, this.lDu, this.lvV);
        runOnUiThread(new Runnable() {
            public final void run() {
                AppMethodBeat.i(20153);
                ExdeviceRankInfoUI.this.lDg.lCD = ExdeviceRankInfoUI.this.lDs;
                ExdeviceRankInfoUI.this.lDg.notifyDataSetChanged();
                ExdeviceRankInfoUI.c(ExdeviceRankInfoUI.this);
                AppMethodBeat.o(20153);
            }
        });
        AppMethodBeat.o(20188);
    }

    static /* synthetic */ void c(ExdeviceRankInfoUI exdeviceRankInfoUI) {
        AppMethodBeat.i(20189);
        exdeviceRankInfoUI.lDk.setVisibility(0);
        AppMethodBeat.o(20189);
    }

    static /* synthetic */ void j(ExdeviceRankInfoUI exdeviceRankInfoUI) {
        AppMethodBeat.i(20192);
        com.tencent.mm.ui.widget.a.d dVar = new com.tencent.mm.ui.widget.a.d(exdeviceRankInfoUI.mController.ylL, 1, false);
        dVar.rBl = new 19(exdeviceRankInfoUI);
        dVar.rBm = new 20(exdeviceRankInfoUI);
        dVar.cpD();
        AppMethodBeat.o(20192);
    }

    static /* synthetic */ void n(ExdeviceRankInfoUI exdeviceRankInfoUI) {
        AppMethodBeat.i(20194);
        if (bo.isNullOrNil(exdeviceRankInfoUI.lvW)) {
            com.tencent.mm.plugin.exdevice.f.b.a.a Kr = ad.bpa().Kr(exdeviceRankInfoUI.igi);
            if (Kr != null) {
                exdeviceRankInfoUI.lvW = Kr.field_championUrl;
            }
        }
        d h = b.h(exdeviceRankInfoUI.igi, exdeviceRankInfoUI.lDu);
        String str = "--";
        String str2 = "0";
        if (h != null) {
            str = String.valueOf(h.field_ranknum);
            str2 = String.valueOf(h.field_score);
        }
        new ac().a(exdeviceRankInfoUI, str, str2, exdeviceRankInfoUI.lvW, new ac.a() {
            public final void Kj(String str) {
                AppMethodBeat.i(20151);
                ExdeviceRankInfoUI.c(ExdeviceRankInfoUI.this, str);
                AppMethodBeat.o(20151);
            }
        });
        AppMethodBeat.o(20194);
    }

    static /* synthetic */ void o(ExdeviceRankInfoUI exdeviceRankInfoUI) {
        AppMethodBeat.i(20195);
        AppBrandStatObject appBrandStatObject = new AppBrandStatObject();
        appBrandStatObject.scene = 1063;
        ((com.tencent.mm.plugin.appbrand.service.e) com.tencent.mm.kernel.g.K(com.tencent.mm.plugin.appbrand.service.e.class)).a(exdeviceRankInfoUI.mController.ylL, null, "wx3fca79fc5715b185", 0, 0, BuildConfig.FLAVOR, appBrandStatObject);
        AppMethodBeat.o(20195);
    }

    static /* synthetic */ void p(ExdeviceRankInfoUI exdeviceRankInfoUI) {
        AppMethodBeat.i(20196);
        com.tencent.mm.ui.widget.a.d dVar = new com.tencent.mm.ui.widget.a.d(exdeviceRankInfoUI.mController.ylL, 1, false);
        dVar.rBl = new n.c() {
            public final void a(l lVar) {
                AppMethodBeat.i(20154);
                if (ExdeviceRankInfoUI.this.lvJ) {
                    lVar.e(1, ExdeviceRankInfoUI.this.getString(2131299353));
                    AppMethodBeat.o(20154);
                    return;
                }
                lVar.e(0, ExdeviceRankInfoUI.this.getString(2131299359));
                AppMethodBeat.o(20154);
            }
        };
        dVar.rBm = new 17(exdeviceRankInfoUI);
        dVar.cpD();
        AppMethodBeat.o(20196);
    }

    static /* synthetic */ void c(ExdeviceRankInfoUI exdeviceRankInfoUI, String str) {
        AppMethodBeat.i(20201);
        Intent intent = new Intent();
        intent.putExtra("Select_Conv_Type", 3);
        intent.putExtra("select_is_ret", true);
        intent.putExtra("Retr_Msg_Type", 0);
        intent.putExtra("image_path", str);
        com.tencent.mm.bp.d.b(exdeviceRankInfoUI, ".ui.transmit.SelectConversationUI", intent, 1);
        AppMethodBeat.o(20201);
    }
}
