package com.bytedance.sdk.component.adexpress.ajl;

import android.content.Context;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;

/* JADX INFO: loaded from: classes.dex */
public class hi extends LinearLayout {
    private com.bytedance.adsdk.ro.ajl ajl;
    private TextView fm;
    private LinearLayout jnr;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    private TextView f6440lb;
    private com.bytedance.sdk.component.utils.hlt ro;
    private com.bytedance.sdk.component.adexpress.dynamic.yz.vt wsy;
    private fm yz;

    public interface fm {
    }

    public hi(@NonNull Context context, View view, com.bytedance.sdk.component.adexpress.dynamic.yz.vt vtVar) {
        super(context);
        this.wsy = vtVar;
        fm(context, view);
    }

    public TextView getTopTextView() {
        return this.fm;
    }

    public LinearLayout getWriggleLayout() {
        return this.jnr;
    }

    public View getWriggleProgressIv() {
        return this.ajl;
    }

    @Override // android.view.ViewGroup, android.view.View
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        if (isShown()) {
            if (this.ro == null) {
                this.ro = new com.bytedance.sdk.component.utils.hlt(getContext().getApplicationContext(), 2);
            }
            new Object() { // from class: com.bytedance.sdk.component.adexpress.ajl.hi.2
            };
            com.bytedance.sdk.component.adexpress.dynamic.yz.vt vtVar = this.wsy;
            if (vtVar != null) {
                vtVar.lb();
                this.wsy.jnr();
                this.wsy.ajl();
                this.wsy.wu();
            }
        }
    }

    @Override // android.view.ViewGroup, android.view.View
    public void onDetachedFromWindow() {
        super.onDetachedFromWindow();
        try {
            com.bytedance.adsdk.ro.ajl ajlVar = this.ajl;
            if (ajlVar != null) {
                ajlVar.jnr();
            }
        } catch (Exception unused) {
        }
    }

    @Override // android.view.View
    public void onWindowFocusChanged(boolean z10) {
    }

    public void setOnShakeViewListener(fm fmVar) {
        this.yz = fmVar;
    }

    public void setShakeText(String str) {
        this.f6440lb.setText(str);
    }

    private void fm(Context context, View view) {
        setClipChildren(false);
        addView(view);
        this.jnr = (LinearLayout) findViewById(2097610722);
        this.fm = (TextView) findViewById(2097610719);
        this.f6440lb = (TextView) findViewById(2097610718);
        com.bytedance.adsdk.ro.ajl ajlVar = (com.bytedance.adsdk.ro.ajl) findViewById(2097610706);
        this.ajl = ajlVar;
        ajlVar.setAnimation("lottie_json/twist_multi_angle.json");
        this.ajl.setImageAssetsFolder("images/");
        this.ajl.fm(true);
    }

    public void fm() {
        postDelayed(new Runnable() { // from class: com.bytedance.sdk.component.adexpress.ajl.hi.1
            @Override // java.lang.Runnable
            public void run() {
                try {
                    hi.this.ajl.fm();
                } catch (Throwable unused) {
                }
            }
        }, 500L);
    }
}
