package androidx.leanback.widget;

import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.view.View;
import com.debridstream.tv.R;

/* JADX INFO: loaded from: classes.dex */
public class SpeechOrbView extends SearchOrbView {

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public final float f11937v;

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public M f11938w;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    public M f11939x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public int f11940y;

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

    public SpeechOrbView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet, 0);
        this.f11940y = 0;
        this.f11941z = false;
        Resources resources = context.getResources();
        this.f11937v = resources.getFraction(R.fraction.lb_search_bar_speech_orb_max_level_zoom, 1, 1);
        this.f11939x = new M(resources.getColor(R.color.lb_speech_orb_not_recording), resources.getColor(R.color.lb_speech_orb_not_recording_pulsed), resources.getColor(R.color.lb_speech_orb_not_recording_icon));
        this.f11938w = new M(resources.getColor(R.color.lb_speech_orb_recording), resources.getColor(R.color.lb_speech_orb_recording), 0);
        c();
    }

    public final void c() {
        setOrbColors(this.f11939x);
        setOrbIcon(getResources().getDrawable(R.drawable.lb_ic_search_mic_out));
        a(hasFocus());
        View view = this.f11909c;
        view.setScaleX(1.0f);
        view.setScaleY(1.0f);
        this.f11941z = false;
    }

    @Override // androidx.leanback.widget.SearchOrbView
    public int getLayoutResourceId() {
        return R.layout.lb_speech_orb;
    }

    public void setListeningOrbColors(M m6) {
        this.f11938w = m6;
    }

    public void setNotListeningOrbColors(M m6) {
        this.f11939x = m6;
    }

    public void setSoundLevel(int i6) {
        if (this.f11941z) {
            int i7 = this.f11940y;
            if (i6 > i7) {
                this.f11940y = ((i6 - i7) / 2) + i7;
            } else {
                this.f11940y = (int) (i7 * 0.7f);
            }
            float focusedZoom = (((this.f11937v - getFocusedZoom()) * this.f11940y) / 100.0f) + 1.0f;
            View view = this.f11909c;
            view.setScaleX(focusedZoom);
            view.setScaleY(focusedZoom);
        }
    }
}
