package androidx.leanback.widget;

import android.graphics.Paint;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.martsnew.tv.R;
import d5.AbstractC0844a;

/* JADX INFO: renamed from: androidx.leanback.widget.f0, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0464f0 extends Y {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final int f8640a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final Paint f8641b = new Paint(1);

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public boolean f8642c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final boolean f8643d;

    public C0464f0(int i, boolean z8) {
        this.f8640a = i;
        this.f8643d = z8;
    }

    @Override // androidx.leanback.widget.Y
    public final void c(X x8, Object obj) {
        B3.f fVar = obj == null ? null : ((AbstractC0458c0) obj).f8632b;
        C0462e0 c0462e0 = (C0462e0) x8;
        if (fVar == null) {
            RowHeaderView rowHeaderView = c0462e0.f8638c;
            if (rowHeaderView != null) {
                rowHeaderView.setText((CharSequence) null);
            }
            TextView textView = c0462e0.f8639d;
            if (textView != null) {
                textView.setText((CharSequence) null);
            }
            x8.f8620a.setContentDescription(null);
            if (this.f8642c) {
                x8.f8620a.setVisibility(8);
                return;
            }
            return;
        }
        RowHeaderView rowHeaderView2 = c0462e0.f8638c;
        if (rowHeaderView2 != null) {
            rowHeaderView2.setText(fVar.f975b);
        }
        TextView textView2 = c0462e0.f8639d;
        if (textView2 != null) {
            if (TextUtils.isEmpty(null)) {
                textView2.setVisibility(8);
            } else {
                textView2.setVisibility(0);
            }
            textView2.setText((CharSequence) null);
        }
        x8.f8620a.setContentDescription(null);
        x8.f8620a.setVisibility(0);
    }

    @Override // androidx.leanback.widget.Y
    public final X d(ViewGroup viewGroup) {
        View viewInflate = LayoutInflater.from(viewGroup.getContext()).inflate(this.f8640a, viewGroup, false);
        C0462e0 c0462e0 = new C0462e0(viewInflate);
        RowHeaderView rowHeaderView = (RowHeaderView) viewInflate.findViewById(R.id.row_header);
        c0462e0.f8638c = rowHeaderView;
        c0462e0.f8639d = (TextView) viewInflate.findViewById(R.id.row_header_description);
        if (rowHeaderView != null) {
            rowHeaderView.getCurrentTextColor();
        }
        c0462e0.f8637b = viewInflate.getResources().getFraction(R.fraction.lb_browse_header_unselect_alpha, 1, 1);
        if (this.f8643d) {
            h(c0462e0, 0.0f);
        }
        return c0462e0;
    }

    @Override // androidx.leanback.widget.Y
    public final void e(X x8) {
        C0462e0 c0462e0 = (C0462e0) x8;
        RowHeaderView rowHeaderView = c0462e0.f8638c;
        if (rowHeaderView != null) {
            rowHeaderView.setText((CharSequence) null);
        }
        TextView textView = c0462e0.f8639d;
        if (textView != null) {
            textView.setText((CharSequence) null);
        }
        if (this.f8643d) {
            h(c0462e0, 0.0f);
        }
    }

    public final void h(C0462e0 c0462e0, float f3) {
        c0462e0.getClass();
        if (this.f8643d) {
            float f7 = c0462e0.f8637b;
            c0462e0.f8620a.setAlpha(AbstractC0844a.f(1.0f, f7, f3, f7));
        }
    }
}
