package p037.p106;

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.Bundle;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.appcompat.app.AlertController;
import androidx.preference.DialogPreference;
import p037.p041.p042.DialogInterfaceC1489;
import p037.p089.p090.ActivityC1999;
import p037.p089.p090.DialogInterfaceOnCancelListenerC1992;
import p037.p099.InterfaceC2219;

/* JADX INFO: renamed from: މ.ގ.ރ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public abstract class AbstractDialogInterfaceOnClickListenerC2272 extends DialogInterfaceOnCancelListenerC1992 implements DialogInterface.OnClickListener {

    /* JADX INFO: renamed from: ޓ, reason: contains not printable characters */
    public DialogPreference f7234;

    /* JADX INFO: renamed from: ޔ, reason: contains not printable characters */
    public CharSequence f7235;

    /* JADX INFO: renamed from: ޕ, reason: contains not printable characters */
    public CharSequence f7236;

    /* JADX INFO: renamed from: ޖ, reason: contains not printable characters */
    public CharSequence f7237;

    /* JADX INFO: renamed from: ޗ, reason: contains not printable characters */
    public CharSequence f7238;

    /* JADX INFO: renamed from: ޘ, reason: contains not printable characters */
    public int f7239;

    /* JADX INFO: renamed from: ޙ, reason: contains not printable characters */
    public BitmapDrawable f7240;

    /* JADX INFO: renamed from: ޚ, reason: contains not printable characters */
    public int f7241;

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

    @Override // p037.p089.p090.DialogInterfaceOnCancelListenerC1992, androidx.fragment.app.Fragment
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        InterfaceC2219 targetFragment = getTargetFragment();
        if (!(targetFragment instanceof DialogPreference.InterfaceC0149)) {
            throw new IllegalStateException("Target fragment must implement TargetFragment interface");
        }
        DialogPreference.InterfaceC0149 interfaceC0149 = (DialogPreference.InterfaceC0149) targetFragment;
        String string = this.mArguments.getString("key");
        if (bundle != null) {
            this.f7235 = bundle.getCharSequence("PreferenceDialogFragment.title");
            this.f7236 = bundle.getCharSequence("PreferenceDialogFragment.positiveText");
            this.f7237 = bundle.getCharSequence("PreferenceDialogFragment.negativeText");
            this.f7238 = bundle.getCharSequence("PreferenceDialogFragment.message");
            this.f7239 = bundle.getInt("PreferenceDialogFragment.layout", 0);
            Bitmap bitmap = (Bitmap) bundle.getParcelable("PreferenceDialogFragment.icon");
            if (bitmap != null) {
                this.f7240 = new BitmapDrawable(getResources(), bitmap);
                return;
            }
            return;
        }
        DialogPreference dialogPreference = (DialogPreference) interfaceC0149.mo363(string);
        this.f7234 = dialogPreference;
        this.f7235 = dialogPreference.f981;
        this.f7236 = dialogPreference.f984;
        this.f7237 = dialogPreference.f985;
        this.f7238 = dialogPreference.f982;
        this.f7239 = dialogPreference.f986;
        Drawable drawable = dialogPreference.f983;
        if (drawable == null || (drawable instanceof BitmapDrawable)) {
            this.f7240 = (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.f7240 = new BitmapDrawable(getResources(), bitmapCreateBitmap);
    }

    @Override // p037.p089.p090.DialogInterfaceOnCancelListenerC1992, android.content.DialogInterface.OnDismissListener
    public void onDismiss(DialogInterface dialogInterface) {
        super.onDismiss(dialogInterface);
        mo4311(this.f7241 == -1);
    }

    @Override // p037.p089.p090.DialogInterfaceOnCancelListenerC1992, androidx.fragment.app.Fragment
    public void onSaveInstanceState(Bundle bundle) {
        super.onSaveInstanceState(bundle);
        bundle.putCharSequence("PreferenceDialogFragment.title", this.f7235);
        bundle.putCharSequence("PreferenceDialogFragment.positiveText", this.f7236);
        bundle.putCharSequence("PreferenceDialogFragment.negativeText", this.f7237);
        bundle.putCharSequence("PreferenceDialogFragment.message", this.f7238);
        bundle.putInt("PreferenceDialogFragment.layout", this.f7239);
        BitmapDrawable bitmapDrawable = this.f7240;
        if (bitmapDrawable != null) {
            bundle.putParcelable("PreferenceDialogFragment.icon", bitmapDrawable.getBitmap());
        }
    }

    @Override // p037.p089.p090.DialogInterfaceOnCancelListenerC1992
    /* JADX INFO: renamed from: ֏ */
    public Dialog mo1839(Bundle bundle) {
        ActivityC1999 activity = getActivity();
        this.f7241 = -2;
        DialogInterfaceC1489.C1490 c1490 = new DialogInterfaceC1489.C1490(activity);
        CharSequence charSequence = this.f7235;
        AlertController.C0030 c0030 = c1490.f4672;
        c0030.f173 = charSequence;
        c0030.f171 = this.f7240;
        c0030.f176 = this.f7236;
        c0030.f177 = this;
        c0030.f178 = this.f7237;
        c0030.f179 = this;
        int i = this.f7239;
        View viewInflate = null;
        if (i != 0) {
            LayoutInflater layoutInflaterPerformGetLayoutInflater = this.mLayoutInflater;
            if (layoutInflaterPerformGetLayoutInflater == null) {
                layoutInflaterPerformGetLayoutInflater = performGetLayoutInflater(null);
            }
            viewInflate = layoutInflaterPerformGetLayoutInflater.inflate(i, (ViewGroup) null);
        }
        if (viewInflate != null) {
            mo4310(viewInflate);
            AlertController.C0030 c00302 = c1490.f4672;
            c00302.f188 = viewInflate;
            c00302.f187 = 0;
            c00302.f189 = false;
        } else {
            c1490.f4672.f175 = this.f7238;
        }
        mo4314(c1490);
        DialogInterfaceC1489 dialogInterfaceC1489M2816 = c1490.m2816();
        if (mo4312()) {
            dialogInterfaceC1489M2816.getWindow().setSoftInputMode(5);
        }
        return dialogInterfaceC1489M2816;
    }

    /* JADX INFO: renamed from: ֏ */
    public void mo4310(View view) {
        View viewFindViewById = view.findViewById(R.id.message);
        if (viewFindViewById != null) {
            CharSequence charSequence = this.f7238;
            int i = 8;
            if (!TextUtils.isEmpty(charSequence)) {
                if (viewFindViewById instanceof TextView) {
                    ((TextView) viewFindViewById).setText(charSequence);
                }
                i = 0;
            }
            if (viewFindViewById.getVisibility() != i) {
                viewFindViewById.setVisibility(i);
            }
        }
    }

    /* JADX INFO: renamed from: ֏ */
    public void mo4314(DialogInterfaceC1489.C1490 c1490) {
    }

    /* JADX INFO: renamed from: ؠ */
    public abstract void mo4311(boolean z);

    /* JADX INFO: renamed from: މ, reason: contains not printable characters */
    public DialogPreference m4315() {
        if (this.f7234 == null) {
            this.f7234 = (DialogPreference) ((DialogPreference.InterfaceC0149) getTargetFragment()).mo363(this.mArguments.getString("key"));
        }
        return this.f7234;
    }

    /* JADX INFO: renamed from: ފ */
    public boolean mo4312() {
        return false;
    }
}
