package androidx.leanback.widget;

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

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

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

    /* JADX INFO: renamed from: K, reason: collision with root package name */
    public s0 f8593K;

    /* JADX INFO: renamed from: L, reason: collision with root package name */
    public s0 f8594L;

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

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

    public SpeechOrbView(Context context, AttributeSet attributeSet) {
        super(context, attributeSet, 0);
        this.f8595M = 0;
        this.f8596N = false;
        Resources resources = context.getResources();
        this.f8592J = resources.getFraction(R.fraction.lb_search_bar_speech_orb_max_level_zoom, 1, 1);
        this.f8594L = new s0(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.f8593K = new s0(resources.getColor(R.color.lb_speech_orb_recording), resources.getColor(R.color.lb_speech_orb_recording), 0);
        c();
    }

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

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

    public void setListeningOrbColors(s0 s0Var) {
        this.f8593K = s0Var;
    }

    public void setNotListeningOrbColors(s0 s0Var) {
        this.f8594L = s0Var;
    }

    public void setSoundLevel(int i) {
        if (this.f8596N) {
            int i5 = this.f8595M;
            if (i > i5) {
                this.f8595M = ((i - i5) / 2) + i5;
            } else {
                this.f8595M = (int) (i5 * 0.7f);
            }
            float focusedZoom = (((this.f8592J - getFocusedZoom()) * this.f8595M) / 100.0f) + 1.0f;
            View view = this.f8571s;
            view.setScaleX(focusedZoom);
            view.setScaleY(focusedZoom);
        }
    }
}
