package p037.p041.p049.p050;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import androidx.appcompat.view.menu.ListMenuItemView;
import java.util.ArrayList;
import p037.p041.p049.p050.InterfaceC1589;

/* JADX INFO: renamed from: މ.ؠ.ލ.ކ.ރ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public class C1571 extends BaseAdapter {

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public C1572 f5070;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public int f5071 = -1;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public boolean f5072;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public final boolean f5073;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public final LayoutInflater f5074;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public final int f5075;

    public C1571(C1572 c1572, LayoutInflater layoutInflater, boolean z, int i) {
        this.f5073 = z;
        this.f5074 = layoutInflater;
        this.f5070 = c1572;
        this.f5075 = i;
        m3083();
    }

    @Override // android.widget.Adapter
    public int getCount() {
        ArrayList<C1576> arrayListM3103;
        if (this.f5073) {
            C1572 c1572 = this.f5070;
            c1572.m3086();
            arrayListM3103 = c1572.f5086;
        } else {
            arrayListM3103 = this.f5070.m3103();
        }
        return this.f5071 < 0 ? arrayListM3103.size() : arrayListM3103.size() - 1;
    }

    @Override // android.widget.Adapter
    public C1576 getItem(int i) {
        ArrayList<C1576> arrayListM3103;
        if (this.f5073) {
            C1572 c1572 = this.f5070;
            c1572.m3086();
            arrayListM3103 = c1572.f5086;
        } else {
            arrayListM3103 = this.f5070.m3103();
        }
        int i2 = this.f5071;
        if (i2 >= 0 && i >= i2) {
            i++;
        }
        return arrayListM3103.get(i);
    }

    @Override // android.widget.Adapter
    public long getItemId(int i) {
        return i;
    }

    @Override // android.widget.Adapter
    public View getView(int i, View view, ViewGroup viewGroup) {
        if (view == null) {
            view = this.f5074.inflate(this.f5075, viewGroup, false);
        }
        int i2 = getItem(i).f5106;
        int i3 = i - 1;
        ListMenuItemView listMenuItemView = (ListMenuItemView) view;
        listMenuItemView.setGroupDividerEnabled(this.f5070.mo3104() && i2 != (i3 >= 0 ? getItem(i3).f5106 : i2));
        InterfaceC1589.InterfaceC1590 interfaceC1590 = (InterfaceC1589.InterfaceC1590) view;
        if (this.f5072) {
            listMenuItemView.setForceShowIcon(true);
        }
        interfaceC1590.mo103(getItem(i), 0);
        return view;
    }

    @Override // android.widget.BaseAdapter
    public void notifyDataSetChanged() {
        m3083();
        super.notifyDataSetChanged();
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public void m3083() {
        C1572 c1572 = this.f5070;
        C1576 c1576 = c1572.f5099;
        if (c1576 != null) {
            c1572.m3086();
            ArrayList<C1576> arrayList = c1572.f5086;
            int size = arrayList.size();
            for (int i = 0; i < size; i++) {
                if (arrayList.get(i) == c1576) {
                    this.f5071 = i;
                    return;
                }
            }
        }
        this.f5071 = -1;
    }
}
