package defpackage;

import android.content.Context;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.ViewTreeObserver;
import android.widget.ListAdapter;
import ar.tvplayer.tv.R;

/* renamed from: ˀᵫː, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C0594 extends C3911 implements InterfaceC4377 {

    /* renamed from: ˀˁᵨ, reason: contains not printable characters */
    public final Rect f3007;

    /* renamed from: ˊʾˊ, reason: contains not printable characters */
    public int f3008;

    /* renamed from: ᵫᵮʾ, reason: contains not printable characters */
    public CharSequence f3009;

    /* renamed from: ᵷᵱ, reason: contains not printable characters */
    public final /* synthetic */ C0792 f3010;

    /* renamed from: ᵽʛ, reason: contains not printable characters */
    public C1798 f3011;

    /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
    public C0594(C0792 c0792, Context context, AttributeSet attributeSet) {
        super(context, attributeSet, R.attr._11_res_0x7f0405ba, 0);
        this.f3010 = c0792;
        this.f3007 = new Rect();
        this.f14681 = c0792;
        this.f14665 = true;
        this.f14680.setFocusable(true);
        this.f14662 = new C3627(0, this);
    }

    @Override // defpackage.InterfaceC4377
    /* renamed from: ˇʼʤˎ, reason: contains not printable characters */
    public final CharSequence mo2473() {
        return this.f3009;
    }

    @Override // defpackage.C3911, defpackage.InterfaceC4377
    /* renamed from: ˌʾˀ, reason: contains not printable characters */
    public final void mo2474(ListAdapter listAdapter) {
        super.mo2474(listAdapter);
        this.f3011 = (C1798) listAdapter;
    }

    /* renamed from: ᵞʡ, reason: contains not printable characters */
    public final void m2475() {
        int i;
        C1496 c1496 = this.f14680;
        Drawable background = c1496.getBackground();
        C0792 c0792 = this.f3010;
        Rect rect = c0792.f3701;
        if (background != null) {
            background.getPadding(rect);
            boolean z = AbstractC2335.f9156;
            i = c0792.getLayoutDirection() == 1 ? rect.right : -rect.left;
        } else {
            i = 0;
            rect.right = 0;
            rect.left = 0;
        }
        int paddingLeft = c0792.getPaddingLeft();
        int paddingRight = c0792.getPaddingRight();
        int width = c0792.getWidth();
        int i2 = c0792.f3700;
        if (i2 == -2) {
            int iM2894 = c0792.m2894(this.f3011, c1496.getBackground());
            int i3 = (c0792.getContext().getResources().getDisplayMetrics().widthPixels - rect.left) - rect.right;
            if (iM2894 > i3) {
                iM2894 = i3;
            }
            m8576(Math.max(iM2894, (width - paddingLeft) - paddingRight));
        } else if (i2 == -1) {
            m8576((width - paddingLeft) - paddingRight);
        } else {
            m8576(i2);
        }
        boolean z2 = AbstractC2335.f9156;
        this.f14674 = c0792.getLayoutDirection() == 1 ? (((width - paddingRight) - this.f14676) - this.f3008) + i : paddingLeft + this.f3008 + i;
    }

    @Override // defpackage.InterfaceC4377
    /* renamed from: ᵪʩ, reason: contains not printable characters */
    public final void mo2476(int i, int i2) {
        ViewTreeObserver viewTreeObserver;
        C1496 c1496 = this.f14680;
        boolean zIsShowing = c1496.isShowing();
        m2475();
        c1496.setInputMethodMode(2);
        mo1522();
        C1073 c1073 = this.f14684;
        c1073.setChoiceMode(1);
        c1073.setTextDirection(i);
        c1073.setTextAlignment(i2);
        C0792 c0792 = this.f3010;
        int selectedItemPosition = c0792.getSelectedItemPosition();
        C1073 c10732 = this.f14684;
        if (c1496.isShowing() && c10732 != null) {
            c10732.setListSelectionHidden(false);
            c10732.setSelection(selectedItemPosition);
            if (c10732.getChoiceMode() != 0) {
                c10732.setItemChecked(selectedItemPosition, true);
            }
        }
        if (zIsShowing || (viewTreeObserver = c0792.getViewTreeObserver()) == null) {
            return;
        }
        ViewTreeObserverOnGlobalLayoutListenerC3682 viewTreeObserverOnGlobalLayoutListenerC3682 = new ViewTreeObserverOnGlobalLayoutListenerC3682(1, this);
        viewTreeObserver.addOnGlobalLayoutListener(viewTreeObserverOnGlobalLayoutListenerC3682);
        c1496.setOnDismissListener(new C0211(this, viewTreeObserverOnGlobalLayoutListenerC3682));
    }

    @Override // defpackage.InterfaceC4377
    /* renamed from: ᵯٴᵦ, reason: contains not printable characters */
    public final void mo2477(int i) {
        this.f3008 = i;
    }

    @Override // defpackage.InterfaceC4377
    /* renamed from: ᵹᵝᵶ, reason: contains not printable characters */
    public final void mo2478(CharSequence charSequence) {
        this.f3009 = charSequence;
    }
}
