package jf;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import android.widget.ImageView;
import ie.d3;
import kotlinx.coroutines.y;
import org.drive_hunter.R;
import xyz.stream.api.entity.LiveChannelEntity;
import xyz.stream.api.q;
import xyz.stream.view.CustomImageView;
import xyz.stream.view.OnItemListener;
import xyz.stream.view.SingleTypeAdapter;
import xyz.stream.view.UiUtils;

/* JADX INFO: loaded from: classes3.dex */
public final class i extends SingleTypeAdapter {
    public static void e(i iVar, LiveChannelEntity liveChannelEntity, d3 d3Var, int i10) {
        OnItemListener onItemListener;
        iVar.getClass();
        if (liveChannelEntity == null || liveChannelEntity.getId() == null || (onItemListener = iVar.onItemListener) == null) {
            return;
        }
        onItemListener.onItemClick(d3Var.f26756a, i10);
    }

    public static void f(i iVar, d3 d3Var, int i10, boolean z10) {
        if (z10) {
            OnItemListener onItemListener = iVar.onItemListener;
            if (onItemListener != null) {
                onItemListener.onItemFocus(d3Var.f26756a, i10);
            }
            d3Var.f26757b.setBackgroundResource(R.drawable.shape_radius_white_4_12);
            y.k0(1.07f, d3Var.f26756a);
            d3Var.f26758c.setSelected(true);
            return;
        }
        iVar.getClass();
        CustomImageView customImageView = d3Var.f26757b;
        Activity activity = iVar.context;
        Object obj = g0.d.f26125a;
        customImageView.setBackgroundColor(activity.getColor(R.color.transparent));
        y.l0(d3Var.f26756a);
        d3Var.f26758c.setSelected(false);
    }

    @Override // xyz.stream.view.SingleTypeAdapter
    public final v3.a createBinding(ViewGroup viewGroup) {
        return d3.inflate(LayoutInflater.from(this.context), viewGroup, false);
    }

    @Override // xyz.stream.view.SingleTypeAdapter
    public final void onBindData(v3.a aVar, Object obj, int i10) {
        d3 d3Var = (d3) aVar;
        LiveChannelEntity liveChannelEntity = (LiveChannelEntity) obj;
        if (liveChannelEntity == null || liveChannelEntity.getId() == null) {
            d3Var.f26757b.setShimmerImage();
        } else {
            d3Var.f26758c.setText(liveChannelEntity.getName() != null ? liveChannelEntity.getName() : "");
            q qVarG = q.g();
            String strReplace = liveChannelEntity.getLogo().replace("http://", "https://");
            qVarG.getClass();
            d3Var.f26757b.load(CustomImageView.Request.image(q.f(strReplace)).radius(UiUtils.dp2px(12.0f)).size(UiUtils.dp2px(250.0f), UiUtils.dp2px(250.0f)).scaleType(ImageView.ScaleType.FIT_CENTER));
        }
        d3Var.f26756a.setOnFocusChangeListener(new oe.h(this, d3Var, i10, 16));
        d3Var.f26756a.setOnClickListener(new h(i10, 0, this, liveChannelEntity, d3Var));
    }
}
