package com.seewo.factoryaging.a1;

import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Handler;
import android.os.Looper;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.cvte.vman.R;
import com.seewo.factoryaging.human.HumanTestModelView;
import j.p0.d.g0;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.concurrent.TimeUnit;
import okhttp3.HttpUrl;
import org.greenrobot.eventbus.ThreadMode;

/* JADX INFO: compiled from: ContentView.kt */
/* JADX INFO: loaded from: classes.dex */
public final class b0 extends FrameLayout implements d0 {
    private int A;
    private int B;
    private int C;
    private final List<TextView> D;
    private float E;
    private LinearLayout b;
    private LinearLayout d;
    private LinearLayout e;
    private TextView f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private TextView f307g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    private TextView f308h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private TextView f309i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private TextView f310j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    private TextView f311k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    private TextView f312l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    private FrameLayout.LayoutParams f313m;
    private LinearLayout.LayoutParams n;
    private TextView o;
    private c0 p;
    private ArrayList<com.seewo.factoryaging.s0.j> q;
    private TextView r;
    private TextView s;
    private TextView t;
    private boolean u;
    private boolean v;
    private final Handler w;
    private com.seewo.factoryaging.camera811.f x;
    private boolean y;
    private final int z;

    public b0(Context context, androidx.lifecycle.e eVar, AttributeSet attributeSet, int i2) {
        j.p0.d.r.f(context, "context");
        j.p0.d.r.f(eVar, "life");
        new LinkedHashMap();
        super(context, attributeSet, i2);
        this.w = new Handler(Looper.getMainLooper());
        this.x = new com.seewo.factoryaging.camera811.f(context);
        this.z = Color.parseColor("#00FF00");
        this.D = new ArrayList();
        this.E = 50.0f;
        Object systemService = context.getApplicationContext().getSystemService("window");
        if (systemService == null) {
            throw new NullPointerException("null cannot be cast to non-null type android.view.WindowManager");
        }
        DisplayMetrics displayMetrics = new DisplayMetrics();
        ((WindowManager) systemService).getDefaultDisplay().getMetrics(displayMetrics);
        int i3 = displayMetrics.widthPixels;
        this.A = i3;
        this.B = displayMetrics.heightPixels;
        this.C = (int) (i3 / 1.5f);
        Log.d("ContentView", "bannerWidth: " + this.C);
        y(eVar);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void A(b0 b0Var) {
        j.p0.d.r.f(b0Var, "this$0");
        b0Var.o();
        c0 c0Var = b0Var.p;
        if (c0Var != null) {
            c0Var.c();
        } else {
            j.p0.d.r.t("mPresenter");
            throw null;
        }
    }

    private final void N(TextView textView) {
        if (this.D.contains(textView)) {
            return;
        }
        this.D.add(textView);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void O() {
        boolean zF = com.seewo.factoryaging.e1.g.a.f();
        Log.d("ContentView", "isSupportGetTemperature: " + zF);
        if (zF) {
            n();
            c0 c0Var = this.p;
            if (c0Var != null) {
                c0Var.f();
            } else {
                j.p0.d.r.t("mPresenter");
                throw null;
            }
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public final void P() {
        boolean zX = com.seewo.factoryaging.e1.f.a.x();
        Log.d("ContentView", "isSupportGetTemperature mic: " + zX);
        if (zX) {
            q();
            c0 c0Var = this.p;
            if (c0Var != null) {
                c0Var.g();
            } else {
                j.p0.d.r.t("mPresenter");
                throw null;
            }
        }
    }

    private final void Q() {
        i.a.d.p(10L, 8L, TimeUnit.SECONDS).u(i.a.j.b.a.a()).y(new i.a.m.c() { // from class: com.seewo.factoryaging.a1.l
            @Override // i.a.m.c
            public final void accept(Object obj) {
                b0.R(this.a, (Long) obj);
            }
        }, new i.a.m.c() { // from class: com.seewo.factoryaging.a1.w
            @Override // i.a.m.c
            public final void accept(Object obj) {
                b0.S((Throwable) obj);
            }
        });
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void R(b0 b0Var, Long l2) {
        j.p0.d.r.f(b0Var, "this$0");
        LinearLayout linearLayout = b0Var.e;
        if (linearLayout == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        int measuredHeight = linearLayout.getMeasuredHeight();
        LinearLayout linearLayout2 = b0Var.e;
        if (linearLayout2 == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        int measuredWidth = linearLayout2.getMeasuredWidth();
        int i2 = b0Var.B - measuredHeight;
        int i3 = b0Var.A - measuredWidth;
        LinearLayout linearLayout3 = b0Var.e;
        if (linearLayout3 == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        linearLayout3.bringToFront();
        int iLongValue = ((int) l2.longValue()) % 4;
        if (iLongValue == 0) {
            LinearLayout linearLayout4 = b0Var.e;
            if (linearLayout4 != null) {
                ObjectAnimator.ofFloat(linearLayout4, "translationY", i2).setDuration(7000L).start();
                return;
            } else {
                j.p0.d.r.t("mAgingTimeLayout");
                throw null;
            }
        }
        if (iLongValue == 1) {
            LinearLayout linearLayout5 = b0Var.e;
            if (linearLayout5 != null) {
                ObjectAnimator.ofFloat(linearLayout5, "translationX", -i3).setDuration(7000L).start();
                return;
            } else {
                j.p0.d.r.t("mAgingTimeLayout");
                throw null;
            }
        }
        if (iLongValue == 2) {
            LinearLayout linearLayout6 = b0Var.e;
            if (linearLayout6 != null) {
                ObjectAnimator.ofFloat(linearLayout6, "translationY", 0.0f).setDuration(7000L).start();
                return;
            } else {
                j.p0.d.r.t("mAgingTimeLayout");
                throw null;
            }
        }
        if (iLongValue != 3) {
            return;
        }
        LinearLayout linearLayout7 = b0Var.e;
        if (linearLayout7 != null) {
            ObjectAnimator.ofFloat(linearLayout7, "translationX", 0.0f).setDuration(7000L).start();
        } else {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void S(Throwable th) {
        Log.i("ContentView", HttpUrl.FRAGMENT_ENCODE_SET + th);
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void T(b0 b0Var, String str) {
        j.p0.d.r.f(b0Var, "this$0");
        j.p0.d.r.f(str, "$cameraId");
        TextView textView = b0Var.f311k;
        if (textView == null) {
            j.p0.d.r.t("mCameraIdTextView");
            throw null;
        }
        textView.setTextColor(-16711936);
        TextView textView2 = b0Var.f311k;
        if (textView2 != null) {
            textView2.setText(str);
        } else {
            j.p0.d.r.t("mCameraIdTextView");
            throw null;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void U(boolean z, b0 b0Var, String str) {
        j.p0.d.r.f(b0Var, "this$0");
        j.p0.d.r.f(str, "$cameraTemperature");
        if (z) {
            TextView textView = b0Var.f310j;
            if (textView == null) {
                j.p0.d.r.t("mCameraTemperatureTextView");
                throw null;
            }
            textView.setTextColor(-16711936);
        } else {
            TextView textView2 = b0Var.f310j;
            if (textView2 == null) {
                j.p0.d.r.t("mCameraTemperatureTextView");
                throw null;
            }
            textView2.setTextColor(-65536);
        }
        TextView textView3 = b0Var.f310j;
        if (textView3 != null) {
            textView3.setText(str);
        } else {
            j.p0.d.r.t("mCameraTemperatureTextView");
            throw null;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void V(b0 b0Var, String str, long j2) {
        j.p0.d.r.f(b0Var, "this$0");
        j.p0.d.r.f(str, "$status");
        String string = b0Var.getResources().getString(R.string.str_ddr_test_fail);
        j.p0.d.r.e(string, "resources.getString(R.string.str_ddr_test_fail)");
        String string2 = b0Var.getResources().getString(R.string.str_ddr_test_interrupt);
        j.p0.d.r.e(string2, "resources.getString(R.st…g.str_ddr_test_interrupt)");
        String string3 = b0Var.getResources().getString(R.string.str_ddr_test_pass);
        j.p0.d.r.e(string3, "resources.getString(R.string.str_ddr_test_pass)");
        if (j.u0.r.G(str, string, true) || j.u0.r.G(str, string2, true)) {
            TextView textView = b0Var.f312l;
            if (textView == null) {
                j.p0.d.r.t("mDdrTextView");
                throw null;
            }
            textView.setTextColor(-65536);
            TextView textView2 = b0Var.f312l;
            if (textView2 == null) {
                j.p0.d.r.t("mDdrTextView");
                throw null;
            }
            textView2.setText(b0Var.getResources().getString(R.string.str_ddr_test) + str);
            return;
        }
        if (j.u0.r.G(str, string3, true)) {
            TextView textView3 = b0Var.f312l;
            if (textView3 == null) {
                j.p0.d.r.t("mDdrTextView");
                throw null;
            }
            textView3.setTextColor(-16711936);
            TextView textView4 = b0Var.f312l;
            if (textView4 == null) {
                j.p0.d.r.t("mDdrTextView");
                throw null;
            }
            textView4.setText(b0Var.getResources().getString(R.string.str_ddr_test) + str);
            return;
        }
        TextView textView5 = b0Var.f312l;
        if (textView5 == null) {
            j.p0.d.r.t("mDdrTextView");
            throw null;
        }
        textView5.setTextColor(-16776961);
        if (j2 < 0) {
            TextView textView6 = b0Var.f312l;
            if (textView6 == null) {
                j.p0.d.r.t("mDdrTextView");
                throw null;
            }
            textView6.setText(b0Var.getResources().getString(R.string.str_ddr_test) + str);
            return;
        }
        long j3 = 60;
        long j4 = j2 / j3;
        long j5 = j2 % j3;
        g0 g0Var = g0.a;
        String str2 = String.format("%02d:%02d", Arrays.copyOf(new Object[]{Long.valueOf(j4), Long.valueOf(j5)}, 2));
        j.p0.d.r.e(str2, "format(format, *args)");
        TextView textView7 = b0Var.f312l;
        if (textView7 == null) {
            j.p0.d.r.t("mDdrTextView");
            throw null;
        }
        textView7.setText(b0Var.getResources().getString(R.string.str_ddr_test) + str + " (" + str2 + ')');
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void W(boolean z, b0 b0Var, String str) {
        j.p0.d.r.f(b0Var, "this$0");
        j.p0.d.r.f(str, "$micTemperature");
        if (z) {
            TextView textView = b0Var.o;
            if (textView == null) {
                j.p0.d.r.t("mMicTemperatureTextView");
                throw null;
            }
            textView.setTextColor(-16711936);
        } else {
            TextView textView2 = b0Var.o;
            if (textView2 == null) {
                j.p0.d.r.t("mMicTemperatureTextView");
                throw null;
            }
            textView2.setTextColor(-65536);
        }
        TextView textView3 = b0Var.o;
        if (textView3 != null) {
            textView3.setText(str);
        } else {
            j.p0.d.r.t("mMicTemperatureTextView");
            throw null;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void X(boolean z, b0 b0Var) {
        j.p0.d.r.f(b0Var, "this$0");
        if (z) {
            String string = b0Var.getResources().getString(R.string.str_touch_burn);
            j.p0.d.r.e(string, "resources.getString(R.string.str_touch_burn)");
            TextView textView = b0Var.f309i;
            if (textView == null) {
                j.p0.d.r.t("mTouchBurnTextView");
                throw null;
            }
            textView.setTextColor(b0Var.z);
            TextView textView2 = b0Var.f309i;
            if (textView2 != null) {
                textView2.setText(string);
                return;
            } else {
                j.p0.d.r.t("mTouchBurnTextView");
                throw null;
            }
        }
        String string2 = b0Var.getResources().getString(R.string.str_touch_burn_fail);
        j.p0.d.r.e(string2, "resources.getString(R.string.str_touch_burn_fail)");
        TextView textView3 = b0Var.f309i;
        if (textView3 == null) {
            j.p0.d.r.t("mTouchBurnTextView");
            throw null;
        }
        textView3.setTextColor(-65536);
        TextView textView4 = b0Var.f309i;
        if (textView4 != null) {
            textView4.setText(string2);
        } else {
            j.p0.d.r.t("mTouchBurnTextView");
            throw null;
        }
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void Y(boolean z, b0 b0Var) {
        String string;
        j.p0.d.r.f(b0Var, "this$0");
        Log.d("ContentView", "updateTouchSignalTestResult " + z);
        if (z) {
            TextView textView = b0Var.s;
            if (textView == null) {
                j.p0.d.r.t("mTouchCheck");
                throw null;
            }
            textView.setTextColor(-16711936);
            string = b0Var.getResources().getString(R.string.str_touch_signal_test_pass);
        } else {
            TextView textView2 = b0Var.s;
            if (textView2 == null) {
                j.p0.d.r.t("mTouchCheck");
                throw null;
            }
            textView2.setTextColor(-65536);
            string = b0Var.getResources().getString(R.string.str_touch_signal_test_fail);
        }
        j.p0.d.r.e(string, "if (success) {\n         …_test_fail)\n            }");
        TextView textView3 = b0Var.s;
        if (textView3 == null) {
            j.p0.d.r.t("mTouchCheck");
            throw null;
        }
        textView3.setText(string);
        TextView textView4 = b0Var.s;
        if (textView4 != null) {
            textView4.setVisibility(0);
        } else {
            j.p0.d.r.t("mTouchCheck");
            throw null;
        }
    }

    private final void k() {
        LinearLayout linearLayout = new LinearLayout(getContext());
        this.e = linearLayout;
        if (linearLayout == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        linearLayout.setOrientation(1);
        LinearLayout linearLayout2 = this.e;
        if (linearLayout2 == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        linearLayout2.setBackgroundColor(-1);
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, -2);
        this.f313m = layoutParams;
        if (layoutParams == null) {
            j.p0.d.r.t("mFrameParams");
            throw null;
        }
        layoutParams.gravity = 5;
        TextView textView = new TextView(getContext());
        this.f = textView;
        if (textView == null) {
            j.p0.d.r.t("mAgingTimeTextView");
            throw null;
        }
        textView.setTextSize(1, 30.0f);
        TextView textView2 = this.f;
        if (textView2 == null) {
            j.p0.d.r.t("mAgingTimeTextView");
            throw null;
        }
        textView2.setTextColor(g.e.d.a.a(getContext(), R.color.RED));
        TextView textView3 = this.f;
        if (textView3 == null) {
            j.p0.d.r.t("mAgingTimeTextView");
            throw null;
        }
        textView3.setBackgroundResource(R.drawable.aging_time_background);
        TextView textView4 = this.f;
        if (textView4 == null) {
            j.p0.d.r.t("mAgingTimeTextView");
            throw null;
        }
        textView4.setText(getResources().getString(R.string.default_time));
        LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(this.C, -2);
        this.n = layoutParams2;
        if (layoutParams2 == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        layoutParams2.gravity = 5;
        LinearLayout linearLayout3 = this.e;
        if (linearLayout3 == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        TextView textView5 = this.f;
        if (textView5 == null) {
            j.p0.d.r.t("mAgingTimeTextView");
            throw null;
        }
        if (layoutParams2 == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        linearLayout3.addView(textView5, layoutParams2);
        TextView textView6 = this.f;
        if (textView6 == null) {
            j.p0.d.r.t("mAgingTimeTextView");
            throw null;
        }
        N(textView6);
        TextView textView7 = new TextView(getContext());
        this.f307g = textView7;
        if (textView7 == null) {
            j.p0.d.r.t("mCpuTemperatureTextView");
            throw null;
        }
        textView7.setTextSize(1, 50.0f);
        TextView textView8 = this.f307g;
        if (textView8 == null) {
            j.p0.d.r.t("mCpuTemperatureTextView");
            throw null;
        }
        textView8.setTypeface(Typeface.DEFAULT_BOLD);
        TextView textView9 = this.f307g;
        if (textView9 == null) {
            j.p0.d.r.t("mCpuTemperatureTextView");
            throw null;
        }
        textView9.setTextColor(Color.parseColor("#00FF00"));
        TextView textView10 = this.f307g;
        if (textView10 == null) {
            j.p0.d.r.t("mCpuTemperatureTextView");
            throw null;
        }
        textView10.setBackgroundResource(R.drawable.aging_time_background);
        LinearLayout linearLayout4 = this.e;
        if (linearLayout4 == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        TextView textView11 = this.f307g;
        if (textView11 == null) {
            j.p0.d.r.t("mCpuTemperatureTextView");
            throw null;
        }
        LinearLayout.LayoutParams layoutParams3 = this.n;
        if (layoutParams3 == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        linearLayout4.addView(textView11, layoutParams3);
        TextView textView12 = this.f307g;
        if (textView12 == null) {
            j.p0.d.r.t("mCpuTemperatureTextView");
            throw null;
        }
        textView12.setText(getResources().getString(R.string.str_cpu_temperature));
        TextView textView13 = this.f307g;
        if (textView13 == null) {
            j.p0.d.r.t("mCpuTemperatureTextView");
            throw null;
        }
        N(textView13);
        w();
    }

    private final void l() {
        TextView textView = new TextView(getContext());
        this.f308h = textView;
        if (textView == null) {
            j.p0.d.r.t("mAmbientTemperatureTextView");
            throw null;
        }
        textView.setTextSize(1, 50.0f);
        TextView textView2 = this.f308h;
        if (textView2 == null) {
            j.p0.d.r.t("mAmbientTemperatureTextView");
            throw null;
        }
        textView2.setTypeface(Typeface.DEFAULT_BOLD);
        TextView textView3 = this.f308h;
        if (textView3 == null) {
            j.p0.d.r.t("mAmbientTemperatureTextView");
            throw null;
        }
        textView3.setTextColor(Color.parseColor("#00FF00"));
        TextView textView4 = this.f308h;
        if (textView4 == null) {
            j.p0.d.r.t("mAmbientTemperatureTextView");
            throw null;
        }
        textView4.setBackgroundResource(R.drawable.aging_time_background);
        LinearLayout linearLayout = this.e;
        if (linearLayout == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        TextView textView5 = this.f308h;
        if (textView5 == null) {
            j.p0.d.r.t("mAmbientTemperatureTextView");
            throw null;
        }
        LinearLayout.LayoutParams layoutParams = this.n;
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        linearLayout.addView(textView5, layoutParams);
        TextView textView6 = this.f308h;
        if (textView6 == null) {
            j.p0.d.r.t("mAmbientTemperatureTextView");
            throw null;
        }
        textView6.setText(getResources().getString(R.string.str_ambient_temperature));
        TextView textView7 = this.f308h;
        if (textView7 == null) {
            j.p0.d.r.t("mAmbientTemperatureTextView");
            throw null;
        }
        N(textView7);
        w();
    }

    private final void m() {
        TextView textView = new TextView(getContext());
        this.f311k = textView;
        if (textView == null) {
            j.p0.d.r.t("mCameraIdTextView");
            throw null;
        }
        textView.setVisibility(0);
        TextView textView2 = this.f311k;
        if (textView2 == null) {
            j.p0.d.r.t("mCameraIdTextView");
            throw null;
        }
        textView2.setText(getResources().getString(R.string.str_current_cam_id));
        TextView textView3 = this.f311k;
        if (textView3 == null) {
            j.p0.d.r.t("mCameraIdTextView");
            throw null;
        }
        textView3.setTextSize(1, 50.0f);
        TextView textView4 = this.f311k;
        if (textView4 == null) {
            j.p0.d.r.t("mCameraIdTextView");
            throw null;
        }
        textView4.setTypeface(Typeface.DEFAULT_BOLD);
        TextView textView5 = this.f311k;
        if (textView5 == null) {
            j.p0.d.r.t("mCameraIdTextView");
            throw null;
        }
        textView5.setTextColor(-16711936);
        TextView textView6 = this.f311k;
        if (textView6 == null) {
            j.p0.d.r.t("mCameraIdTextView");
            throw null;
        }
        textView6.setBackgroundResource(R.drawable.aging_time_background);
        Log.d("ContentView", "addCamera ID view");
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(this.C, -2);
        this.n = layoutParams;
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        layoutParams.gravity = 5;
        LinearLayout linearLayout = this.e;
        if (linearLayout == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        TextView textView7 = this.f311k;
        if (textView7 == null) {
            j.p0.d.r.t("mCameraIdTextView");
            throw null;
        }
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        linearLayout.addView(textView7, layoutParams);
        TextView textView8 = this.f311k;
        if (textView8 == null) {
            j.p0.d.r.t("mCameraIdTextView");
            throw null;
        }
        N(textView8);
        w();
        invalidate();
    }

    private final void n() {
        if (this.u) {
            return;
        }
        TextView textView = new TextView(getContext());
        this.f310j = textView;
        if (textView == null) {
            j.p0.d.r.t("mCameraTemperatureTextView");
            throw null;
        }
        textView.setVisibility(0);
        TextView textView2 = this.f310j;
        if (textView2 == null) {
            j.p0.d.r.t("mCameraTemperatureTextView");
            throw null;
        }
        textView2.setText(getResources().getString(R.string.str_cam_temperature_pass));
        TextView textView3 = this.f310j;
        if (textView3 == null) {
            j.p0.d.r.t("mCameraTemperatureTextView");
            throw null;
        }
        textView3.setTextSize(1, 50.0f);
        TextView textView4 = this.f310j;
        if (textView4 == null) {
            j.p0.d.r.t("mCameraTemperatureTextView");
            throw null;
        }
        textView4.setTypeface(Typeface.DEFAULT_BOLD);
        TextView textView5 = this.f310j;
        if (textView5 == null) {
            j.p0.d.r.t("mCameraTemperatureTextView");
            throw null;
        }
        textView5.setTextColor(-16711936);
        TextView textView6 = this.f310j;
        if (textView6 == null) {
            j.p0.d.r.t("mCameraTemperatureTextView");
            throw null;
        }
        textView6.setBackgroundResource(R.drawable.aging_time_background);
        Log.d("ContentView", "addCameraTemperatureView");
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(this.C, -2);
        this.n = layoutParams;
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        layoutParams.gravity = 5;
        LinearLayout linearLayout = this.e;
        if (linearLayout == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        TextView textView7 = this.f310j;
        if (textView7 == null) {
            j.p0.d.r.t("mCameraTemperatureTextView");
            throw null;
        }
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        linearLayout.addView(textView7, layoutParams);
        this.u = true;
        TextView textView8 = this.f310j;
        if (textView8 == null) {
            j.p0.d.r.t("mCameraTemperatureTextView");
            throw null;
        }
        N(textView8);
        w();
        invalidate();
    }

    private final void o() {
        TextView textView = new TextView(getContext());
        this.f312l = textView;
        if (textView == null) {
            j.p0.d.r.t("mDdrTextView");
            throw null;
        }
        textView.setVisibility(0);
        TextView textView2 = this.f312l;
        if (textView2 == null) {
            j.p0.d.r.t("mDdrTextView");
            throw null;
        }
        textView2.setText(getResources().getString(R.string.str_ddr_test) + "准备中...");
        TextView textView3 = this.f312l;
        if (textView3 == null) {
            j.p0.d.r.t("mDdrTextView");
            throw null;
        }
        textView3.setTextSize(1, 50.0f);
        TextView textView4 = this.f312l;
        if (textView4 == null) {
            j.p0.d.r.t("mDdrTextView");
            throw null;
        }
        textView4.setTypeface(Typeface.DEFAULT_BOLD);
        TextView textView5 = this.f312l;
        if (textView5 == null) {
            j.p0.d.r.t("mDdrTextView");
            throw null;
        }
        textView5.setTextColor(-16776961);
        TextView textView6 = this.f312l;
        if (textView6 == null) {
            j.p0.d.r.t("mDdrTextView");
            throw null;
        }
        textView6.setBackgroundResource(R.drawable.aging_time_background);
        Log.d("ContentView", "addDdrTestView");
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(this.C, -2);
        this.n = layoutParams;
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        layoutParams.gravity = 5;
        LinearLayout linearLayout = this.e;
        if (linearLayout == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        TextView textView7 = this.f312l;
        if (textView7 == null) {
            j.p0.d.r.t("mDdrTextView");
            throw null;
        }
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        linearLayout.addView(textView7, layoutParams);
        TextView textView8 = this.f312l;
        if (textView8 == null) {
            j.p0.d.r.t("mDdrTextView");
            throw null;
        }
        N(textView8);
        w();
        invalidate();
    }

    private final void p() {
        boolean z = getResources().getBoolean(R.bool.showCpuInfo);
        ArrayList<com.seewo.factoryaging.s0.j> arrayList = this.q;
        j.p0.d.r.c(arrayList);
        for (com.seewo.factoryaging.s0.j jVar : arrayList) {
            if (jVar.e()) {
                if (jVar.a()) {
                    float fJ = jVar.j();
                    LinearLayout linearLayout = this.b;
                    if (linearLayout == null) {
                        j.p0.d.r.t("mTopLayout");
                        throw null;
                    }
                    View viewI = jVar.i();
                    j.p0.d.r.e(viewI, "testView.view");
                    x(fJ, linearLayout, viewI);
                } else {
                    float fJ2 = jVar.j();
                    LinearLayout linearLayout2 = this.d;
                    if (linearLayout2 == null) {
                        j.p0.d.r.t("mBottomLayout");
                        throw null;
                    }
                    View viewI2 = jVar.i();
                    j.p0.d.r.e(viewI2, "testView.view");
                    x(fJ2, linearLayout2, viewI2);
                }
            }
        }
        TextView textView = this.f307g;
        if (textView == null) {
            j.p0.d.r.t("mCpuTemperatureTextView");
            throw null;
        }
        textView.setVisibility(z ? 0 : 8);
        LinearLayout linearLayout3 = this.d;
        if (linearLayout3 == null) {
            j.p0.d.r.t("mBottomLayout");
            throw null;
        }
        if (linearLayout3 == null) {
            j.p0.d.r.t("mBottomLayout");
            throw null;
        }
        linearLayout3.setVisibility(linearLayout3.getChildCount() == 0 ? 8 : 0);
    }

    private final void q() {
        if (this.v) {
            return;
        }
        TextView textView = new TextView(getContext());
        this.o = textView;
        if (textView == null) {
            j.p0.d.r.t("mMicTemperatureTextView");
            throw null;
        }
        textView.setVisibility(0);
        TextView textView2 = this.o;
        if (textView2 == null) {
            j.p0.d.r.t("mMicTemperatureTextView");
            throw null;
        }
        textView2.setText(getResources().getString(R.string.str_mic_temperature_pass));
        TextView textView3 = this.o;
        if (textView3 == null) {
            j.p0.d.r.t("mMicTemperatureTextView");
            throw null;
        }
        textView3.setTextSize(1, 50.0f);
        TextView textView4 = this.o;
        if (textView4 == null) {
            j.p0.d.r.t("mMicTemperatureTextView");
            throw null;
        }
        textView4.setTypeface(Typeface.DEFAULT_BOLD);
        TextView textView5 = this.o;
        if (textView5 == null) {
            j.p0.d.r.t("mMicTemperatureTextView");
            throw null;
        }
        textView5.setTextColor(-16711936);
        TextView textView6 = this.o;
        if (textView6 == null) {
            j.p0.d.r.t("mMicTemperatureTextView");
            throw null;
        }
        textView6.setBackgroundResource(R.drawable.aging_time_background);
        Log.d("ContentView", "addMicTemperatureView");
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(this.C, -2);
        this.n = layoutParams;
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        layoutParams.gravity = 5;
        LinearLayout linearLayout = this.e;
        if (linearLayout == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        TextView textView7 = this.o;
        if (textView7 == null) {
            j.p0.d.r.t("mMicTemperatureTextView");
            throw null;
        }
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        linearLayout.addView(textView7, layoutParams);
        this.v = true;
        TextView textView8 = this.o;
        if (textView8 == null) {
            j.p0.d.r.t("mMicTemperatureTextView");
            throw null;
        }
        N(textView8);
        w();
        invalidate();
    }

    private final void r() {
        TextView textView = new TextView(getContext());
        this.t = textView;
        if (textView == null) {
            j.p0.d.r.t("mProductionModeTextView");
            throw null;
        }
        textView.setVisibility(0);
        TextView textView2 = this.t;
        if (textView2 == null) {
            j.p0.d.r.t("mProductionModeTextView");
            throw null;
        }
        textView2.setTextSize(1, 50.0f);
        TextView textView3 = this.t;
        if (textView3 == null) {
            j.p0.d.r.t("mProductionModeTextView");
            throw null;
        }
        textView3.setText(getResources().getString(R.string.str_production_mode_tips));
        TextView textView4 = this.t;
        if (textView4 == null) {
            j.p0.d.r.t("mProductionModeTextView");
            throw null;
        }
        textView4.setTypeface(Typeface.DEFAULT_BOLD);
        TextView textView5 = this.t;
        if (textView5 == null) {
            j.p0.d.r.t("mProductionModeTextView");
            throw null;
        }
        textView5.setTextColor(Color.parseColor("#00FF00"));
        TextView textView6 = this.t;
        if (textView6 == null) {
            j.p0.d.r.t("mProductionModeTextView");
            throw null;
        }
        textView6.setBackgroundResource(R.drawable.aging_time_background);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
        layoutParams.gravity = 3;
        LinearLayout linearLayout = this.e;
        if (linearLayout == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        TextView textView7 = this.t;
        if (textView7 == null) {
            j.p0.d.r.t("mProductionModeTextView");
            throw null;
        }
        linearLayout.addView(textView7, layoutParams);
        TextView textView8 = this.t;
        if (textView8 == null) {
            j.p0.d.r.t("mProductionModeTextView");
            throw null;
        }
        N(textView8);
        w();
        invalidate();
    }

    private final void s() {
        if (com.seewo.vcommons.data.c.m()) {
            int iB = com.seewo.vcommons.data.c.b();
            TextView textView = new TextView(getContext());
            this.r = textView;
            if (textView == null) {
                j.p0.d.r.t("mRebootTime");
                throw null;
            }
            textView.setTextSize(1, 50.0f);
            TextView textView2 = this.r;
            if (textView2 == null) {
                j.p0.d.r.t("mRebootTime");
                throw null;
            }
            textView2.setTextColor(Color.parseColor("#00FF00"));
            LinearLayout linearLayout = this.e;
            if (linearLayout == null) {
                j.p0.d.r.t("mAgingTimeLayout");
                throw null;
            }
            TextView textView3 = this.r;
            if (textView3 == null) {
                j.p0.d.r.t("mRebootTime");
                throw null;
            }
            LinearLayout.LayoutParams layoutParams = this.n;
            if (layoutParams == null) {
                j.p0.d.r.t("mLayoutParams");
                throw null;
            }
            linearLayout.addView(textView3, layoutParams);
            TextView textView4 = this.r;
            if (textView4 == null) {
                j.p0.d.r.t("mRebootTime");
                throw null;
            }
            textView4.setText(getContext().getString(R.string.str_restart_time) + iB);
            TextView textView5 = this.r;
            if (textView5 == null) {
                j.p0.d.r.t("mRebootTime");
                throw null;
            }
            N(textView5);
            w();
        }
    }

    private final void t(LinearLayout linearLayout) {
        LinearLayout linearLayout2 = new LinearLayout(getContext());
        this.b = linearLayout2;
        if (linearLayout2 == null) {
            j.p0.d.r.t("mTopLayout");
            throw null;
        }
        linearLayout2.setOrientation(0);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, 0);
        this.n = layoutParams;
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        layoutParams.weight = 1.0f;
        View view = this.b;
        if (view == null) {
            j.p0.d.r.t("mTopLayout");
            throw null;
        }
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        linearLayout.addView(view, layoutParams);
        LinearLayout linearLayout3 = new LinearLayout(getContext());
        this.d = linearLayout3;
        if (linearLayout3 == null) {
            j.p0.d.r.t("mBottomLayout");
            throw null;
        }
        linearLayout3.setOrientation(0);
        View view2 = this.d;
        if (view2 == null) {
            j.p0.d.r.t("mBottomLayout");
            throw null;
        }
        ViewGroup.LayoutParams layoutParams2 = this.n;
        if (layoutParams2 != null) {
            linearLayout.addView(view2, layoutParams2);
        } else {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
    }

    private final void u() {
        TextView textView = new TextView(getContext());
        this.f309i = textView;
        if (textView == null) {
            j.p0.d.r.t("mTouchBurnTextView");
            throw null;
        }
        textView.setVisibility(0);
        TextView textView2 = this.f309i;
        if (textView2 == null) {
            j.p0.d.r.t("mTouchBurnTextView");
            throw null;
        }
        textView2.setTextSize(1, 50.0f);
        TextView textView3 = this.f309i;
        if (textView3 == null) {
            j.p0.d.r.t("mTouchBurnTextView");
            throw null;
        }
        textView3.setText(getResources().getString(R.string.str_touch_burn));
        TextView textView4 = this.f309i;
        if (textView4 == null) {
            j.p0.d.r.t("mTouchBurnTextView");
            throw null;
        }
        textView4.setTypeface(Typeface.DEFAULT_BOLD);
        TextView textView5 = this.f309i;
        if (textView5 == null) {
            j.p0.d.r.t("mTouchBurnTextView");
            throw null;
        }
        textView5.setTextColor(Color.parseColor("#00FF00"));
        TextView textView6 = this.f309i;
        if (textView6 == null) {
            j.p0.d.r.t("mTouchBurnTextView");
            throw null;
        }
        textView6.setBackgroundResource(R.drawable.aging_time_background);
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-2, -2);
        layoutParams.gravity = 5;
        LinearLayout linearLayout = this.e;
        if (linearLayout == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        TextView textView7 = this.f309i;
        if (textView7 == null) {
            j.p0.d.r.t("mTouchBurnTextView");
            throw null;
        }
        linearLayout.addView(textView7, layoutParams);
        TextView textView8 = this.f309i;
        if (textView8 == null) {
            j.p0.d.r.t("mTouchBurnTextView");
            throw null;
        }
        N(textView8);
        w();
        invalidate();
    }

    private final void v() {
        TextView textView = new TextView(getContext());
        this.s = textView;
        if (textView == null) {
            j.p0.d.r.t("mTouchCheck");
            throw null;
        }
        textView.setVisibility(0);
        TextView textView2 = this.s;
        if (textView2 == null) {
            j.p0.d.r.t("mTouchCheck");
            throw null;
        }
        textView2.setText(getResources().getString(R.string.str_touch_signal_test_testing));
        TextView textView3 = this.s;
        if (textView3 == null) {
            j.p0.d.r.t("mTouchCheck");
            throw null;
        }
        textView3.setTextSize(1, 50.0f);
        TextView textView4 = this.s;
        if (textView4 == null) {
            j.p0.d.r.t("mTouchCheck");
            throw null;
        }
        textView4.setTypeface(Typeface.DEFAULT_BOLD);
        TextView textView5 = this.s;
        if (textView5 == null) {
            j.p0.d.r.t("mTouchCheck");
            throw null;
        }
        textView5.setTextColor(-16711936);
        TextView textView6 = this.s;
        if (textView6 == null) {
            j.p0.d.r.t("mTouchCheck");
            throw null;
        }
        textView6.setBackgroundResource(R.drawable.aging_time_background);
        Log.d("ContentView", "addTouchCheckedView");
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(this.C, -2);
        this.n = layoutParams;
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        layoutParams.gravity = 5;
        LinearLayout linearLayout = this.e;
        if (linearLayout == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        TextView textView7 = this.s;
        if (textView7 == null) {
            j.p0.d.r.t("mTouchCheck");
            throw null;
        }
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        linearLayout.addView(textView7, layoutParams);
        TextView textView8 = this.s;
        if (textView8 == null) {
            j.p0.d.r.t("mTouchCheck");
            throw null;
        }
        N(textView8);
        w();
    }

    private final void w() {
        LinearLayout linearLayout = this.e;
        if (linearLayout == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        int childCount = linearLayout.getChildCount();
        this.D.size();
        this.E = childCount <= 3 ? 40.0f : childCount <= 5 ? 25.0f : childCount <= 7 ? 20.0f : childCount <= 9 ? 18.0f : 15.0f;
        Log.d("ContentView", "根据 " + childCount + " 个子View, " + this.E + "dp");
        for (TextView textView : this.D) {
            TextView textView2 = this.f;
            if (textView2 == null) {
                j.p0.d.r.t("mAgingTimeTextView");
                throw null;
            }
            if (j.p0.d.r.a(textView, textView2)) {
                textView.setTextSize(1, this.E * 0.6f);
            } else {
                textView.setTextSize(1, this.E);
            }
        }
    }

    private final void x(float f, LinearLayout linearLayout, View view) {
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(0, -1);
        this.n = layoutParams;
        if (layoutParams == null) {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
        layoutParams.weight = f;
        if (layoutParams != null) {
            linearLayout.addView(view, layoutParams);
        } else {
            j.p0.d.r.t("mLayoutParams");
            throw null;
        }
    }

    private final void y(androidx.lifecycle.e eVar) {
        org.greenrobot.eventbus.c.c().q(this);
        LinearLayout linearLayout = new LinearLayout(getContext());
        linearLayout.setOrientation(1);
        this.f313m = new FrameLayout.LayoutParams(-1, -1);
        linearLayout.setBackgroundResource(R.color.white);
        ViewGroup.LayoutParams layoutParams = this.f313m;
        if (layoutParams == null) {
            j.p0.d.r.t("mFrameParams");
            throw null;
        }
        addView(linearLayout, layoutParams);
        Context context = getContext();
        j.p0.d.r.e(context, "context");
        Context context2 = getContext();
        j.p0.d.r.e(context2, "context");
        Context context3 = getContext();
        j.p0.d.r.e(context3, "context");
        Context context4 = getContext();
        j.p0.d.r.e(context4, "context");
        Context context5 = getContext();
        j.p0.d.r.e(context5, "context");
        Context context6 = getContext();
        j.p0.d.r.e(context6, "context");
        Context context7 = getContext();
        j.p0.d.r.e(context7, "context");
        ArrayList<com.seewo.factoryaging.s0.j> arrayListC = j.k0.o.c(new com.seewo.factoryaging.newvideo.o(context), new com.seewo.factoryaging.camera811.f(context2), new com.seewo.factoryaging.mic.f(context3), new com.seewo.factoryaging.sensor.g(context4), new com.seewo.factoryaging.co2.g(context5), new HumanTestModelView(context6), new com.seewo.factoryaging.opengl3d.b(context7));
        this.q = arrayListC;
        if (arrayListC != null) {
            for (com.seewo.factoryaging.s0.j jVar : arrayListC) {
                if (jVar instanceof androidx.lifecycle.f) {
                    eVar.a((androidx.lifecycle.f) jVar);
                }
            }
        }
        this.p = new a0(this);
        t(linearLayout);
        k();
        if (getResources().getBoolean(R.bool.show_sharp_sensor)) {
            l();
        }
        s();
        c0 c0Var = this.p;
        if (c0Var == null) {
            j.p0.d.r.t("mPresenter");
            throw null;
        }
        if (c0Var.k()) {
            Log.d("ContentView", "startDoProductionModeBusinessDelay");
            if (com.seewo.factoryaging.e1.f.a.v() && !com.seewo.factoryaging.e1.f.a.D()) {
                Log.d("ContentView", "guoNeiMachine and not enable udi http,doEnterUDIFactoryMode");
                c0 c0Var2 = this.p;
                if (c0Var2 == null) {
                    j.p0.d.r.t("mPresenter");
                    throw null;
                }
                c0Var2.a();
            }
            c0 c0Var3 = this.p;
            if (c0Var3 == null) {
                j.p0.d.r.t("mPresenter");
                throw null;
            }
            if (c0Var3.p()) {
                this.w.postDelayed(new Runnable() { // from class: com.seewo.factoryaging.a1.u
                    @Override // java.lang.Runnable
                    public final void run() {
                        b0.z(this.b);
                    }
                }, 600000L);
            }
            c0 c0Var4 = this.p;
            if (c0Var4 == null) {
                j.p0.d.r.t("mPresenter");
                throw null;
            }
            c0Var4.h();
            r();
            if (com.seewo.factoryaging.e1.f.a.y()) {
                c0 c0Var5 = this.p;
                if (c0Var5 == null) {
                    j.p0.d.r.t("mPresenter");
                    throw null;
                }
                c0Var5.e();
            }
        }
        p();
        c0 c0Var6 = this.p;
        if (c0Var6 == null) {
            j.p0.d.r.t("mPresenter");
            throw null;
        }
        c0Var6.n();
        c0 c0Var7 = this.p;
        if (c0Var7 == null) {
            j.p0.d.r.t("mPresenter");
            throw null;
        }
        c0Var7.l();
        if (getResources().getBoolean(R.bool.show_sharp_sensor)) {
            c0 c0Var8 = this.p;
            if (c0Var8 == null) {
                j.p0.d.r.t("mPresenter");
                throw null;
            }
            c0Var8.j();
        }
        if (com.seewo.factoryaging.e1.f.a.u()) {
            u();
            c0 c0Var9 = this.p;
            if (c0Var9 == null) {
                j.p0.d.r.t("mPresenter");
                throw null;
            }
            c0Var9.i();
        }
        View view = this.e;
        if (view == null) {
            j.p0.d.r.t("mAgingTimeLayout");
            throw null;
        }
        ViewGroup.LayoutParams layoutParams2 = this.f313m;
        if (layoutParams2 == null) {
            j.p0.d.r.t("mFrameParams");
            throw null;
        }
        addView(view, layoutParams2);
        if (com.seewo.factoryaging.c1.d.a.j()) {
            this.w.postDelayed(new Runnable() { // from class: com.seewo.factoryaging.a1.q
                @Override // java.lang.Runnable
                public final void run() {
                    b0.A(this.b);
                }
            }, 900000L);
        }
        Q();
    }

    /* JADX INFO: Access modifiers changed from: private */
    public static final void z(b0 b0Var) {
        j.p0.d.r.f(b0Var, "this$0");
        b0Var.v();
        c0 c0Var = b0Var.p;
        if (c0Var != null) {
            c0Var.m();
        } else {
            j.p0.d.r.t("mPresenter");
            throw null;
        }
    }

    @Override // com.seewo.factoryaging.a1.d0
    public Context a() {
        Context context = getContext();
        j.p0.d.r.e(context, "context");
        return context;
    }

    @Override // com.seewo.factoryaging.a1.d0
    public void b(final boolean z) {
        this.w.post(new Runnable() { // from class: com.seewo.factoryaging.a1.s
            @Override // java.lang.Runnable
            public final void run() {
                b0.Y(z, this);
            }
        });
    }

    @Override // com.seewo.factoryaging.a1.d0
    public void c(final boolean z) {
        Log.d("ContentView", "updateTouchBurnResult " + z);
        this.w.post(new Runnable() { // from class: com.seewo.factoryaging.a1.o
            @Override // java.lang.Runnable
            public final void run() {
                b0.X(z, this);
            }
        });
    }

    @org.greenrobot.eventbus.m(sticky = true, threadMode = ThreadMode.MAIN)
    public final void cameraSwitch(com.seewo.factoryaging.t0.d dVar) {
        j.p0.d.r.f(dVar, "event");
        Log.d("ContentView", "CameraSwitch: " + dVar.a());
        if (!this.y) {
            m();
            this.y = true;
        }
        c0 c0Var = this.p;
        if (c0Var != null) {
            c0Var.d(dVar.a());
        } else {
            j.p0.d.r.t("mPresenter");
            throw null;
        }
    }

    @Override // com.seewo.factoryaging.a1.d0
    public void d(final String str, final boolean z) {
        j.p0.d.r.f(str, "micTemperature");
        this.w.post(new Runnable() { // from class: com.seewo.factoryaging.a1.m
            @Override // java.lang.Runnable
            public final void run() {
                b0.W(z, this, str);
            }
        });
    }

    @org.greenrobot.eventbus.m(sticky = true, threadMode = ThreadMode.MAIN)
    public final void ddrTestStatusChange(com.seewo.factoryaging.t0.e eVar) {
        j.p0.d.r.f(eVar, "event");
        c0 c0Var = this.p;
        if (c0Var != null) {
            c0Var.b(eVar.a(), eVar.b());
        } else {
            j.p0.d.r.t("mPresenter");
            throw null;
        }
    }

    @Override // com.seewo.factoryaging.a1.d0
    @SuppressLint({"ResourceAsColor"})
    public void e(String str) {
        j.p0.d.r.f(str, "cpuTemperature");
        String string = getContext().getString(R.string.str_temperature_status_fail);
        j.p0.d.r.e(string, "context.getString(R.stri…_temperature_status_fail)");
        List listQ0 = j.u0.r.q0(str, new String[]{"\n"}, false, 0, 6, null);
        SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
        int i2 = 0;
        for (Object obj : listQ0) {
            int i3 = i2 + 1;
            if (i2 < 0) {
                j.k0.m.o();
                throw null;
            }
            String str2 = (String) obj;
            int length = spannableStringBuilder.length();
            spannableStringBuilder.append((CharSequence) str2);
            spannableStringBuilder.setSpan(new ForegroundColorSpan(j.u0.r.I(str2, string, false, 2, null) ? g.e.d.a.a(getContext(), R.color.RED) : Color.parseColor("#00FF00")), length, spannableStringBuilder.length(), 33);
            if (i2 != j.k0.o.h(listQ0)) {
                spannableStringBuilder.append((CharSequence) "\n");
            }
            i2 = i3;
        }
        TextView textView = this.f307g;
        if (textView == null) {
            j.p0.d.r.t("mCpuTemperatureTextView");
            throw null;
        }
        textView.setText(spannableStringBuilder);
    }

    @Override // com.seewo.factoryaging.a1.d0
    public void f(final String str, final boolean z) {
        j.p0.d.r.f(str, "cameraTemperature");
        this.w.post(new Runnable() { // from class: com.seewo.factoryaging.a1.p
            @Override // java.lang.Runnable
            public final void run() {
                b0.U(z, this, str);
            }
        });
    }

    @Override // com.seewo.factoryaging.a1.d0
    public void g(String str) {
        j.p0.d.r.f(str, "agingTime");
        TextView textView = this.f;
        if (textView != null) {
            textView.setText(str);
        } else {
            j.p0.d.r.t("mAgingTimeTextView");
            throw null;
        }
    }

    public final int getGreen() {
        return this.z;
    }

    @Override // com.seewo.factoryaging.a1.d0
    public void h(final String str) {
        j.p0.d.r.f(str, "cameraId");
        this.w.post(new Runnable() { // from class: com.seewo.factoryaging.a1.t
            @Override // java.lang.Runnable
            public final void run() {
                b0.T(this.b, str);
            }
        });
    }

    @Override // com.seewo.factoryaging.a1.d0
    public void i(final String str, final long j2) {
        j.p0.d.r.f(str, "status");
        this.w.post(new Runnable() { // from class: com.seewo.factoryaging.a1.r
            @Override // java.lang.Runnable
            public final void run() {
                b0.V(this.b, str, j2);
            }
        });
    }

    @Override // com.seewo.factoryaging.a1.d0
    public void j(String str) {
        j.p0.d.r.f(str, "ambientTemperature");
        if (j.u0.r.I(str, "NULL", false, 2, null)) {
            TextView textView = this.f308h;
            if (textView == null) {
                j.p0.d.r.t("mAmbientTemperatureTextView");
                throw null;
            }
            textView.setTextColor(g.e.d.a.a(getContext(), R.color.RED));
        } else {
            TextView textView2 = this.f308h;
            if (textView2 == null) {
                j.p0.d.r.t("mAmbientTemperatureTextView");
                throw null;
            }
            textView2.setTextColor(Color.parseColor("#00FF00"));
        }
        TextView textView3 = this.f308h;
        if (textView3 != null) {
            textView3.setText(str);
        } else {
            j.p0.d.r.t("mAmbientTemperatureTextView");
            throw null;
        }
    }

    @org.greenrobot.eventbus.m(sticky = true, threadMode = ThreadMode.MAIN)
    public final void onAddCameraFragment(com.seewo.factoryaging.t0.a aVar) {
        j.p0.d.r.f(aVar, "event");
        Log.d("ContentView", "重新添加摄像头画面");
        View viewI = this.x.i();
        if (viewI == null) {
            Log.d("ContentView", "添加摄像头画面失败");
            return;
        }
        float fJ = this.x.j();
        LinearLayout linearLayout = this.d;
        if (linearLayout == null) {
            j.p0.d.r.t("mBottomLayout");
            throw null;
        }
        x(fJ, linearLayout, viewI);
        Log.d("ContentView", "添加摄像头画面成功");
    }

    @Override // android.view.ViewGroup, android.view.View
    protected void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        c0 c0Var = this.p;
        if (c0Var != null) {
            c0Var.o();
        } else {
            j.p0.d.r.t("mPresenter");
            throw null;
        }
    }

    @org.greenrobot.eventbus.m(sticky = true, threadMode = ThreadMode.MAIN)
    public final void startCameraAutoTest(com.seewo.factoryaging.t0.c cVar) {
        j.p0.d.r.f(cVar, "event");
        Log.d("ContentView", "startCameraAutoTest");
        this.w.postDelayed(new Runnable() { // from class: com.seewo.factoryaging.a1.v
            @Override // java.lang.Runnable
            public final void run() {
                this.b.O();
            }
        }, 5000L);
    }

    @org.greenrobot.eventbus.m(sticky = true, threadMode = ThreadMode.MAIN)
    public final void startMicAutoTest(com.seewo.factoryaging.t0.f fVar) {
        j.p0.d.r.f(fVar, "event");
        Log.d("ContentView", "startMicAutoTest");
        this.w.postDelayed(new Runnable() { // from class: com.seewo.factoryaging.a1.n
            @Override // java.lang.Runnable
            public final void run() {
                this.b.P();
            }
        }, 5000L);
    }

    public /* synthetic */ b0(Context context, androidx.lifecycle.e eVar, AttributeSet attributeSet, int i2, int i3, j.p0.d.j jVar) {
        this(context, eVar, (i3 & 4) != 0 ? null : attributeSet, (i3 & 8) != 0 ? 0 : i2);
    }
}
