package ඓ.ᕣ.K.K;

import android.app.Dialog;
import android.content.Context;
import android.graphics.Color;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.zyao89.view.zloading.R$id;
import com.zyao89.view.zloading.R$layout;
import com.zyao89.view.zloading.R$style;
import com.zyao89.view.zloading.ZLoadingTextView;
import com.zyao89.view.zloading.ZLoadingView;
import com.zyao89.view.zloading.Z_TYPE;
import java.lang.ref.WeakReference;

/* renamed from: ඓ.ᕣ.K.K.ῲ  reason: contains not printable characters */
/* compiled from: ZLoadingDialog */
public class C0744 {

    /* renamed from: ʬ  reason: contains not printable characters */
    public Z_TYPE f3776;

    /* renamed from: ඓ  reason: contains not printable characters */
    public String f3777;

    /* renamed from: ᕣ  reason: contains not printable characters */
    public int f3778 = -1;

    /* renamed from: ᨨ  reason: contains not printable characters */
    public boolean f3779 = true;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final int f3780;

    /* renamed from: ⁱ  reason: contains not printable characters */
    public int f3781 = -1;

    /* renamed from: K  reason: contains not printable characters */
    public final WeakReference<Context> f3782;

    /* renamed from: 㑃  reason: contains not printable characters */
    public Dialog f3783;

    /* renamed from: 㳳  reason: contains not printable characters */
    public double f3784 = 1.0d;

    /* renamed from: 㴹  reason: contains not printable characters */
    public float f3785 = -1.0f;

    /* renamed from: 㸾  reason: contains not printable characters */
    public int f3786;

    /* renamed from: 㿎  reason: contains not printable characters */
    public boolean f3787 = true;

    public C0744(Context context) {
        int i = R$style.alert_dialog;
        this.f3782 = new WeakReference<>(context);
        this.f3780 = i;
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public void m2183() {
        Drawable background;
        Dialog dialog = this.f3783;
        if (dialog != null) {
            dialog.show();
        } else if (!m2184()) {
            Dialog dialog2 = this.f3783;
            if (dialog2 != null) {
                dialog2.cancel();
                this.f3783 = null;
            }
            this.f3783 = new Dialog(this.f3782.get(), this.f3780);
            if (!m2184()) {
                View inflate = View.inflate(this.f3782.get(), R$layout.z_loading_dialog, null);
                LinearLayout linearLayout = (LinearLayout) inflate.findViewById(R$id.z_loading);
                if (!(this.f3778 == -1 || (background = linearLayout.getBackground()) == null)) {
                    background.setAlpha(Color.alpha(this.f3778));
                    background.setColorFilter(this.f3778, PorterDuff.Mode.SRC_ATOP);
                }
                ZLoadingView zLoadingView = (ZLoadingView) inflate.findViewById(R$id.z_loading_view);
                ZLoadingTextView zLoadingTextView = (ZLoadingTextView) inflate.findViewById(R$id.z_text_view);
                TextView textView = (TextView) inflate.findViewById(R$id.z_custom_text_view);
                if (this.f3785 > 0.0f && !TextUtils.isEmpty(this.f3777)) {
                    textView.setVisibility(0);
                    textView.setText(this.f3777);
                    textView.setTextSize(this.f3785);
                    int i = this.f3781;
                    if (i == -1) {
                        i = this.f3786;
                    }
                    textView.setTextColor(i);
                } else if (!TextUtils.isEmpty(this.f3777)) {
                    zLoadingTextView.setVisibility(0);
                    zLoadingTextView.setText(this.f3777);
                    int i2 = this.f3781;
                    if (i2 == -1) {
                        i2 = this.f3786;
                    }
                    zLoadingTextView.setColorFilter(i2, PorterDuff.Mode.SRC_ATOP);
                }
                zLoadingView.setLoadingBuilder(this.f3776);
                AbstractC0747 k = zLoadingView.f3403;
                if (k != null) {
                    k.m2202(this.f3784);
                }
                zLoadingView.setColorFilter(this.f3786, PorterDuff.Mode.SRC_ATOP);
                this.f3783.setContentView(inflate);
                this.f3783.setCancelable(this.f3787);
                this.f3783.setCanceledOnTouchOutside(this.f3779);
                this.f3783.show();
                return;
            }
            throw new RuntimeException("Context is null...");
        } else {
            throw new RuntimeException("Context is null...");
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public final boolean m2184() {
        return this.f3782.get() == null;
    }

    /* renamed from: K  reason: contains not printable characters */
    public void m2185() {
        Dialog dialog = this.f3783;
        if (dialog != null) {
            dialog.dismiss();
        }
        this.f3783 = null;
    }
}
