package com.seewo.factoryaging.human;

import android.animation.ArgbEvaluator;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.cvte.vman.R;
import com.seewo.factoryaging.s0.d;
import j.n;
import j.p0.d.r;
import java.util.LinkedHashMap;
import java.util.Map;

/* JADX INFO: compiled from: HumanFragment.kt */
/* JADX INFO: loaded from: classes.dex */
@n
public final class HumanFragment extends d<b, a> implements b {
    private TextView b0;
    private LinearLayout c0;
    private ValueAnimator i0;
    public Map<Integer, View> j0 = new LinkedHashMap();
    private int d0 = -1;
    private int e0 = -16777216;
    private int f0 = -65536;
    private int g0 = -16711936;
    private int h0 = -16776961;

    @Override // g.h.a.c
    public View B0(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        r.f(layoutInflater, "inflater");
        View viewInflate = layoutInflater.inflate(R.layout.fragment_human, viewGroup);
        viewInflate.findViewById(R.id.test_result_layout);
        this.b0 = (TextView) viewInflate.findViewById(R.id.tips);
        View viewFindViewById = viewInflate.findViewById(R.id.fl_human);
        r.e(viewFindViewById, "humanLayoutView.findViewById(R.id.fl_human)");
        this.c0 = (LinearLayout) viewFindViewById;
        ArgbEvaluator argbEvaluator = new ArgbEvaluator();
        LinearLayout linearLayout = this.c0;
        if (linearLayout == null) {
            r.t("mFlHuman");
            throw null;
        }
        ObjectAnimator objectAnimatorOfInt = ObjectAnimator.ofInt(linearLayout, "backgroundColor", this.f0, this.g0, this.h0, this.d0, this.e0);
        r.e(objectAnimatorOfInt, "ofInt(mFlHuman, \"backgro…REEN, BLUE, WHITE, BLACK)");
        this.i0 = objectAnimatorOfInt;
        if (objectAnimatorOfInt == null) {
            r.t("colorAnimHuman");
            throw null;
        }
        objectAnimatorOfInt.setDuration(3000L);
        ValueAnimator valueAnimator = this.i0;
        if (valueAnimator == null) {
            r.t("colorAnimHuman");
            throw null;
        }
        valueAnimator.setEvaluator(argbEvaluator);
        ValueAnimator valueAnimator2 = this.i0;
        if (valueAnimator2 == null) {
            r.t("colorAnimHuman");
            throw null;
        }
        valueAnimator2.setRepeatCount(-1);
        ValueAnimator valueAnimator3 = this.i0;
        if (valueAnimator3 == null) {
            r.t("colorAnimHuman");
            throw null;
        }
        valueAnimator3.setRepeatMode(2);
        ValueAnimator valueAnimator4 = this.i0;
        if (valueAnimator4 != null) {
            valueAnimator4.start();
            return viewInflate;
        }
        r.t("colorAnimHuman");
        throw null;
    }

    @Override // com.seewo.factoryaging.human.b
    public void D() {
        TextView textView = this.b0;
        r.c(textView);
        textView.setText(R.string.human_fragment_no_detected);
    }

    @Override // com.seewo.factoryaging.s0.d, g.h.a.c
    public /* synthetic */ void E0() {
        super.E0();
        G1();
    }

    @Override // com.seewo.factoryaging.s0.d, g.h.a.c
    public void F0() {
        super.F0();
        a aVarH1 = H1();
        r.c(aVarH1);
        aVarH1.l();
    }

    @Override // com.seewo.factoryaging.s0.d
    public void G1() {
        this.j0.clear();
    }

    /* JADX INFO: Access modifiers changed from: protected */
    @Override // com.seewo.factoryaging.s0.d
    /* JADX INFO: renamed from: K1, reason: merged with bridge method [inline-methods] */
    public a I1() {
        return new c();
    }

    @Override // com.seewo.factoryaging.s0.d, g.h.a.c
    public void V0(View view, Bundle bundle) {
        r.f(view, "view");
        super.V0(view, bundle);
        if (H1() != null) {
            a aVarH1 = H1();
            r.c(aVarH1);
            aVarH1.m();
        }
    }

    @Override // com.seewo.factoryaging.human.b
    public void x() {
        TextView textView = this.b0;
        r.c(textView);
        textView.setText(R.string.human_fragment_detected);
    }
}
