package com.tencent.mm.plugin.card.ui.v2;

import a.k.d;
import a.l;
import a.v;
import a.y;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.RecyclerView.i;
import android.support.v7.widget.z;
import android.view.LayoutInflater;
import android.view.MenuItem.OnMenuItemClickListener;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.TextView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.kernel.e;
import com.tencent.mm.kernel.g;
import com.tencent.mm.plugin.appbrand.widget.recyclerview.LoadMoreRecyclerView;
import com.tencent.mm.plugin.appbrand.widget.recyclerview.MRecyclerView$b;
import com.tencent.mm.plugin.card.model.a.j;
import com.tencent.mm.plugin.report.service.h;
import com.tencent.mm.protocal.protobuf.bih;
import com.tencent.mm.protocal.protobuf.bii;
import com.tencent.mm.protocal.protobuf.bij;
import com.tencent.mm.protocal.protobuf.bik;
import com.tencent.mm.protocal.protobuf.btd;
import com.tencent.mm.protocal.protobuf.wo;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.ytcommon.BuildConfig;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;

@l(dWo = {1, 1, 13}, dWp = {"\u0000n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u0018\u0000 22\u00020\u0001:\u00012B\u0005¢\u0006\u0002\u0010\u0002J\b\u0010\u0018\u001a\u00020\u0019H\u0002J\u0010\u0010\u001a\u001a\u00020\u00192\u0006\u0010\u001b\u001a\u00020\u001cH\u0002J\b\u0010\u001d\u001a\u00020\u0019H\u0002J\b\u0010\u001e\u001a\u00020\u0015H\u0014J\u0010\u0010\u001f\u001a\u00020\u00192\u0006\u0010\u001b\u001a\u00020\u001cH\u0002J\b\u0010 \u001a\u00020\u0019H\u0014J\b\u0010!\u001a\u00020\u0019H\u0002J\"\u0010\"\u001a\u00020\u00192\u0006\u0010#\u001a\u00020\u00152\u0006\u0010$\u001a\u00020\u00152\b\u0010%\u001a\u0004\u0018\u00010&H\u0014J\u0012\u0010'\u001a\u00020\u00192\b\u0010(\u001a\u0004\u0018\u00010)H\u0016J\b\u0010*\u001a\u00020\u0019H\u0014J\u0018\u0010+\u001a\u00020\u00192\u0006\u0010,\u001a\u00020\u00152\u0006\u0010-\u001a\u00020\u0004H\u0016J\b\u0010.\u001a\u00020\u0019H\u0002J&\u0010/\u001a\u00020\u00192\b\u0010\t\u001a\u0004\u0018\u0001002\b\u0010\u0017\u001a\u0004\u0018\u0001012\b\u0010\f\u001a\u0004\u0018\u000101H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0005\u001a\u0004\u0018\u00010\u0006X\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\u0004X\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\u0004X\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\t\u001a\b\u0012\u0004\u0012\u00020\u000b0\nX\u0004¢\u0006\u0002\n\u0000R\u0014\u0010\f\u001a\b\u0012\u0004\u0012\u00020\u000b0\nX\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX.¢\u0006\u0002\n\u0000R\u000e\u0010\u000f\u001a\u00020\u000eX.¢\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\u0011X.¢\u0006\u0002\n\u0000R\u000e\u0010\u0012\u001a\u00020\u0013X.¢\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\u0015X\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0016\u001a\u00020\u0015X\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\u0017\u001a\b\u0012\u0004\u0012\u00020\u000b0\nX\u0004¢\u0006\u0002\n\u0000¨\u00063"}, dWq = {"Lcom/tencent/mm/plugin/card/ui/v2/CardTicketListUI;", "Lcom/tencent/mm/plugin/card/ui/v2/CardNewBaseUI;", "()V", "firstLoad", "", "getMktTicketHomePage", "Lcom/tencent/mm/plugin/card/model/v2/CgiGetMktTicketHomePage;", "isAll", "isLoading", "jumpList", "Ljava/util/ArrayList;", "Lcom/tencent/mm/plugin/card/ui/v2/CardTicketListModel;", "licenseList", "mEmptyView", "Landroid/view/ViewGroup;", "mFooterView", "mTicketAdapter", "Lcom/tencent/mm/plugin/card/ui/v2/CardTicketAdapter;", "mTicketRv", "Lcom/tencent/mm/plugin/appbrand/widget/recyclerview/LoadMoreRecyclerView;", "offset", "", "reqNum", "ticketList", "adjustFooterView", "", "doDeleteTicket", "cardId", "", "doGetTicketHomePage", "getLayoutId", "gotoCardDetailUI", "initView", "loadSnapshot", "onActivityResult", "requestCode", "resultCode", "data", "Landroid/content/Intent;", "onCreate", "savedInstanceState", "Landroid/os/Bundle;", "onDestroy", "onFinishLocationThings", "ret", "isLocationOk", "saveSnapshot", "updateModelList", "Lcom/tencent/mm/protocal/protobuf/PageTicketJumpList;", "Lcom/tencent/mm/protocal/protobuf/PageTicketList;", "Companion", "plugin-card_release"})
public final class CardTicketListUI extends CardNewBaseUI {
    public static final a kqg = new a();
    private boolean exX = true;
    private boolean isLoading;
    private int koB = 10;
    private boolean koC;
    private ViewGroup kox;
    private ViewGroup koy;
    private LoadMoreRecyclerView kpF;
    private c kpG;
    private final ArrayList<d> kpW = new ArrayList();
    private final ArrayList<d> kpX = new ArrayList();
    private final ArrayList<d> kpY = new ArrayList();
    private j kqf;
    private int offset;

    @l(dWo = {1, 1, 13}, dWp = {"\u0000\u0018\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000e\n\u0000\b\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u000e\u0010\u0003\u001a\u00020\u0004XT¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006XT¢\u0006\u0002\n\u0000¨\u0006\u0007"}, dWq = {"Lcom/tencent/mm/plugin/card/ui/v2/CardTicketListUI$Companion;", "", "()V", "REQ_CARD_DETAIL", "", "TAG", "", "plugin-card_release"})
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(byte b) {
            this();
        }
    }

    @l(dWo = {1, 1, 13}, dWp = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, dWq = {"<anonymous>", "", "run"})
    static final class b implements Runnable {
        final /* synthetic */ CardTicketListUI kqh;

        b(CardTicketListUI cardTicketListUI) {
            this.kqh = cardTicketListUI;
        }

        public final void run() {
            AppMethodBeat.i(89298);
            ViewGroup viewGroup = (ViewGroup) this.kqh.findViewById(2131820884);
            if (viewGroup == null) {
                AppMethodBeat.o(89298);
                return;
            }
            int height = viewGroup.getHeight();
            int computeVerticalScrollRange = CardTicketListUI.d(this.kqh).computeVerticalScrollRange();
            int computeVerticalScrollExtent = CardTicketListUI.d(this.kqh).computeVerticalScrollExtent();
            ab.d("MicroMsg.CardTicketListUI", "range: %s, extent: %s, contentHeight: %s", new Object[]{Integer.valueOf(computeVerticalScrollRange), Integer.valueOf(computeVerticalScrollExtent), Integer.valueOf(height)});
            if (height > computeVerticalScrollRange) {
                height -= computeVerticalScrollRange;
                if (height >= 0) {
                    CardTicketListUI.e(this.kqh).setPadding(0, height + CardTicketListUI.e(this.kqh).getPaddingTop(), 0, CardTicketListUI.e(this.kqh).getPaddingBottom());
                }
            } else {
                CardTicketListUI.e(this.kqh).setPadding(0, com.tencent.mm.bz.a.fromDPToPix((Context) this.kqh.dxU(), 48), 0, com.tencent.mm.bz.a.fromDPToPix((Context) this.kqh.dxU(), 24));
            }
            TextView textView = (TextView) CardTicketListUI.e(this.kqh).findViewById(2131822165);
            a.f.b.j.o(textView, "faqTv");
            textView.setText(this.kqh.getString(2131304052));
            textView.setVisibility(0);
            AppMethodBeat.o(89298);
        }
    }

    @l(dWo = {1, 1, 13}, dWp = {"\u0000\u0014\n\u0000\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\n \u0002*\u0004\u0018\u00010\u00010\u00012*\u0010\u0003\u001a&\u0012\f\u0012\n \u0002*\u0004\u0018\u00010\u00050\u0005 \u0002*\u0012\u0012\f\u0012\n \u0002*\u0004\u0018\u00010\u00050\u0005\u0018\u00010\u00040\u0004H\n¢\u0006\u0002\b\u0006"}, dWq = {"<anonymous>", "", "kotlin.jvm.PlatformType", "it", "Lcom/tencent/mm/modelbase/Cgi$CgiBack;", "Lcom/tencent/mm/protocal/protobuf/DeleteCardInTicketListResponse;", "call"})
    static final class c<_Ret, _Var> implements com.tencent.mm.vending.c.a<_Ret, _Var> {
        final /* synthetic */ String kpL;
        final /* synthetic */ CardTicketListUI kqh;

        c(CardTicketListUI cardTicketListUI, String str) {
            this.kqh = cardTicketListUI;
            this.kpL = str;
        }

        public final /* synthetic */ Object call(Object obj) {
            AppMethodBeat.i(89299);
            com.tencent.mm.ai.a.a aVar = (com.tencent.mm.ai.a.a) obj;
            ab.i("MicroMsg.CardTicketListUI", "errtype: %s, errcode: %s", new Object[]{Integer.valueOf(aVar.errType), Integer.valueOf(aVar.errCode)});
            if (aVar.errType == 0 && aVar.errCode == 0) {
                btd btd = aVar.fsy;
                wo woVar = (wo) btd;
                ab.i("MicroMsg.CardTicketListUI", "retCode: %s", new Object[]{Integer.valueOf(woVar.kdT)});
                if (woVar.kdT == 0) {
                    CardTicketListUI.b(this.kqh).GZ(this.kpL);
                    CardTicketListUI.c(this.kqh);
                } else {
                    com.tencent.mm.plugin.card.d.l.ai((Context) this.kqh, woVar.kdU);
                }
                AppMethodBeat.o(89299);
                return btd;
            }
            com.tencent.mm.plugin.card.d.l.aj((Context) this.kqh, BuildConfig.FLAVOR);
            Object obj2 = y.AUy;
            AppMethodBeat.o(89299);
            return obj2;
        }
    }

    static {
        AppMethodBeat.i(89319);
        AppMethodBeat.o(89319);
    }

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

    public CardTicketListUI() {
        AppMethodBeat.i(89318);
        AppMethodBeat.o(89318);
    }

    public static final /* synthetic */ void a(CardTicketListUI cardTicketListUI) {
        AppMethodBeat.i(89320);
        cardTicketListUI.beq();
        AppMethodBeat.o(89320);
    }

    public static final /* synthetic */ void a(CardTicketListUI cardTicketListUI, bij bij, bik bik, bik bik2) {
        AppMethodBeat.i(89327);
        cardTicketListUI.a(bij, bik, bik2);
        AppMethodBeat.o(89327);
    }

    public static final /* synthetic */ c b(CardTicketListUI cardTicketListUI) {
        AppMethodBeat.i(89321);
        c cVar = cardTicketListUI.kpG;
        if (cVar == null) {
            a.f.b.j.avw("mTicketAdapter");
        }
        AppMethodBeat.o(89321);
        return cVar;
    }

    public static final /* synthetic */ void b(CardTicketListUI cardTicketListUI, String str) {
        AppMethodBeat.i(89323);
        cardTicketListUI.Hc(str);
        AppMethodBeat.o(89323);
    }

    public static final /* synthetic */ LoadMoreRecyclerView d(CardTicketListUI cardTicketListUI) {
        AppMethodBeat.i(89325);
        LoadMoreRecyclerView loadMoreRecyclerView = cardTicketListUI.kpF;
        if (loadMoreRecyclerView == null) {
            a.f.b.j.avw("mTicketRv");
        }
        AppMethodBeat.o(89325);
        return loadMoreRecyclerView;
    }

    public static final /* synthetic */ ViewGroup e(CardTicketListUI cardTicketListUI) {
        AppMethodBeat.i(89326);
        ViewGroup viewGroup = cardTicketListUI.kox;
        if (viewGroup == null) {
            a.f.b.j.avw("mFooterView");
        }
        AppMethodBeat.o(89326);
        return viewGroup;
    }

    public final void onCreate(Bundle bundle) {
        Charset charset;
        v vVar;
        byte[] bytes;
        AppMethodBeat.i(89310);
        dxR();
        super.onCreate(bundle);
        xE(Color.parseColor("#f3f3f3"));
        dyb();
        initView();
        bij bij = new bij();
        bik bik = new bik();
        bik bik2 = new bik();
        com.tencent.mm.plugin.card.model.a.a.a aVar = com.tencent.mm.plugin.card.model.a.a.kfc;
        a.f.b.j.p(bij, "jumpList");
        a.f.b.j.p(bik, "ticketList");
        a.f.b.j.p(bik2, "licenseList");
        ab.d(com.tencent.mm.plugin.card.model.a.a.access$getTAG$cp(), "load ticket page snapshot");
        e RP = g.RP();
        a.f.b.j.o(RP, "MMKernel.storage()");
        String str = (String) RP.Ry().i(com.tencent.mm.storage.ac.a.xWg);
        if (str != null) {
            charset = d.ISO_8859_1;
            if (str == null) {
                vVar = new v("null cannot be cast to non-null type java.lang.String");
                AppMethodBeat.o(89310);
                throw vVar;
            }
            bytes = str.getBytes(charset);
            a.f.b.j.o(bytes, "(this as java.lang.String).getBytes(charset)");
            bij.parseFrom(bytes);
        }
        RP = g.RP();
        a.f.b.j.o(RP, "MMKernel.storage()");
        str = (String) RP.Ry().i(com.tencent.mm.storage.ac.a.xWh);
        if (str != null) {
            charset = d.ISO_8859_1;
            if (str == null) {
                vVar = new v("null cannot be cast to non-null type java.lang.String");
                AppMethodBeat.o(89310);
                throw vVar;
            }
            bytes = str.getBytes(charset);
            a.f.b.j.o(bytes, "(this as java.lang.String).getBytes(charset)");
            bik.parseFrom(bytes);
        }
        RP = g.RP();
        a.f.b.j.o(RP, "MMKernel.storage()");
        str = (String) RP.Ry().i(com.tencent.mm.storage.ac.a.xWi);
        if (str != null) {
            charset = d.ISO_8859_1;
            if (str == null) {
                vVar = new v("null cannot be cast to non-null type java.lang.String");
                AppMethodBeat.o(89310);
                throw vVar;
            }
            bytes = str.getBytes(charset);
            a.f.b.j.o(bytes, "(this as java.lang.String).getBytes(charset)");
            bik2.parseFrom(bytes);
        }
        a(bij, bik, bik2);
        setMMTitle(2131304053);
        setBackBtn((OnMenuItemClickListener) new i(this));
        h.pYm.e(16322, new Object[]{Integer.valueOf(6)});
        AppMethodBeat.o(89310);
    }

    public final void initView() {
        AppMethodBeat.i(89311);
        View findViewById = findViewById(2131822330);
        a.f.b.j.o(findViewById, "findViewById(R.id.ctlu_rv)");
        this.kpF = (LoadMoreRecyclerView) findViewById;
        this.kpG = new c();
        LoadMoreRecyclerView loadMoreRecyclerView = this.kpF;
        if (loadMoreRecyclerView == null) {
            a.f.b.j.avw("mTicketRv");
        }
        c cVar = this.kpG;
        if (cVar == null) {
            a.f.b.j.avw("mTicketAdapter");
        }
        loadMoreRecyclerView.setAdapter((android.support.v7.widget.RecyclerView.a) cVar);
        loadMoreRecyclerView = this.kpF;
        if (loadMoreRecyclerView == null) {
            a.f.b.j.avw("mTicketRv");
        }
        loadMoreRecyclerView.setLayoutManager((i) new LinearLayoutManager());
        z zVar = new z((Context) this);
        zVar.setDrawable(getResources().getDrawable(2130838085));
        LoadMoreRecyclerView loadMoreRecyclerView2 = this.kpF;
        if (loadMoreRecyclerView2 == null) {
            a.f.b.j.avw("mTicketRv");
        }
        loadMoreRecyclerView2.b((RecyclerView.h) zVar);
        LoadMoreRecyclerView loadMoreRecyclerView3 = this.kpF;
        if (loadMoreRecyclerView3 == null) {
            a.f.b.j.avw("mTicketRv");
        }
        loadMoreRecyclerView3.setLoadingView(2130968937);
        LayoutInflater from = LayoutInflater.from((Context) this);
        loadMoreRecyclerView3 = this.kpF;
        if (loadMoreRecyclerView3 == null) {
            a.f.b.j.avw("mTicketRv");
        }
        findViewById = from.inflate(2130968935, (ViewGroup) loadMoreRecyclerView3, false);
        if (findViewById == null) {
            v vVar = new v("null cannot be cast to non-null type android.view.ViewGroup");
            AppMethodBeat.o(89311);
            throw vVar;
        }
        this.kox = (ViewGroup) findViewById;
        ViewGroup viewGroup = this.kox;
        if (viewGroup == null) {
            a.f.b.j.avw("mFooterView");
        }
        ((TextView) viewGroup.findViewById(2131822165)).setOnClickListener((OnClickListener) new e(this));
        loadMoreRecyclerView = this.kpF;
        if (loadMoreRecyclerView == null) {
            a.f.b.j.avw("mTicketRv");
        }
        viewGroup = this.kox;
        if (viewGroup == null) {
            a.f.b.j.avw("mFooterView");
        }
        loadMoreRecyclerView.addFooterView(viewGroup);
        viewGroup = this.kox;
        if (viewGroup == null) {
            a.f.b.j.avw("mFooterView");
        }
        viewGroup.setVisibility(8);
        findViewById = findViewById(2131822163);
        a.f.b.j.o(findViewById, "findViewById(R.id.chpe_root_layout)");
        this.koy = (ViewGroup) findViewById;
        loadMoreRecyclerView = this.kpF;
        if (loadMoreRecyclerView == null) {
            a.f.b.j.avw("mTicketRv");
        }
        viewGroup = this.koy;
        if (viewGroup == null) {
            a.f.b.j.avw("mEmptyView");
        }
        loadMoreRecyclerView.setEmptyView(viewGroup);
        loadMoreRecyclerView = this.kpF;
        if (loadMoreRecyclerView == null) {
            a.f.b.j.avw("mTicketRv");
        }
        loadMoreRecyclerView.setOnLoadingStateChangedListener((com.tencent.mm.plugin.appbrand.widget.recyclerview.LoadMoreRecyclerView.a) new f(this));
        loadMoreRecyclerView = this.kpF;
        if (loadMoreRecyclerView == null) {
            a.f.b.j.avw("mTicketRv");
        }
        loadMoreRecyclerView.setOnItemClickListener((com.tencent.mm.plugin.appbrand.widget.recyclerview.MRecyclerView.a) new g(this));
        loadMoreRecyclerView = this.kpF;
        if (loadMoreRecyclerView == null) {
            a.f.b.j.avw("mTicketRv");
        }
        loadMoreRecyclerView.setOnItemLongClickListener((MRecyclerView$b) new h(this));
        AppMethodBeat.o(89311);
    }

    public final void onDestroy() {
        bih bih;
        AppMethodBeat.i(89312);
        super.onDestroy();
        j jVar = this.kqf;
        if (jVar != null) {
            jVar.cancel();
        }
        ab.i("MicroMsg.CardTicketListUI", "do save snapshot");
        bij bij = new bij();
        bij.wLM = new LinkedList();
        Iterator it = this.kpY.iterator();
        while (it.hasNext()) {
            bii bii = ((d) it.next()).kqd;
            if (bii != null) {
                bij.wLM.add(bii);
            }
        }
        bik bik = new bik();
        bik.wLN = new LinkedList();
        Iterator it2 = this.kpW.iterator();
        while (it2.hasNext()) {
            bih = ((d) it2.next()).kqe;
            if (bih != null) {
                bik.wLN.add(bih);
            }
        }
        bik bik2 = new bik();
        bik2.wLN = new LinkedList();
        Iterator it3 = this.kpX.iterator();
        while (it3.hasNext()) {
            bih = ((d) it3.next()).kqe;
            if (bih != null) {
                bik2.wLN.add(bih);
            }
        }
        com.tencent.mm.plugin.card.model.a.a.a aVar = com.tencent.mm.plugin.card.model.a.a.kfc;
        a.f.b.j.p(bij, "jumpList");
        a.f.b.j.p(bik, "ticketList");
        a.f.b.j.p(bik2, "licenseList");
        ab.d(com.tencent.mm.plugin.card.model.a.a.access$getTAG$cp(), "save ticket page snapshot");
        byte[] toByteArray = bij.toByteArray();
        a.f.b.j.o(toByteArray, "jumpList.toByteArray()");
        String str = new String(toByteArray, d.ISO_8859_1);
        e RP = g.RP();
        a.f.b.j.o(RP, "MMKernel.storage()");
        RP.Ry().set(com.tencent.mm.storage.ac.a.xWg, str);
        toByteArray = bik.toByteArray();
        a.f.b.j.o(toByteArray, "ticketList.toByteArray()");
        String str2 = new String(toByteArray, d.ISO_8859_1);
        RP = g.RP();
        a.f.b.j.o(RP, "MMKernel.storage()");
        RP.Ry().set(com.tencent.mm.storage.ac.a.xWh, str2);
        toByteArray = bik2.toByteArray();
        a.f.b.j.o(toByteArray, "licenseList.toByteArray()");
        str2 = new String(toByteArray, d.ISO_8859_1);
        RP = g.RP();
        a.f.b.j.o(RP, "MMKernel.storage()");
        RP.Ry().set(com.tencent.mm.storage.ac.a.xWi, str2);
        AppMethodBeat.o(89312);
    }

    public final int getLayoutId() {
        return 2130968995;
    }

    public final void onActivityResult(int i, int i2, Intent intent) {
        Object obj = null;
        AppMethodBeat.i(89313);
        if (i == 256 && i2 == -1) {
            Integer valueOf = intent != null ? Integer.valueOf(intent.getIntExtra("key_finish_action", -1)) : null;
            if ((valueOf != null && valueOf.intValue() == 1) || (valueOf != null && valueOf.intValue() == 2)) {
                if (intent != null) {
                    obj = intent.getStringExtra("key_card_id");
                }
                a.f.b.j.o(obj, "cardId");
                Hc(obj);
            }
        }
        super.onActivityResult(i, i2, intent);
        AppMethodBeat.o(89313);
    }

    public final void P(int i, boolean z) {
        AppMethodBeat.i(89314);
        ab.i("MicroMsg.CardTicketListUI", "location finish: [%s, %s], ret: %s, isOk: %s", new Object[]{Float.valueOf(this.cEB), Float.valueOf(this.cGm), Integer.valueOf(i), Boolean.valueOf(z)});
        if (this.exX) {
            beq();
            AppMethodBeat.o(89314);
            return;
        }
        if (!z) {
            bep();
        }
        AppMethodBeat.o(89314);
    }

    /* JADX WARNING: Removed duplicated region for block: B:52:0x0115  */
    /* JADX WARNING: Missing block: B:38:0x00ce, code skipped:
            if ((!((java.util.Collection) r7.kpW).isEmpty() ? 1 : 0) != 0) goto L_0x00d0;
     */
    private final void a(com.tencent.mm.protocal.protobuf.bij r8, com.tencent.mm.protocal.protobuf.bik r9, com.tencent.mm.protocal.protobuf.bik r10) {
        /*
        r7 = this;
        r6 = 89315; // 0x15ce3 float:1.25157E-40 double:4.41275E-319;
        r5 = 2;
        r2 = 0;
        r1 = 1;
        com.tencent.matrix.trace.core.AppMethodBeat.i(r6);
        if (r8 == 0) goto L_0x0046;
    L_0x000b:
        r0 = r7.kpY;
        r0.clear();
        r0 = r8.wLM;
        r3 = "page_ticket_jump_element";
        a.f.b.j.o(r0, r3);
        r0 = (java.util.Collection) r0;
        r0 = r0.isEmpty();
        if (r0 != 0) goto L_0x0044;
    L_0x0020:
        r0 = r1;
    L_0x0021:
        if (r0 == 0) goto L_0x0046;
    L_0x0023:
        r0 = r8.wLM;
        r3 = r0.iterator();
    L_0x0029:
        r0 = r3.hasNext();
        if (r0 == 0) goto L_0x0046;
    L_0x002f:
        r0 = r3.next();
        r0 = (com.tencent.mm.protocal.protobuf.bii) r0;
        r4 = new com.tencent.mm.plugin.card.ui.v2.d;
        r4.<init>();
        r4.kqd = r0;
        r4.type = r1;
        r0 = r7.kpY;
        r0.add(r4);
        goto L_0x0029;
    L_0x0044:
        r0 = r2;
        goto L_0x0021;
    L_0x0046:
        if (r9 == 0) goto L_0x007e;
    L_0x0048:
        r0 = r9.wLN;
        r3 = "page_ticket_element";
        a.f.b.j.o(r0, r3);
        r0 = (java.util.Collection) r0;
        r0 = r0.isEmpty();
        if (r0 != 0) goto L_0x007c;
    L_0x0058:
        r0 = r1;
    L_0x0059:
        if (r0 == 0) goto L_0x007e;
    L_0x005b:
        r0 = r9.wLN;
        r3 = r0.iterator();
    L_0x0061:
        r0 = r3.hasNext();
        if (r0 == 0) goto L_0x007e;
    L_0x0067:
        r0 = r3.next();
        r0 = (com.tencent.mm.protocal.protobuf.bih) r0;
        r4 = new com.tencent.mm.plugin.card.ui.v2.d;
        r4.<init>();
        r4.kqe = r0;
        r4.type = r5;
        r0 = r7.kpW;
        r0.add(r4);
        goto L_0x0061;
    L_0x007c:
        r0 = r2;
        goto L_0x0059;
    L_0x007e:
        if (r10 == 0) goto L_0x00b6;
    L_0x0080:
        r0 = r10.wLN;
        r3 = "page_ticket_element";
        a.f.b.j.o(r0, r3);
        r0 = (java.util.Collection) r0;
        r0 = r0.isEmpty();
        if (r0 != 0) goto L_0x00b4;
    L_0x0090:
        r0 = r1;
    L_0x0091:
        if (r0 == 0) goto L_0x00b6;
    L_0x0093:
        r0 = r10.wLN;
        r3 = r0.iterator();
    L_0x0099:
        r0 = r3.hasNext();
        if (r0 == 0) goto L_0x00b6;
    L_0x009f:
        r0 = r3.next();
        r0 = (com.tencent.mm.protocal.protobuf.bih) r0;
        r4 = new com.tencent.mm.plugin.card.ui.v2.d;
        r4.<init>();
        r4.kqe = r0;
        r4.type = r5;
        r0 = r7.kpX;
        r0.add(r4);
        goto L_0x0099;
    L_0x00b4:
        r0 = r2;
        goto L_0x0091;
    L_0x00b6:
        r0 = r7.kpY;
        r0 = (java.util.Collection) r0;
        r0 = r0.isEmpty();
        if (r0 != 0) goto L_0x0128;
    L_0x00c0:
        r0 = r1;
    L_0x00c1:
        if (r0 != 0) goto L_0x00d0;
    L_0x00c3:
        r0 = r7.kpW;
        r0 = (java.util.Collection) r0;
        r0 = r0.isEmpty();
        if (r0 != 0) goto L_0x012a;
    L_0x00cd:
        r0 = r1;
    L_0x00ce:
        if (r0 == 0) goto L_0x012e;
    L_0x00d0:
        r0 = r7.kpX;
        r0 = (java.util.Collection) r0;
        r0 = r0.isEmpty();
        if (r0 != 0) goto L_0x012c;
    L_0x00da:
        r0 = r1;
    L_0x00db:
        if (r0 == 0) goto L_0x012e;
    L_0x00dd:
        r0 = r7.kpG;
        if (r0 != 0) goto L_0x00e7;
    L_0x00e1:
        r1 = "mTicketAdapter";
        a.f.b.j.avw(r1);
    L_0x00e7:
        r1 = 2131298009; // 0x7f0906d9 float:1.821398E38 double:1.0530011273E-314;
        r1 = r7.getString(r1);
        r2 = "getString(R.string.card_ticket_section_title)";
        a.f.b.j.o(r1, r2);
        r0.Ha(r1);
        r0 = r7.kpG;
        if (r0 != 0) goto L_0x0101;
    L_0x00fb:
        r1 = "mTicketAdapter";
        a.f.b.j.avw(r1);
    L_0x0101:
        r1 = 2131297900; // 0x7f09066c float:1.8213758E38 double:1.0530010734E-314;
        r1 = r7.getString(r1);
        r2 = "getString(R.string.card_license_section_title)";
        a.f.b.j.o(r1, r2);
        r0.Hb(r1);
    L_0x0111:
        r0 = r7.kpG;
        if (r0 != 0) goto L_0x011b;
    L_0x0115:
        r1 = "mTicketAdapter";
        a.f.b.j.avw(r1);
    L_0x011b:
        r1 = r7.kpY;
        r2 = r7.kpW;
        r3 = r7.kpX;
        r0.a(r1, r2, r3);
        com.tencent.matrix.trace.core.AppMethodBeat.o(r6);
        return;
    L_0x0128:
        r0 = r2;
        goto L_0x00c1;
    L_0x012a:
        r0 = r2;
        goto L_0x00ce;
    L_0x012c:
        r0 = r2;
        goto L_0x00db;
    L_0x012e:
        r0 = r7.kpG;
        if (r0 != 0) goto L_0x0138;
    L_0x0132:
        r1 = "mTicketAdapter";
        a.f.b.j.avw(r1);
    L_0x0138:
        r1 = "";
        r0.Ha(r1);
        r0 = r7.kpG;
        if (r0 != 0) goto L_0x0148;
    L_0x0142:
        r1 = "mTicketAdapter";
        a.f.b.j.avw(r1);
    L_0x0148:
        r1 = "";
        r0.Hb(r1);
        goto L_0x0111;
        */
        throw new UnsupportedOperationException("Method not decompiled: com.tencent.mm.plugin.card.ui.v2.CardTicketListUI.a(com.tencent.mm.protocal.protobuf.bij, com.tencent.mm.protocal.protobuf.bik, com.tencent.mm.protocal.protobuf.bik):void");
    }

    private final void Hc(String str) {
        AppMethodBeat.i(89316);
        ab.i("MicroMsg.CardTicketListUI", "do delete ticket: %s", new Object[]{str});
        new com.tencent.mm.plugin.card.model.a.d(str).acy().b((com.tencent.mm.vending.c.a) new c(this, str));
        AppMethodBeat.o(89316);
    }

    private final void beq() {
        AppMethodBeat.i(89317);
        ab.i("MicroMsg.CardTicketListUI", "do get ticket: %s, %s, %s, %s", new Object[]{Integer.valueOf(this.offset), Integer.valueOf(this.koB), Boolean.valueOf(this.koC), Boolean.valueOf(this.isLoading)});
        if (!(this.koC || this.isLoading)) {
            this.isLoading = true;
            this.kqf = new j(this.offset, this.koB, (double) this.cEB, (double) this.cGm);
            j jVar = this.kqf;
            if (jVar == null) {
                a.f.b.j.dWJ();
            }
            jVar.acy().b((com.tencent.mm.vending.c.a) new d(this));
        }
        AppMethodBeat.o(89317);
    }

    public static final /* synthetic */ void c(CardTicketListUI cardTicketListUI) {
        AppMethodBeat.i(89324);
        LoadMoreRecyclerView loadMoreRecyclerView = cardTicketListUI.kpF;
        if (loadMoreRecyclerView == null) {
            a.f.b.j.avw("mTicketRv");
        }
        loadMoreRecyclerView.post(new b(cardTicketListUI));
        AppMethodBeat.o(89324);
    }
}
