package defpackage;

import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.DrawableWrapper;
import android.graphics.drawable.InsetDrawable;
import android.graphics.drawable.LayerDrawable;
import android.graphics.drawable.RippleDrawable;
import ar.tvplayer.tv.R;
import com.google.android.material.focus.FocusRingDrawable;
import java.lang.ref.WeakReference;

/* JADX INFO: renamed from: ˎːᴵ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C1721 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public InterfaceC5120 f6866;

    /* JADX INFO: renamed from: ˉᵲ, reason: contains not printable characters */
    public boolean f6867;

    /* JADX INFO: renamed from: ˊᵨᵧ, reason: contains not printable characters */
    public RippleDrawable f6869;

    /* JADX INFO: renamed from: ˊᵫᵗ, reason: contains not printable characters */
    public int f6870;

    /* JADX INFO: renamed from: ˋˈ, reason: contains not printable characters */
    public ColorStateList f6871;

    /* JADX INFO: renamed from: ˌᴵ, reason: contains not printable characters */
    public int f6872;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public C5256 f6874;

    /* JADX INFO: renamed from: ᵝᵶ, reason: contains not printable characters */
    public ColorStateList f6875;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public int f6877;

    /* JADX INFO: renamed from: ᵪᵹᵥᵻ, reason: contains not printable characters */
    public C3347 f6878;

    /* JADX INFO: renamed from: ᵮᵣᵗˈ, reason: contains not printable characters */
    public ColorStateList f6879;

    /* JADX INFO: renamed from: ᵱᵽʡᵚ, reason: contains not printable characters */
    public int f6881;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final C1016 f6882;

    /* JADX INFO: renamed from: ᵵᵽ, reason: contains not printable characters */
    public int f6883;

    /* JADX INFO: renamed from: ᵶᵥᵝ, reason: contains not printable characters */
    public PorterDuff.Mode f6884;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public ˈᵚᵰˎ f6885;

    /* JADX INFO: renamed from: ᵻʽᵯ, reason: contains not printable characters */
    public int f6886;

    /* JADX INFO: renamed from: ᵻˈᵦʼ, reason: contains not printable characters */
    public int f6887;

    /* JADX INFO: renamed from: ᵟᵹᵙ, reason: contains not printable characters */
    public boolean f6876 = false;

    /* JADX INFO: renamed from: ᵱʡˏ, reason: contains not printable characters */
    public boolean f6880 = false;

    /* JADX INFO: renamed from: ˊᵙᵾᵲ, reason: contains not printable characters */
    public boolean f6868 = false;

    /* JADX INFO: renamed from: ˏːˆ, reason: contains not printable characters */
    public boolean f6873 = true;

    public C1721(C1016 c1016, InterfaceC5120 interfaceC5120) {
        this.f6882 = c1016;
        this.f6866 = interfaceC5120;
    }

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final void m4761(int i, int i2, int i3, int i4) {
        C1016 c1016 = this.f6882;
        int paddingStart = c1016.getPaddingStart();
        int paddingTop = c1016.getPaddingTop();
        int paddingEnd = c1016.getPaddingEnd();
        int paddingBottom = c1016.getPaddingBottom();
        int i5 = this.f6877;
        int i6 = this.f6883;
        int i7 = this.f6887;
        int i8 = this.f6870;
        this.f6877 = i;
        this.f6883 = i2;
        this.f6887 = i3;
        this.f6870 = i4;
        if (!this.f6880) {
            m4762();
        }
        c1016.setPaddingRelative((paddingStart + i) - i5, (paddingTop + i2) - i6, (paddingEnd + i3) - i7, (paddingBottom + i4) - i8);
    }

    /* JADX WARN: Removed duplicated region for block: B:41:0x010b  */
    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m4762() {
        FocusRingDrawable focusRingDrawable;
        C3347 c3347 = new C3347(this.f6866);
        C5256 c5256 = this.f6874;
        if (c5256 != null) {
            c3347.m7685(c5256);
        }
        ˈᵚᵰˎ r1 = this.f6885;
        if (r1 != null) {
            c3347.f12823 = r1;
        }
        C1016 c1016 = this.f6882;
        Context context = c1016.getContext();
        c3347.f12842.f16502 = new C2098(context);
        c3347.m7683();
        c3347.setTintList(this.f6879);
        PorterDuff.Mode mode = this.f6884;
        if (mode != null) {
            c3347.setTintMode(mode);
        }
        float f = this.f6881;
        ColorStateList colorStateList = this.f6875;
        c3347.f12842.f16511 = f;
        c3347.invalidateSelf();
        C4335 c4335 = c3347.f12842;
        if (c4335.f16515 != colorStateList) {
            c4335.f16515 = colorStateList;
            c3347.onStateChange(c3347.getState());
        }
        C3347 c33472 = new C3347(this.f6866);
        C5256 c52562 = this.f6874;
        if (c52562 != null) {
            c33472.m7685(c52562);
        }
        c33472.setTint(0);
        float f2 = this.f6881;
        int i = this.f6876 ? ᵲᵧˇ.ᵶᵥᵝ(c1016, R.attr.h) : 0;
        c33472.f12842.f16511 = f2;
        c33472.invalidateSelf();
        ColorStateList colorStateListValueOf = ColorStateList.valueOf(i);
        C4335 c43352 = c33472.f12842;
        if (c43352.f16515 != colorStateListValueOf) {
            c43352.f16515 = colorStateListValueOf;
            c33472.onStateChange(c33472.getState());
        }
        C3347 c33473 = new C3347(this.f6866);
        this.f6878 = c33473;
        C5256 c52563 = this.f6874;
        if (c52563 != null) {
            c33473.m7685(c52563);
        }
        this.f6878.setTint(-1);
        RippleDrawable rippleDrawable = new RippleDrawable(ᵣˉ.ˀᵭ(this.f6871), new InsetDrawable((Drawable) new LayerDrawable(new Drawable[]{c33472, c3347}), this.f6877, this.f6883, this.f6887, this.f6870), this.f6878);
        this.f6869 = rippleDrawable;
        FocusRingDrawable.m823(context, rippleDrawable);
        c1016.setInternalBackground(this.f6869);
        C3347 c3347M4764 = m4764(false);
        if (c3347M4764 != null) {
            float f3 = this.f6872;
            C4335 c43353 = c3347M4764.f12842;
            if (c43353.f16506 != f3) {
                c43353.f16506 = f3;
                c3347M4764.m7683();
            }
            c3347M4764.setState(c1016.getDrawableState());
        }
        Drawable background = c1016.getBackground();
        if (background instanceof FocusRingDrawable) {
            focusRingDrawable = (FocusRingDrawable) background;
        } else if (background instanceof DrawableWrapper) {
            Drawable drawable = ((DrawableWrapper) background).getDrawable();
            if (drawable instanceof FocusRingDrawable) {
                focusRingDrawable = (FocusRingDrawable) drawable;
            } else if (background instanceof LayerDrawable) {
                LayerDrawable layerDrawable = (LayerDrawable) background;
                for (int i2 = 0; i2 < layerDrawable.getNumberOfLayers(); i2++) {
                    Drawable drawable2 = layerDrawable.getDrawable(i2);
                    if (drawable2 instanceof FocusRingDrawable) {
                        focusRingDrawable = (FocusRingDrawable) drawable2;
                        break;
                    }
                }
                focusRingDrawable = null;
            } else {
                focusRingDrawable = null;
            }
        }
        if (focusRingDrawable != null) {
            focusRingDrawable.f1057 = new WeakReference(c3347M4764);
        }
    }

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final void m4763() {
        C3347 c3347M4764 = m4764(false);
        C3347 c3347M47642 = m4764(true);
        if (c3347M4764 != null) {
            float f = this.f6881;
            ColorStateList colorStateList = this.f6875;
            c3347M4764.f12842.f16511 = f;
            c3347M4764.invalidateSelf();
            C4335 c4335 = c3347M4764.f12842;
            if (c4335.f16515 != colorStateList) {
                c4335.f16515 = colorStateList;
                c3347M4764.onStateChange(c3347M4764.getState());
            }
            if (c3347M47642 != null) {
                float f2 = this.f6881;
                int i = this.f6876 ? ᵲᵧˇ.ᵶᵥᵝ(this.f6882, R.attr.h) : 0;
                c3347M47642.f12842.f16511 = f2;
                c3347M47642.invalidateSelf();
                ColorStateList colorStateListValueOf = ColorStateList.valueOf(i);
                C4335 c43352 = c3347M47642.f12842;
                if (c43352.f16515 != colorStateListValueOf) {
                    c43352.f16515 = colorStateListValueOf;
                    c3347M47642.onStateChange(c3347M47642.getState());
                }
            }
        }
    }

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final C3347 m4764(boolean z) {
        RippleDrawable rippleDrawable = this.f6869;
        if (rippleDrawable == null || rippleDrawable.getNumberOfLayers() <= 0) {
            return null;
        }
        return (C3347) ((LayerDrawable) ((InsetDrawable) this.f6869.getDrawable(0)).getDrawable()).getDrawable(!z ? 1 : 0);
    }

    /* JADX WARN: Removed duplicated region for block: B:17:0x0038  */
    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
    */
    public final void m4765() {
        InterfaceC0411 interfaceC0411;
        C3347 c3347M4764 = m4764(false);
        if (c3347M4764 != null) {
            c3347M4764.m7688(this.f6866);
            C5256 c5256 = this.f6874;
            if (c5256 != null) {
                c3347M4764.m7685(c5256);
            }
        }
        C3347 c3347M47642 = m4764(true);
        if (c3347M47642 != null) {
            c3347M47642.m7688(this.f6866);
            C5256 c52562 = this.f6874;
            if (c52562 != null) {
                c3347M47642.m7685(c52562);
            }
        }
        RippleDrawable rippleDrawable = this.f6869;
        if (rippleDrawable != null) {
            Object objFindDrawableByLayerId = rippleDrawable.findDrawableByLayerId(android.R.id.mask);
            interfaceC0411 = objFindDrawableByLayerId instanceof InterfaceC0411 ? (InterfaceC0411) objFindDrawableByLayerId : null;
        }
        if (interfaceC0411 != null) {
            boolean z = interfaceC0411 instanceof C3347;
            InterfaceC5120 interfaceC5120 = this.f6866;
            if (!z) {
                interfaceC0411.setShapeAppearanceModel(interfaceC5120.mo5171());
                return;
            }
            C3347 c3347 = (C3347) interfaceC0411;
            c3347.m7688(interfaceC5120);
            C5256 c52563 = this.f6874;
            if (c52563 != null) {
                c3347.m7685(c52563);
            }
        }
    }
}
