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

import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;
import com.tencent.matrix.trace.core.AppMethodBeat;
import java.util.ArrayList;

class RegByMobileWaitingSMSUI$a extends ArrayAdapter<String> {
    private final LayoutInflater ezi;
    final /* synthetic */ RegByMobileWaitingSMSUI gHd;
    private final ArrayList<String> gHf;

    public final /* synthetic */ void add(Object obj) {
        AppMethodBeat.i(125484);
        wy((String) obj);
        AppMethodBeat.o(125484);
    }

    public final View getView(int i, View view, ViewGroup viewGroup) {
        RegByMobileWaitingSMSUI$b regByMobileWaitingSMSUI$b;
        View inflate;
        AppMethodBeat.i(125478);
        int itemViewType = getItemViewType(i);
        if (view == null) {
            regByMobileWaitingSMSUI$b = new RegByMobileWaitingSMSUI$b(this.gHd, (byte) 0);
            switch (itemViewType) {
                case 0:
                    inflate = this.ezi.inflate(2130968648, null);
                    break;
                case 1:
                    inflate = this.ezi.inflate(2130968649, null);
                    break;
                default:
                    IllegalArgumentException illegalArgumentException = new IllegalArgumentException("UNIMPLEMENT TYPE");
                    AppMethodBeat.o(125478);
                    throw illegalArgumentException;
            }
            regByMobileWaitingSMSUI$b.gHg = (TextView) inflate.findViewById(2131821103);
            regByMobileWaitingSMSUI$b.gvq = (ImageView) inflate.findViewById(2131821101);
            inflate.setTag(regByMobileWaitingSMSUI$b);
        } else {
            regByMobileWaitingSMSUI$b = (RegByMobileWaitingSMSUI$b) view.getTag();
            inflate = view;
        }
        int intValue = ((Integer) RegByMobileWaitingSMSUI.h(this.gHd).get(i % RegByMobileWaitingSMSUI.h(this.gHd).size())).intValue();
        switch (itemViewType) {
            case 0:
                regByMobileWaitingSMSUI$b.gvq.setImageDrawable((Drawable) RegByMobileWaitingSMSUI.i(this.gHd).get(intValue % RegByMobileWaitingSMSUI.i(this.gHd).size()));
                break;
            case 1:
                regByMobileWaitingSMSUI$b.gvq.setImageDrawable(RegByMobileWaitingSMSUI.j(this.gHd));
                break;
        }
        regByMobileWaitingSMSUI$b.gHg.setText(getItem(i));
        AppMethodBeat.o(125478);
        return inflate;
    }

    public final int getCount() {
        AppMethodBeat.i(125479);
        int size = this.gHf.size();
        AppMethodBeat.o(125479);
        return size;
    }

    private String getItem(int i) {
        AppMethodBeat.i(125480);
        String str = (String) this.gHf.get(i);
        AppMethodBeat.o(125480);
        return str;
    }

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

    public final int getViewTypeCount() {
        return 2;
    }

    public final int getItemViewType(int i) {
        AppMethodBeat.i(125481);
        if (((Integer) RegByMobileWaitingSMSUI.h(this.gHd).get(i % RegByMobileWaitingSMSUI.h(this.gHd).size())).intValue() % 4 == 0) {
            AppMethodBeat.o(125481);
            return 1;
        }
        AppMethodBeat.o(125481);
        return 0;
    }

    public final void wy(String str) {
        AppMethodBeat.i(125482);
        this.gHf.add(str);
        notifyDataSetChanged();
        AppMethodBeat.o(125482);
    }
}
