package IMuAHx_6.QxJ9d_1.KQgRr5e_0.PGPF6hQ_2;

import android.content.Context;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView;
import com.FDJAfGbVdJFkP.fpOujAROks.R;
import com.webh5app.utils.IconFontUtils;
import com.webh5app.wrap.config.ButtonItem;
import java.util.List;
/* compiled from: DownListAdapter.java */
/* loaded from: classes.dex */
public class KQgRr5e_0 extends RecyclerView.IMuAHx_6 {
    public int KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public IMuAHx_6.QxJ9d_1.KQgRr5e_0.PGPF6hQ_2.QxJ9d_1 f300KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public Context f301KQgRr5e_0;

    /* renamed from: KQgRr5e_0  reason: collision with other field name */
    public List<ButtonItem> f302KQgRr5e_0;
    public int QxJ9d_1;

    /* compiled from: DownListAdapter.java */
    /* renamed from: IMuAHx_6.QxJ9d_1.KQgRr5e_0.PGPF6hQ_2.KQgRr5e_0$KQgRr5e_0  reason: collision with other inner class name */
    /* loaded from: classes.dex */
    public class View$OnClickListenerC0022KQgRr5e_0 implements View.OnClickListener {

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final /* synthetic */ RecyclerView.WGk6X_27 f303KQgRr5e_0;

        public View$OnClickListenerC0022KQgRr5e_0(RecyclerView.WGk6X_27 wGk6X_27) {
            this.f303KQgRr5e_0 = wGk6X_27;
        }

        @Override // android.view.View.OnClickListener
        public void onClick(View view) {
            KQgRr5e_0.this.f300KQgRr5e_0.KQgRr5e_0(this.f303KQgRr5e_0.itemView, this.f303KQgRr5e_0.getLayoutPosition());
        }
    }

    /* compiled from: DownListAdapter.java */
    /* loaded from: classes.dex */
    public class PGPF6hQ_2 extends RecyclerView.WGk6X_27 {
        public View KQgRr5e_0;

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public TextView f304KQgRr5e_0;
        public TextView QxJ9d_1;

        public PGPF6hQ_2(KQgRr5e_0 kQgRr5e_0, View view) {
            super(view);
            this.f304KQgRr5e_0 = (TextView) view.findViewById(R.id.downlist_itemtext);
            this.QxJ9d_1 = (TextView) view.findViewById(R.id.downlist_itemicon);
            this.KQgRr5e_0 = view.findViewById(R.id.downlist_divider);
        }
    }

    /* compiled from: DownListAdapter.java */
    /* loaded from: classes.dex */
    public class QxJ9d_1 implements View.OnLongClickListener {

        /* renamed from: KQgRr5e_0  reason: collision with other field name */
        public final /* synthetic */ RecyclerView.WGk6X_27 f305KQgRr5e_0;

        public QxJ9d_1(RecyclerView.WGk6X_27 wGk6X_27) {
            this.f305KQgRr5e_0 = wGk6X_27;
        }

        @Override // android.view.View.OnLongClickListener
        public boolean onLongClick(View view) {
            KQgRr5e_0.this.f300KQgRr5e_0.QxJ9d_1(this.f305KQgRr5e_0.itemView, this.f305KQgRr5e_0.getLayoutPosition());
            return false;
        }
    }

    public KQgRr5e_0(Context context, List<ButtonItem> list, int i, int i2) {
        this.f301KQgRr5e_0 = context;
        this.KQgRr5e_0 = i;
        this.QxJ9d_1 = i2;
        this.f302KQgRr5e_0 = list;
    }

    @Override // androidx.recyclerview.widget.RecyclerView.IMuAHx_6
    public int getItemCount() {
        return this.f302KQgRr5e_0.size();
    }

    @Override // androidx.recyclerview.widget.RecyclerView.IMuAHx_6
    public void onBindViewHolder(RecyclerView.WGk6X_27 wGk6X_27, int i) {
        ButtonItem buttonItem = this.f302KQgRr5e_0.get(i);
        PGPF6hQ_2 pGPF6hQ_2 = (PGPF6hQ_2) wGk6X_27;
        pGPF6hQ_2.f304KQgRr5e_0.setText(buttonItem.label);
        pGPF6hQ_2.QxJ9d_1.setText(Html.fromHtml(IconFontUtils.getFontString(buttonItem.icon)));
        pGPF6hQ_2.f304KQgRr5e_0.setTextColor(this.KQgRr5e_0);
        pGPF6hQ_2.QxJ9d_1.setTextColor(this.KQgRr5e_0);
        pGPF6hQ_2.KQgRr5e_0.setBackgroundColor(this.QxJ9d_1);
        if (i == this.f302KQgRr5e_0.size() - 1) {
            pGPF6hQ_2.KQgRr5e_0.setVisibility(4);
        }
        if (this.f300KQgRr5e_0 != null) {
            wGk6X_27.itemView.setOnClickListener(new View$OnClickListenerC0022KQgRr5e_0(wGk6X_27));
            wGk6X_27.itemView.setOnLongClickListener(new QxJ9d_1(wGk6X_27));
        }
    }

    @Override // androidx.recyclerview.widget.RecyclerView.IMuAHx_6
    public RecyclerView.WGk6X_27 onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new PGPF6hQ_2(this, LayoutInflater.from(this.f301KQgRr5e_0).inflate(R.layout.downlist_item, viewGroup, false));
    }

    public void KQgRr5e_0(IMuAHx_6.QxJ9d_1.KQgRr5e_0.PGPF6hQ_2.QxJ9d_1 qxJ9d_1) {
        this.f300KQgRr5e_0 = qxJ9d_1;
    }
}
