package com.ss.android.ugc.aweme.commercialize.widget;

import X.0CB;
import X.0CH;
import X.2ha;
import X.6Is;
import X.7he;
import X.AiA;
import X.B3G;
import X.Crj;
import X.JBe;
import X.LGN;
import X.LI3;
import X.LIK;
import X.LIP;
import X.LIQ;
import X.LIR;
import X.LIS;
import X.LIW;
import X.M12;
import X.QHW;
import X.QJt;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.commercialize.profile.AbsAdProfileWidget;
import com.ss.android.ugc.aweme.commercialize.profile.FakeUserProfileFragment;
import com.ss.android.ugc.aweme.feed.model.Aweme;
import com.ss.android.ugc.aweme.feed.model.AwemeRawAd;
import com.ss.android.ugc.aweme.profile.model.User;

public final class AdFakeUserProfileNewBottomBarWidget extends AbsAdProfileWidget implements 6Is {
    public static final LIW LJIIIZ = new LIW((byte) 0);
    public final Crj LJIIJ = 7he.LIZ(new LIQ(this));
    public final Crj LJIIJJI = 7he.LIZ(new LIS(this));
    public final Crj LJIIL = 7he.LIZ(new LIR(this));
    public final Crj LJIILIIL = 7he.LIZ(new LIP(this));

    static {
        Covode.recordClassIndex(60146);
    }

    private final ViewGroup LJ() {
        return (ViewGroup) this.LJIIJ.getValue();
    }

    private final TextView LJFF() {
        return (TextView) this.LJIILIIL.getValue();
    }

    public final void onStateChanged(0CH r1, 0CB r2) {
        super.onStateChanged(r1, r2);
    }

    private final void LJI() {
        ViewGroup LJ = LJ();
        if (LJ != null) {
            LJ.animate().translationY((float) 2ha.LIZ(100.0d)).setDuration(0).start();
        }
    }

    public final void LIZ(View view) {
        super.LIZ(view);
        LJI();
    }

    public final void LIZ(boolean z) {
        super.LIZ(z);
        if (z) {
            ViewGroup LJ = LJ();
            if (LJ != null) {
                LJ.animate().translationY((float) 2ha.LIZ(0.0d)).setDuration(300).start();
                return;
            }
            return;
        }
        LJI();
    }

    public final void LIZ(LGN lgn) {
        String str;
        String str2;
        AwemeRawAd awemeRawAd;
        AiA fakeAuthor;
        AwemeRawAd awemeRawAd2;
        String str3;
        AwemeRawAd awemeRawAd3;
        M12.LIZ((Object) lgn);
        super.LIZ(lgn);
        TextView textView = (TextView) this.LJIIL.getValue();
        User user = null;
        if (textView != null) {
            Aweme aweme = this.LIZ;
            if (aweme == null || (awemeRawAd3 = aweme.getAwemeRawAd()) == null) {
                str3 = null;
            } else {
                str3 = awemeRawAd3.getButtonText();
            }
            textView.setText(str3);
        }
        Aweme aweme2 = this.LIZ;
        if (aweme2 == null || (awemeRawAd2 = aweme2.getAwemeRawAd()) == null) {
            str = null;
        } else {
            str = awemeRawAd2.getOpenUrl();
        }
        if (str == null || str.length() == 0) {
            TextView LJFF = LJFF();
            if (LJFF != null) {
                LJFF.setVisibility(0);
            }
            TextView LJFF2 = LJFF();
            if (LJFF2 != null) {
                Aweme aweme3 = this.LIZ;
                if (aweme3 == null || (awemeRawAd = aweme3.getAwemeRawAd()) == null || (fakeAuthor = awemeRawAd.getFakeAuthor()) == null) {
                    str2 = null;
                } else {
                    str2 = fakeAuthor.getButtonText();
                }
                LJFF2.setText(str2);
            }
        } else {
            TextView LJFF3 = LJFF();
            if (LJFF3 != null) {
                LJFF3.setVisibility(8);
            }
        }
        LI3 li3 = FakeUserProfileFragment.LIZLLL;
        Aweme aweme4 = this.LIZ;
        if (aweme4 != null) {
            user = aweme4.getAuthor();
        }
        B3G LIZ = li3.LIZ(user);
        if (LIZ != null) {
            QJt LIZ2 = QHW.LIZ(LIZ);
            LIZ2.LJJIIZ = (JBe) this.LJIIJJI.getValue();
            LIZ2.LIZJ();
        }
        ViewGroup LJ = LJ();
        if (LJ != null) {
            LJ.setOnClickListener(new LIK(this, lgn));
        }
    }
}
