package of;

import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import ie.l2;
import org.drive_hunter.R;
import xyz.stream.api.entity.LiveChannelEntity;
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 a extends SingleTypeAdapter {
    public static void e(a aVar, int i10, l2 l2Var, View view, boolean z10) {
        if (!z10) {
            aVar.getClass();
            TextView textView = l2Var.f27175c;
            Activity activity = aVar.context;
            Object obj = g0.d.f26125a;
            textView.setTextColor(activity.getColor(R.color.white));
            return;
        }
        OnItemListener onItemListener = aVar.onItemListener;
        if (onItemListener != null) {
            onItemListener.onItemFocus(view, i10);
        }
        TextView textView2 = l2Var.f27175c;
        Activity activity2 = aVar.context;
        Object obj2 = g0.d.f26125a;
        textView2.setTextColor(activity2.getColor(R.color.main_text));
    }

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

    @Override // xyz.stream.view.SingleTypeAdapter
    public final void onBindData(v3.a aVar, Object obj, int i10) {
        l2 l2Var = (l2) aVar;
        LiveChannelEntity liveChannelEntity = (LiveChannelEntity) obj;
        l2Var.f27175c.setText(liveChannelEntity.getName());
        l2Var.f27173a.setOnFocusChangeListener(new oe.h(this, i10, l2Var, 23));
        String logo = liveChannelEntity.getLogo();
        CustomImageView customImageView = l2Var.f27174b;
        if (logo == null || liveChannelEntity.getLogo().isEmpty()) {
            customImageView.clearImage();
        } else {
            customImageView.load(CustomImageView.Request.raw(liveChannelEntity.getLogo()).radius(UiUtils.dp2px(12.0f)).size(UiUtils.dp2px(120.0f), UiUtils.dp2px(120.0f)).scaleType(ImageView.ScaleType.FIT_CENTER));
        }
    }
}
