package xyz.netfly.ui.live.tablet;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Nullable;
import f.a;
import ie.k5;
import org.drive_hunter.R;
import te.b;
import xyz.stream.utils.e;
import xyz.stream.utils.h;
import xyz.stream.view.UiUtils;

/* JADX INFO: loaded from: classes3.dex */
public class CustomLivePadControl extends FrameLayout {

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

    public CustomLivePadControl(Context context) {
        this(context, null);
    }

    public final void a() {
        k5 k5Var = this.f35446a;
        k5Var.f27151g.setVisibility(8);
        k5Var.f27158n.setVisibility(8);
        k5Var.f27150f.animate().cancel();
        k5Var.f27149e.animate().cancel();
        k5Var.f27150f.post(new b(this, 0));
        k5Var.f27149e.post(new b(this, 1));
    }

    public final void b() {
        k5 k5Var = this.f35446a;
        k5Var.f27150f.animate().cancel();
        k5Var.f27149e.animate().cancel();
        k5Var.f27151g.setVisibility(0);
        k5Var.f27158n.setVisibility(0);
        k5Var.f27150f.post(new b(this, 2));
        k5Var.f27149e.post(new b(this, 3));
    }

    public LinearLayout getBtnAudio() {
        return this.f35446a.f27152h;
    }

    public LinearLayout getBtnEpg() {
        return this.f35446a.f27154j;
    }

    public ImageView getBtnFeedback() {
        return this.f35446a.f27147c;
    }

    public LinearLayout getBtnLike() {
        return this.f35446a.f27155k;
    }

    public LinearLayout getBtnMenu() {
        return this.f35446a.f27153i;
    }

    public ImageView getBtnNext() {
        return this.f35446a.f27149e;
    }

    public ImageView getBtnPreview() {
        return this.f35446a.f27150f;
    }

    public LinearLayout getBtnQuality() {
        return this.f35446a.f27156l;
    }

    public LinearLayout getBtnSubtitle() {
        return this.f35446a.f27157m;
    }

    public ImageView getIvBack() {
        return this.f35446a.f27146b;
    }

    public LinearLayout getRatio() {
        return this.f35446a.f27159o;
    }

    public TextView getRatioText() {
        return this.f35446a.f27164t;
    }

    public void setAudioText(String str) {
        if (str == null || str.isEmpty()) {
            return;
        }
        this.f35446a.f27160p.setText(str);
    }

    public void setData(String str, String str2, boolean z10) {
        k5 k5Var = this.f35446a;
        try {
            k5Var.f27148d.setImageDrawable(z10 ? a.getDrawable(getContext(), R.drawable.like) : a.getDrawable(getContext(), R.drawable.like_no));
            k5Var.f27161q.setText(str);
        } catch (Exception e10) {
            h.c(e10.getMessage());
        }
    }

    public void setLiked(boolean z10) {
        Context context;
        int i10;
        ImageView imageView = this.f35446a.f27148d;
        if (z10) {
            context = getContext();
            i10 = R.drawable.like;
        } else {
            context = getContext();
            i10 = R.drawable.like_no;
        }
        imageView.setImageDrawable(a.getDrawable(context, i10));
    }

    public void setQualityText(String str) {
        if (str == null || str.isEmpty()) {
            return;
        }
        this.f35446a.f27162r.setText(str);
    }

    public void setSubtitleText(String str) {
        if (str == null || str.isEmpty()) {
            return;
        }
        this.f35446a.f27163s.setText(str);
    }

    public CustomLivePadControl(Context context, @Nullable AttributeSet attributeSet) {
        this(context, attributeSet, 0);
    }

    public CustomLivePadControl(Context context, @Nullable AttributeSet attributeSet, int i10) {
        super(context, attributeSet, i10);
        k5 k5VarInflate = k5.inflate(LayoutInflater.from(context), this, true);
        this.f35446a = k5VarInflate;
        k5VarInflate.f27151g.setVisibility(4);
        k5VarInflate.f27158n.setVisibility(4);
        ImageView imageView = k5VarInflate.f27150f;
        imageView.setVisibility(4);
        ImageView imageView2 = k5VarInflate.f27149e;
        imageView2.setVisibility(4);
        e.d().getClass();
        if (e.e().contains("ar")) {
            k5VarInflate.f27146b.setScaleX(-1.0f);
            imageView2.setScaleX(-1.0f);
            imageView.setScaleX(-1.0f);
        }
        UiUtils.setUnFocusable(getBtnLike());
        UiUtils.setUnFocusable(getBtnAudio());
        UiUtils.setUnFocusable(getBtnQuality());
        UiUtils.setUnFocusable(getBtnEpg());
        UiUtils.setUnFocusable(getBtnSubtitle());
        UiUtils.setUnFocusable(getBtnMenu());
        UiUtils.setUnFocusable(getRatio());
        getBtnMenu().setVisibility(0);
        getRatio().setVisibility(0);
    }
}
