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

import android.content.Context;
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_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.sdk.platformtools.ab;
import com.tencent.mm.sdk.platformtools.bo;
import com.tencent.mm.sdk.platformtools.d;
import com.tencent.mm.ui.base.l;
import com.tencent.mm.ui.base.n.c;
import com.tencent.ytcommon.BuildConfig;
import java.util.List;

class WalletBalanceFetchUI$16 implements c {
    final /* synthetic */ WalletBalanceFetchUI the;
    final /* synthetic */ List thk;
    final /* synthetic */ Context val$context;

    WalletBalanceFetchUI$16(WalletBalanceFetchUI walletBalanceFetchUI, List list, Context context) {
        this.the = walletBalanceFetchUI;
        this.thk = list;
        this.val$context = context;
    }

    public final void a(l lVar) {
        AppMethodBeat.i(45372);
        int i = 0;
        for (Bankcard bankcard : this.thk) {
            CharSequence spannableString;
            String str;
            Bitmap a;
            e i2 = b.i(this.val$context, bankcard.field_bankcardType, bankcard.cPb());
            String str2 = BuildConfig.FLAVOR;
            if (i2 != null) {
                str2 = i2.oRi;
            }
            ab.d("MicroMsg.WalletBalanceFetchUI", "logo url: %s", new Object[]{str2});
            Bitmap a2 = x.a(new com.tencent.mm.plugin.wallet_core.ui.view.c(str2));
            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);
                str = charSequence;
            } else {
                String str3 = charSequence + " ";
                charSequence = new SpannableString(str3 + bankcard.field_forbid_title);
                1 1 = new 1(this, this.val$context, bankcard);
                int length = str3.length();
                int length2 = str3.length() + bankcard.field_forbid_title.length();
                charSequence.setSpan(new ForegroundColorSpan(this.val$context.getResources().getColor(2131690645)), length, length2, 33);
                charSequence.setSpan(1, length, length2, 33);
                spannableString = charSequence;
                str = str3;
            }
            if (bo.ac(spannableString)) {
                spannableString = new SpannableString(bankcard.field_fetchArriveTimeWording);
            }
            str2 = bankcard.field_desc;
            if (a2 != null) {
                a = d.a(a2, this.val$context.getResources().getDimensionPixelOffset(2131428760), this.val$context.getResources().getDimensionPixelOffset(2131428760), true, false);
            } else {
                a = null;
            }
            ab.i("MicroMsg.WalletBalanceFetchUI", "i %d fee %s %s", new Object[]{Integer.valueOf(i), str2, spannableString});
            int i3 = i + 1;
            lVar.a(i, str2, spannableString, a == null ? null : new BitmapDrawable(a), !bo.isNullOrNil(str));
            i = i3;
        }
        lVar.e(i, this.val$context.getString(2131304544));
        AppMethodBeat.o(45372);
    }
}
