package epson.print.widgets;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AlphabetIndexer;
import android.widget.TextView;
import com.epson.mobilephone.common.escpr.MediaInfo;
import epson.print.R;
import epson.print.widgets.CommonDataKinds;
import java.util.Vector;

public class PrinterInfoDetailBuilder extends AbstractListBuilder {
    private static final int ACTIVE = 1;
    private static final int NAME = 0;
    int curValue = -1;
    private MediaInfo.AbstractInfo mLookupTable;

    public void addPrinter(String[] strArr) {
    }

    public AlphabetIndexer getIndexer() {
        return null;
    }

    protected void notifyDataChange() {
    }

    public PrinterInfoDetailBuilder(Context context, ViewGroup viewGroup) {
        super(context, viewGroup);
    }

    protected void buildData() {
        this.mData.clear();
    }

    public View buildViewHolder() {
        return this.mLayoutInflater.inflate(R.layout.printer_info_detail_item, (ViewGroup) null);
    }

    public Vector<View> buildViewHolderContent(View view) {
        Vector<View> vector = new Vector<>();
        vector.add(view.findViewById(R.id.name));
        vector.add(view.findViewById(R.id.active_icon));
        return vector;
    }

    public void buildViewHolderContentData(int i, Vector<View> vector, Vector<Object> vector2) {
        int value = ((CommonDataKinds.PrinterInfo) vector2.elementAt(i)).getValue();
        int stringId = this.mLookupTable.getStringId(value);
        int i2 = 0;
        if (stringId != -1) {
            ((TextView) vector.elementAt(0)).setText(this.mContext.getString(stringId));
        }
        View elementAt = vector.elementAt(1);
        if (value != this.curValue) {
            i2 = 8;
        }
        elementAt.setVisibility(i2);
    }

    public void setResource(Object obj) {
        this.curValue = ((Integer) obj).intValue();
    }

    public void addPrinterInfo(int[] iArr, MediaInfo.AbstractInfo abstractInfo) {
        this.mLookupTable = abstractInfo;
        for (int printerInfo : iArr) {
            this.mData.add(new CommonDataKinds.PrinterInfo(printerInfo));
        }
        this.mAdapter.notifyDataSetChanged();
    }

    public void refresh() {
        buildData();
    }

    public void destructor() {
        super.destructor();
        MediaInfo.AbstractInfo abstractInfo = this.mLookupTable;
        if (abstractInfo != null) {
            abstractInfo.destructor();
        }
    }
}
