package com.bytedance.sdk.component.adexpress.dynamic.lb;

import android.content.Context;
import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
import com.bytedance.sdk.component.adexpress.ajl.hi;
import com.bytedance.sdk.component.utils.maa;
import org.json.JSONObject;

/* JADX INFO: loaded from: classes.dex */
public class gqi implements wsy<hi> {
    private com.bytedance.sdk.component.adexpress.dynamic.yz.vt ajl;
    private hi fm;
    private String jnr;

    /* JADX INFO: renamed from: lb, reason: collision with root package name */
    private com.bytedance.sdk.component.adexpress.dynamic.dynamicview.jnr f6500lb;
    private Context ro;
    private com.bytedance.sdk.component.adexpress.dynamic.yz.wsy yz;

    public gqi(Context context, com.bytedance.sdk.component.adexpress.dynamic.dynamicview.jnr jnrVar, com.bytedance.sdk.component.adexpress.dynamic.yz.wsy wsyVar, String str, com.bytedance.sdk.component.adexpress.dynamic.yz.vt vtVar) {
        this.ro = context;
        this.f6500lb = jnrVar;
        this.yz = wsyVar;
        this.jnr = str;
        this.ajl = vtVar;
        jnr();
    }

    private void jnr() {
        int iIb = this.yz.ib();
        final com.bytedance.sdk.component.adexpress.dynamic.ajl.fm dynamicClickListener = this.f6500lb.getDynamicClickListener();
        try {
            new JSONObject().put("convertActionType", 2);
        } catch (Throwable unused) {
        }
        if ("18".equals(this.jnr)) {
            Context context = this.ro;
            hi hiVar = new hi(context, com.bytedance.sdk.component.adexpress.lb.fm.ef(context), this.ajl);
            this.fm = hiVar;
            if (hiVar.getWriggleLayout() != null) {
                this.fm.getWriggleLayout().setOnClickListener((View.OnClickListener) dynamicClickListener);
            }
            if (this.fm.getTopTextView() != null) {
                if (TextUtils.isEmpty(this.yz.pbk())) {
                    this.fm.getTopTextView().setText(maa.ro(this.ro, "tt_splash_wriggle_top_text_style_17"));
                } else {
                    this.fm.getTopTextView().setText(this.yz.pbk());
                }
            }
        } else {
            Context context2 = this.ro;
            this.fm = new hi(context2, com.bytedance.sdk.component.adexpress.lb.fm.ef(context2), this.ajl);
        }
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, -2);
        layoutParams.gravity = 81;
        this.fm.setTranslationY(-((int) com.bytedance.sdk.component.adexpress.yz.wsy.fm(this.ro, iIb)));
        this.fm.setLayoutParams(layoutParams);
        this.fm.setShakeText(this.yz.lmk());
        this.fm.setClipChildren(false);
        final View wriggleProgressIv = this.fm.getWriggleProgressIv();
        this.fm.setOnShakeViewListener(new hi.fm() { // from class: com.bytedance.sdk.component.adexpress.dynamic.lb.gqi.1
        });
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.lb.wsy
    public void fm() {
        this.fm.fm();
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.lb.wsy
    public void ro() {
        this.fm.clearAnimation();
    }

    @Override // com.bytedance.sdk.component.adexpress.dynamic.lb.wsy
    /* JADX INFO: renamed from: yz, reason: merged with bridge method [inline-methods] */
    public hi lb() {
        return this.fm;
    }
}
