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

import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import com.tencent.matrix.trace.core.AppMethodBeat;
import com.tencent.mm.platformtools.x;
import com.tencent.mm.plugin.wallet.balance.a.a.p;
import com.tencent.mm.plugin.wallet_core.d.b;
import com.tencent.mm.plugin.wallet_core.model.Bankcard;
import com.tencent.mm.plugin.wallet_core.model.e;
import com.tencent.mm.protocal.protobuf.azb;
import com.tencent.mm.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.ui.base.l;
import com.tencent.mm.ui.base.n.c;
import com.tencent.mm.ui.widget.a.d;
import com.tencent.ytcommon.BuildConfig;

class WalletLqtSaveFetchUI$21 implements c {
    final /* synthetic */ d gCw;
    final /* synthetic */ WalletLqtSaveFetchUI tkP;

    WalletLqtSaveFetchUI$21(WalletLqtSaveFetchUI walletLqtSaveFetchUI, d dVar) {
        this.tkP = walletLqtSaveFetchUI;
        this.gCw = dVar;
    }

    public final void a(l lVar) {
        boolean z;
        AppMethodBeat.i(45674);
        int size = WalletLqtSaveFetchUI.f(this.tkP).size();
        for (int i = 0; i < size; i++) {
            String str;
            CharSequence spannableString;
            String str2;
            Bankcard bankcard = (Bankcard) WalletLqtSaveFetchUI.f(this.tkP).get(i);
            String str3 = BuildConfig.FLAVOR;
            e i2 = b.i(this.tkP, bankcard.field_bankcardType, bankcard.cPb());
            if (i2 != null) {
                str = i2.oRi;
            } else {
                str = str3;
            }
            Bitmap a = x.a(new com.tencent.mm.plugin.wallet_core.ui.view.c(str));
            x.a(new 1(this, str, lVar));
            Bitmap bitmap = null;
            CharSequence charSequence = BuildConfig.FLAVOR;
            if (!bo.isNullOrNil(bankcard.field_forbidWord)) {
                charSequence = bankcard.field_forbidWord;
            }
            if (bo.isNullOrNil(bankcard.field_forbid_title)) {
                spannableString = new SpannableString(charSequence);
                str2 = charSequence;
            } else {
                str3 = charSequence + " ";
                spannableString = new SpannableString(str3 + bankcard.field_forbid_title);
                2 2 = new 2(this, this.tkP);
                int length = str3.length();
                int length2 = str3.length() + bankcard.field_forbid_title.length();
                spannableString.setSpan(new ForegroundColorSpan(this.tkP.getResources().getColor(2131690645)), length, length2, 33);
                spannableString.setSpan(2, length, length2, 33);
                str2 = str3;
            }
            str3 = bankcard.field_desc;
            if (bankcard.cPc()) {
                ab.i("MicroMsg.WalletLqtSaveFetchUI", "i %d fee %s %s", new Object[]{Integer.valueOf(i), str3, spannableString});
                lVar.a(i, str3, spannableString, this.tkP.getResources().getDrawable(2130840657), !bo.isNullOrNil(str2));
            } else {
                if (a != null) {
                    bitmap = com.tencent.mm.sdk.platformtools.d.a(a, this.tkP.getResources().getDimensionPixelOffset(2131428760), this.tkP.getResources().getDimensionPixelOffset(2131428760), true, false);
                }
                ab.i("MicroMsg.WalletLqtSaveFetchUI", "i %d fee %s %s", new Object[]{Integer.valueOf(i), str3, spannableString});
                lVar.a(i, str3, spannableString, bitmap == null ? null : new BitmapDrawable(bitmap), !bo.isNullOrNil(str2));
            }
            if (bitmap == null) {
                WalletLqtSaveFetchUI.g(this.tkP).put(str, Integer.valueOf(i));
            }
        }
        p pVar = p.tfu;
        if (WalletLqtSaveFetchUI.h(this.tkP) == 1) {
            z = true;
        } else {
            z = false;
        }
        pVar.mL(z);
        azb azb = z ? pVar.tfi : pVar.tfj;
        if (azb != null) {
            z = azb.wCP;
        } else {
            z = false;
        }
        if (z) {
            ab.i("MicroMsg.WalletLqtSaveFetchUI", "isNoSupportLqtBank");
            AppMethodBeat.o(45674);
        } else if (WalletLqtSaveFetchUI.h(this.tkP) == 1) {
            lVar.a(size, this.tkP.getString(2131305011), BuildConfig.FLAVOR, this.tkP.getResources().getDrawable(2130840649), false);
            AppMethodBeat.o(45674);
        } else {
            if (WalletLqtSaveFetchUI.h(this.tkP) == 2) {
                lVar.a(size, this.tkP.getString(2131304931), BuildConfig.FLAVOR, this.tkP.getResources().getDrawable(2130840649), false);
            }
            AppMethodBeat.o(45674);
        }
    }
}
