package defpackage;

import android.R;
import android.app.Dialog;
import android.content.DialogInterface;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Bundle;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.TextView;
import androidx.preference.DialogPreference;

/* renamed from: ːʓᵧﾞ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public abstract class AbstractDialogInterfaceOnClickListenerC1936 extends DialogInterfaceOnCancelListenerC4853 implements DialogInterface.OnClickListener {

    /* renamed from: ʽᵙᵕ, reason: contains not printable characters */
    public CharSequence f7790;

    /* renamed from: ᵛˎ, reason: contains not printable characters */
    public CharSequence f7791;

    /* renamed from: ᵠᵳ, reason: contains not printable characters */
    public CharSequence f7792;

    /* renamed from: ᵤʟᵟ, reason: contains not printable characters */
    public CharSequence f7793;

    /* renamed from: ᵲᵳ, reason: contains not printable characters */
    public int f7794;

    /* renamed from: ᵳʼ, reason: contains not printable characters */
    public BitmapDrawable f7795;

    /* renamed from: ᵷʚᵶᵿ, reason: contains not printable characters */
    public int f7796;

    /* renamed from: ᵺᵫ, reason: contains not printable characters */
    public DialogPreference f7797;

    @Override // android.content.DialogInterface.OnClickListener
    public final void onClick(DialogInterface dialogInterface, int i) {
        this.f7794 = i;
    }

    @Override // defpackage.DialogInterfaceOnCancelListenerC4853, android.content.DialogInterface.OnDismissListener
    public final void onDismiss(DialogInterface dialogInterface) {
        super.onDismiss(dialogInterface);
        mo5448(this.f7794 == -1);
    }

    /* renamed from: ʾᵵᵯ, reason: contains not printable characters */
    public abstract void mo5448(boolean z);

    /* renamed from: ˉʽʾ, reason: contains not printable characters */
    public final DialogPreference m5449() {
        if (this.f7797 == null) {
            Bundle bundle = this.f13769;
            if (bundle == null) {
                C3994.m8822("Fragment ", this, " does not have any arguments.");
                return null;
            }
            this.f7797 = (DialogPreference) ((AbstractC0042) m8327(true)).m1060(bundle.getString("key"));
        }
        return this.f7797;
    }

    /* renamed from: ˉʾˈˊ, reason: contains not printable characters */
    public void mo5450(C5049 c5049) {
    }

    @Override // defpackage.DialogInterfaceOnCancelListenerC4853, defpackage.AbstractComponentCallbacksC3693
    /* renamed from: ˎᵶᵹ */
    public void mo1064(Bundle bundle) {
        super.mo1064(bundle);
        bundle.putCharSequence("PreferenceDialogFragment.title", this.f7791);
        bundle.putCharSequence("PreferenceDialogFragment.positiveText", this.f7793);
        bundle.putCharSequence("PreferenceDialogFragment.negativeText", this.f7790);
        bundle.putCharSequence("PreferenceDialogFragment.message", this.f7792);
        bundle.putInt("PreferenceDialogFragment.layout", this.f7796);
        BitmapDrawable bitmapDrawable = this.f7795;
        if (bitmapDrawable != null) {
            bundle.putParcelable("PreferenceDialogFragment.icon", bitmapDrawable.getBitmap());
        }
    }

    /* renamed from: ᐧʼ, reason: contains not printable characters */
    public void mo5451(View view) {
        int i;
        View viewFindViewById = view.findViewById(R.id.message);
        if (viewFindViewById != null) {
            CharSequence charSequence = this.f7792;
            if (TextUtils.isEmpty(charSequence)) {
                i = 8;
            } else {
                if (viewFindViewById instanceof TextView) {
                    ((TextView) viewFindViewById).setText(charSequence);
                }
                i = 0;
            }
            if (viewFindViewById.getVisibility() != i) {
                viewFindViewById.setVisibility(i);
            }
        }
    }

    @Override // defpackage.DialogInterfaceOnCancelListenerC4853
    /* renamed from: ᵖᵖˊ, reason: contains not printable characters */
    public final Dialog mo5452(Bundle bundle) {
        this.f7794 = -2;
        C5049 title = new C5049(m8292()).setTitle(this.f7791);
        BitmapDrawable bitmapDrawable = this.f7795;
        C0591 c0591 = title.f18871;
        c0591.f2992 = bitmapDrawable;
        c0591.f2990 = this.f7793;
        c0591.f3005 = this;
        c0591.f2993 = this.f7790;
        c0591.f3002 = this;
        m8292();
        int i = this.f7796;
        View viewInflate = null;
        if (i != 0) {
            LayoutInflater layoutInflaterMo8311 = this.f13749;
            if (layoutInflaterMo8311 == null) {
                layoutInflaterMo8311 = mo8311(null);
                this.f13749 = layoutInflaterMo8311;
            }
            viewInflate = layoutInflaterMo8311.inflate(i, (ViewGroup) null);
        }
        if (viewInflate != null) {
            mo5451(viewInflate);
            title.setView(viewInflate);
        } else {
            c0591.f2991 = this.f7792;
        }
        mo5450(title);
        DialogInterfaceC5504 dialogInterfaceC5504Create = title.create();
        if (this instanceof C4923) {
            Window window = dialogInterfaceC5504Create.getWindow();
            if (Build.VERSION.SDK_INT >= 30) {
                AbstractC0300.m1676(window);
                return dialogInterfaceC5504Create;
            }
            C4923 c4923 = (C4923) this;
            c4923.f18317 = SystemClock.currentThreadTimeMillis();
            c4923.m10360();
        }
        return dialogInterfaceC5504Create;
    }

    @Override // defpackage.DialogInterfaceOnCancelListenerC4853, defpackage.AbstractComponentCallbacksC3693
    /* renamed from: ᵺᵜᵰ */
    public void mo1071(Bundle bundle) {
        super.mo1071(bundle);
        AbstractComponentCallbacksC3693 abstractComponentCallbacksC3693M8327 = m8327(true);
        if (!(abstractComponentCallbacksC3693M8327 instanceof AbstractC0042)) {
            ᵹˉᵞ.ᵳٴᵶ("Target fragment must implement TargetFragment interface");
            return;
        }
        AbstractC0042 abstractC0042 = (AbstractC0042) abstractComponentCallbacksC3693M8327;
        Bundle bundle2 = this.f13769;
        if (bundle2 == null) {
            C3994.m8822("Fragment ", this, " does not have any arguments.");
            return;
        }
        String string = bundle2.getString("key");
        if (bundle != null) {
            this.f7791 = bundle.getCharSequence("PreferenceDialogFragment.title");
            this.f7793 = bundle.getCharSequence("PreferenceDialogFragment.positiveText");
            this.f7790 = bundle.getCharSequence("PreferenceDialogFragment.negativeText");
            this.f7792 = bundle.getCharSequence("PreferenceDialogFragment.message");
            this.f7796 = bundle.getInt("PreferenceDialogFragment.layout", 0);
            Bitmap bitmap = (Bitmap) bundle.getParcelable("PreferenceDialogFragment.icon");
            if (bitmap != null) {
                this.f7795 = new BitmapDrawable(m8297(), bitmap);
                return;
            }
            return;
        }
        DialogPreference dialogPreference = (DialogPreference) abstractC0042.m1060(string);
        this.f7797 = dialogPreference;
        this.f7791 = dialogPreference.f725;
        this.f7793 = dialogPreference.f727;
        this.f7790 = dialogPreference.f723;
        this.f7792 = dialogPreference.f726;
        this.f7796 = dialogPreference.f724;
        Drawable drawable = dialogPreference.f728;
        if (drawable == null || (drawable instanceof BitmapDrawable)) {
            this.f7795 = (BitmapDrawable) drawable;
            return;
        }
        Bitmap bitmapCreateBitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(bitmapCreateBitmap);
        drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
        drawable.draw(canvas);
        this.f7795 = new BitmapDrawable(m8297(), bitmapCreateBitmap);
    }
}
