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

import android.os.Bundle;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.ai.m;
import com.tencent.mm.plugin.luckymoney.model.ai;
import com.tencent.mm.plugin.luckymoney.model.r;
import com.tencent.mm.ui.base.MMLoadMoreListView;
import com.tencent.ytcommon.BuildConfig;
import java.util.LinkedList;
import java.util.List;

public class LuckyMoneyCanShareListUI extends LuckyMoneyBaseUI {
    private int Lp = 0;
    private boolean hZu = false;
    private List<r> nSx = new LinkedList();
    private boolean ocG = true;
    private String ocP = BuildConfig.FLAVOR;
    private MMLoadMoreListView odn;
    private e odo;

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

    public LuckyMoneyCanShareListUI() {
        AppMethodBeat.i(42639);
        AppMethodBeat.o(42639);
    }

    static /* synthetic */ void d(LuckyMoneyCanShareListUI luckyMoneyCanShareListUI) {
        AppMethodBeat.i(42644);
        luckyMoneyCanShareListUI.bMr();
        AppMethodBeat.o(42644);
    }

    public void onCreate(Bundle bundle) {
        AppMethodBeat.i(42640);
        super.onCreate(bundle);
        initView();
        bMr();
        AppMethodBeat.o(42640);
    }

    public final void initView() {
        AppMethodBeat.i(42641);
        setBackBtn(new 1(this));
        this.odn = (MMLoadMoreListView) findViewById(2131825554);
        setMMTitle(getString(2131301125));
        this.odo = new f(this.mController.ylL);
        this.odn.setAdapter(this.odo);
        this.odn.setOnItemClickListener(new 2(this));
        this.odn.setOnLoadMoreListener(new 3(this));
        AppMethodBeat.o(42641);
    }

    public final boolean c(int i, int i2, String str, m mVar) {
        AppMethodBeat.i(42642);
        if ((mVar instanceof ai) && i == 0 && i2 == 0) {
            ai aiVar = (ai) mVar;
            LinkedList linkedList = aiVar.nYQ.nXj;
            this.ocP = aiVar.nYz;
            if (linkedList != null) {
                for (int i3 = 0; i3 < linkedList.size(); i3++) {
                    this.nSx.add(linkedList.get(i3));
                }
                this.Lp += linkedList.size();
                this.ocG = aiVar.bLF();
                this.hZu = false;
                this.odo.ck(this.nSx);
            }
            if (this.ocG) {
                this.odn.dzN();
            } else {
                this.odn.dzO();
            }
            AppMethodBeat.o(42642);
            return true;
        }
        AppMethodBeat.o(42642);
        return false;
    }

    public final int getLayoutId() {
        return 2130969987;
    }

    private void bMr() {
        AppMethodBeat.i(42643);
        this.hZu = true;
        if (this.Lp == 0) {
            this.ocP = BuildConfig.FLAVOR;
        }
        n(new ai(10, this.Lp, 3, BuildConfig.FLAVOR, "v1.0", this.ocP));
        AppMethodBeat.o(42643);
    }
}
