package D1;

import N1.C0203d0;
import N1.T;
import N1.t0;
import android.graphics.drawable.Drawable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.martsnew.tv.R;

/* JADX INFO: renamed from: D1.n, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0089n extends T {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final String[] f1749d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final String[] f1750e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public final Drawable[] f1751f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public final /* synthetic */ C0093s f1752g;

    public C0089n(C0093s c0093s, String[] strArr, Drawable[] drawableArr) {
        this.f1752g = c0093s;
        this.f1749d = strArr;
        this.f1750e = new String[strArr.length];
        this.f1751f = drawableArr;
    }

    @Override // N1.T
    public final int a() {
        return this.f1749d.length;
    }

    @Override // N1.T
    public final long b(int i) {
        return i;
    }

    @Override // N1.T
    public final void f(t0 t0Var, int i) {
        C0088m c0088m = (C0088m) t0Var;
        boolean zN = n(i);
        View view = c0088m.f4654a;
        if (zN) {
            view.setLayoutParams(new C0203d0(-1, -2));
        } else {
            view.setLayoutParams(new C0203d0(0, 0));
        }
        c0088m.f1745u.setText(this.f1749d[i]);
        String str = this.f1750e[i];
        TextView textView = c0088m.f1746v;
        if (str == null) {
            textView.setVisibility(8);
        } else {
            textView.setText(str);
        }
        Drawable drawable = this.f1751f[i];
        ImageView imageView = c0088m.f1747w;
        if (drawable == null) {
            imageView.setVisibility(8);
        } else {
            imageView.setImageDrawable(drawable);
        }
    }

    @Override // N1.T
    public final t0 h(ViewGroup viewGroup, int i) {
        C0093s c0093s = this.f1752g;
        return new C0088m(c0093s, LayoutInflater.from(c0093s.getContext()).inflate(R.layout.exo_styled_settings_list_item, viewGroup, false));
    }

    public final boolean n(int i) {
        C0093s c0093s = this.f1752g;
        u0.M m8 = c0093s.f1832z0;
        if (m8 == null) {
            return false;
        }
        if (i == 0) {
            return ((O3.e) m8).o(13);
        }
        if (i != 1) {
            return true;
        }
        return ((O3.e) m8).o(30) && ((O3.e) c0093s.f1832z0).o(29);
    }
}
