package com.tencent.mm.plugin.wallet.balance.ui.lqt;

import android.graphics.Color;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.plugin.wallet.balance.ui.lqt.WalletLqtPlanHomeUI$b.1;
import com.tencent.mm.plugin.wallet.balance.ui.lqt.WalletLqtPlanHomeUI$b.2;
import com.tencent.mm.protocal.protobuf.bkm;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.wallet_core.c.ae;
import com.tencent.mm.wallet_core.ui.e;
import java.math.BigDecimal;
import java.math.RoundingMode;

class WalletLqtPlanHomeUI$a extends BaseAdapter {
    final /* synthetic */ WalletLqtPlanHomeUI tjK;

    private WalletLqtPlanHomeUI$a(WalletLqtPlanHomeUI walletLqtPlanHomeUI) {
        this.tjK = walletLqtPlanHomeUI;
    }

    /* synthetic */ WalletLqtPlanHomeUI$a(WalletLqtPlanHomeUI walletLqtPlanHomeUI, byte b) {
        this(walletLqtPlanHomeUI);
    }

    public final /* synthetic */ Object getItem(int i) {
        AppMethodBeat.i(45618);
        bkm Hc = Hc(i);
        AppMethodBeat.o(45618);
        return Hc;
    }

    public final int getCount() {
        AppMethodBeat.i(45615);
        int size = WalletLqtPlanHomeUI.c(this.tjK).size();
        AppMethodBeat.o(45615);
        return size;
    }

    private bkm Hc(int i) {
        AppMethodBeat.i(45616);
        bkm bkm = (bkm) WalletLqtPlanHomeUI.c(this.tjK).get(i);
        AppMethodBeat.o(45616);
        return bkm;
    }

    public final long getItemId(int i) {
        return (long) i;
    }

    public final View getView(int i, View view, ViewGroup viewGroup) {
        AppMethodBeat.i(45617);
        if (view == null) {
            view = LayoutInflater.from(this.tjK.mController.ylL).inflate(2130969959, viewGroup, false);
            view.setTag(new WalletLqtPlanHomeUI$b(this.tjK, view));
        }
        bkm Hc = Hc(i);
        WalletLqtPlanHomeUI$b walletLqtPlanHomeUI$b = (WalletLqtPlanHomeUI$b) view.getTag();
        walletLqtPlanHomeUI$b.tjR.setPrefix(ae.dOd());
        BigDecimal a = e.a(Hc.cSh, "100", 2, RoundingMode.HALF_UP);
        if (((double) a.intValue()) == a.doubleValue()) {
            walletLqtPlanHomeUI$b.tjR.setText(a.intValue());
        } else {
            walletLqtPlanHomeUI$b.tjR.setText(a.toString());
        }
        walletLqtPlanHomeUI$b.tjT.setText(walletLqtPlanHomeUI$b.tjK.getString(2131304983, new Object[]{Hc.ehf, Hc.nuL, Hc.pck}));
        if (Hc.wNE == null || bo.isNullOrNil(Hc.wNE.xhq)) {
            walletLqtPlanHomeUI$b.tjU.setVisibility(8);
        } else {
            walletLqtPlanHomeUI$b.tjU.setText(Hc.wNE.xhq);
            if (bo.isNullOrNil(Hc.wNE.color)) {
                walletLqtPlanHomeUI$b.tjU.setTextColor(walletLqtPlanHomeUI$b.tjK.getResources().getColor(2131690312));
            } else {
                walletLqtPlanHomeUI$b.tjU.setTextColor(Color.parseColor(Hc.wNE.color));
            }
            walletLqtPlanHomeUI$b.tjU.setVisibility(0);
        }
        if (Hc.wNF != null) {
            walletLqtPlanHomeUI$b.tjV.setText(Hc.wNF.title);
            walletLqtPlanHomeUI$b.tjX.setOnClickListener(new 1(walletLqtPlanHomeUI$b, Hc));
        }
        if (Hc.state != 1) {
            walletLqtPlanHomeUI$b.tjW.setVisibility(0);
            walletLqtPlanHomeUI$b.tjT.setTextColor(Color.parseColor("#d1d1d1"));
            walletLqtPlanHomeUI$b.tjR.setTextColor(Color.parseColor("#d1d1d1"));
        } else {
            walletLqtPlanHomeUI$b.tjW.setVisibility(8);
            walletLqtPlanHomeUI$b.tjT.setTextColor(walletLqtPlanHomeUI$b.tjK.getResources().getColor(2131689761));
            walletLqtPlanHomeUI$b.tjR.setTextColor(walletLqtPlanHomeUI$b.tjK.getResources().getColor(2131689761));
        }
        walletLqtPlanHomeUI$b.tjS.setOnClickListener(new 2(walletLqtPlanHomeUI$b, Hc));
        AppMethodBeat.o(45617);
        return view;
    }
}
