package com.ss.android.ugc.aweme.profile.widgets;

import X.070;
import X.0CB;
import X.0CH;
import X.0Gf;
import X.0Gp;
import X.1hK;
import X.2GO;
import X.2HV;
import X.2HZ;
import X.2OR;
import X.2Pr;
import X.2cN;
import X.2sK;
import X.2xd;
import X.3Fl;
import X.3hr;
import X.46i;
import X.4Dd;
import X.4Ek;
import X.4Q6;
import X.4vE;
import X.6Is;
import X.7hc;
import X.7he;
import X.7xU;
import X.B2z;
import X.B30;
import X.B31;
import X.B33;
import X.C0253Cpt;
import X.C0295Crj;
import X.C1333DVh;
import X.C2793DvZ;
import X.C2975DyV;
import X.C2977DyX;
import X.C2978DyY;
import X.C2980Dya;
import X.C3027DzL;
import X.C3746EQc;
import X.C3747EQd;
import X.C3754EQk;
import X.C3763EQt;
import X.C3767EQx;
import X.C3772ERc;
import X.C3773ERd;
import X.C3774ERe;
import X.C3779ERj;
import X.C3782ERm;
import X.C3784ERo;
import X.C3794ERy;
import X.C3973EYv;
import X.C3974EYw;
import X.CjD;
import X.D0R;
import X.D1G;
import X.DGZ;
import X.DJU;
import X.DUS;
import X.EQW;
import X.ER4;
import X.ER5;
import X.ER6;
import X.ER7;
import X.ER9;
import X.ERE;
import X.ERH;
import X.ERI;
import X.ERK;
import X.ERL;
import X.ERM;
import X.ERN;
import X.ERO;
import X.ERP;
import X.ERV;
import X.ERX;
import X.ERY;
import X.ES0;
import X.ES7;
import X.ESC;
import X.ESE;
import X.ISm;
import X.KEM;
import X.Lf3;
import X.LnI;
import X.Ls2;
import X.M12;
import X.Mjy;
import X.NuY;
import X.Qen;
import X.Rc9;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.Paint;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
import android.text.method.LinkMovementMethod;
import android.text.style.ForegroundColorSpan;
import android.text.style.StyleSpan;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.ies.abmock.SettingsManager;
import com.bytedance.jedi.ext.widget.WidgetLifecycleAwareLazy;
import com.bytedance.keva.Keva;
import com.ss.android.ugc.aweme.IAccountUserService;
import com.ss.android.ugc.aweme.app.SharePrefCache;
import com.ss.android.ugc.aweme.compliance.api.a;
import com.ss.android.ugc.aweme.compliance.api.services.banappeal.IBanAppealService;
import com.ss.android.ugc.aweme.global.config.settings.pojo.IESSettingsProxy;
import com.ss.android.ugc.aweme.global.config.settings.pojo.UgAwemeActivitySetting;
import com.ss.android.ugc.aweme.global.config.settings.pojo.UgProfileActivityButton;
import com.ss.android.ugc.aweme.profile.model.User;
import com.ss.android.ugc.aweme.profile.model.ViewerEntranceInfo;
import com.ss.android.ugc.aweme.profile.survey.SurveyApi;
import com.ss.android.ugc.aweme.profile.viewmodel.MyProfileGuideState;
import com.ss.android.ugc.aweme.profile.viewmodel.MyProfileGuideViewModel;
import com.ss.android.ugc.aweme.profile.viewmodel.ProfileState;
import java.lang.ref.WeakReference;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import kotlin.h.b.n;
import kotlin.o.z;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.ThreadMode;

public class BaseMyProfileGuideWidget extends ProfileWidget implements 6Is, 2HZ, 2GO {
    public static final C3773ERd LJIILL = new C3773ERd((byte) 0);
    public static final boolean LJIJI = false;
    public final String LJI = "BaseMyProfileGuieWidget";
    public View LJII;
    public C3784ERo LJIIIIZZ;
    public final C0295Crj LJIIIZ = 7he.LIZ(7hc.NONE, new ERM(this));
    public View LJIIJ;
    public ObjectAnimator LJIIJJI;
    public View LJIIL;
    public AnimatorSet LJIILIIL;
    public final Mjy LJIILJJIL;
    public final C0295Crj LJIIZILJ = 7he.LIZ(7hc.NONE, new ERN(this));
    public final WidgetLifecycleAwareLazy LJIJ;

    private final ViewStub LJIJJLI() {
        return (ViewStub) this.LJIIZILJ.getValue();
    }

    public void LIZ(ES7 es7) {
    }

    public D0R<Boolean, Boolean, Ls2<2Pr>>[] LIZ(ProfileState profileState, MyProfileGuideState myProfileGuideState) {
        M12.LIZ(profileState, myProfileGuideState);
        return new D0R[0];
    }

    public final MyProfileGuideViewModel LJIILJJIL() {
        return (MyProfileGuideViewModel) this.LJIJ.getValue();
    }

    public Map<Integer, Object> getSubscriberEventTypes() {
        HashMap hashMap = new HashMap();
        hashMap.put(361, new Rc9(BaseMyProfileGuideWidget.class, "onProfilePageScrolledEvent", DGZ.class, ThreadMode.MAIN, 0, false));
        hashMap.put(362, new Rc9(BaseMyProfileGuideWidget.class, "onI18nRecommendUserDialogDissmissEvent", C2793DvZ.class, ThreadMode.POSTING, 0, false));
        return hashMap;
    }

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

    static {
        Covode.recordClassIndex(99667);
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [com.bytedance.widget.Widget, com.ss.android.ugc.aweme.profile.widgets.BaseMyProfileGuideWidget, java.lang.Object] */
    public void LJIIIIZZ() {
        BaseMyProfileGuideWidget.super.LJIIIIZZ();
        C3767EQx.LIZ().LIZIZ = null;
        EventBus.LIZ().LIZIZ(this);
        this.LJIILJJIL.LIZ();
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [com.bytedance.widget.Widget, com.ss.android.ugc.aweme.profile.widgets.BaseMyProfileGuideWidget] */
    public final ES7 LJIIJ() {
        View view = this.LJ;
        if (view == null) {
            n.LIZIZ();
        }
        return (ES7) view.findViewById(2131372924);
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [com.bytedance.widget.Widget, com.ss.android.ugc.aweme.profile.widgets.BaseMyProfileGuideWidget] */
    public final ESE LJIIJJI() {
        View view = this.LJ;
        if (view == null) {
            n.LIZIZ();
        }
        return (ESE) view.findViewById(2131372951);
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [com.bytedance.widget.Widget, com.ss.android.ugc.aweme.profile.widgets.BaseMyProfileGuideWidget] */
    public final ESE LJIIL() {
        View view = this.LJ;
        if (view == null) {
            n.LIZIZ();
        }
        return (ESE) view.findViewById(2131372880);
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [com.bytedance.widget.Widget, com.ss.android.ugc.aweme.profile.widgets.BaseMyProfileGuideWidget] */
    public final ESE LJIILIIL() {
        View view = this.LJ;
        if (view == null) {
            n.LIZIZ();
        }
        View findViewById = view.findViewById(2131372884);
        n.LIZIZ(findViewById, "");
        return (ESE) findViewById;
    }

    public final void LJIILL() {
        Keva.getRepo("keva_repo_profile_viewer").storeBoolean(4Q6.LIZ.LIZ("profile_entrance_tips_has_show"), true);
        LJIJJ().LIZJ(C1333DVh.LIZ);
    }

    public final void LJIJ() {
        IBanAppealService LIZJ = a.LIZJ();
        1hK LJIJI2 = LJIJI();
        Objects.requireNonNull(LJIJI2, "null cannot be cast to non-null type androidx.fragment.app.FragmentActivity");
        LIZJ.LIZIZ(LJIJI2);
    }

    private final void LJJ() {
        MethodCollector.i(12860);
        if (this.LJII != null) {
            MethodCollector.o(12860);
            return;
        }
        View inflate = LJIJJLI().inflate();
        this.LJII = inflate;
        if (inflate != null) {
            inflate.setVisibility(0);
            MethodCollector.o(12860);
            return;
        }
        MethodCollector.o(12860);
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [com.bytedance.widget.Widget, com.ss.android.ugc.aweme.profile.widgets.BaseMyProfileGuideWidget] */
    public final void LJI() {
        Animation animation;
        Animation animation2;
        BaseMyProfileGuideWidget.super.LJI();
        View view = this.LJII;
        if (!(view == null || (animation2 = view.getAnimation()) == null)) {
            animation2.cancel();
            animation2.reset();
        }
        ObjectAnimator objectAnimator = this.LJIIJJI;
        if (objectAnimator != null && objectAnimator.isRunning()) {
            objectAnimator.pause();
        }
        View view2 = this.LJIIL;
        if (!(view2 == null || (animation = view2.getAnimation()) == null)) {
            animation.cancel();
            animation.reset();
        }
        AnimatorSet animatorSet = this.LJIILIIL;
        if (animatorSet != null && animatorSet.isRunning()) {
            animatorSet.pause();
        }
    }

    private final void LJIL() {
        MethodCollector.i(12621);
        Activity LJIJI2 = LJIJI();
        LJJ();
        View view = this.LJII;
        if (view == null) {
            MethodCollector.o(12621);
            return;
        }
        view.setLayerType(2, (Paint) null);
        Animation loadAnimation = AnimationUtils.loadAnimation(LJIJI2, 2130772132);
        n.LIZIZ(loadAnimation, "");
        loadAnimation.setRepeatMode(2);
        loadAnimation.setRepeatCount(-1);
        loadAnimation.setAnimationListener(new ERL(this));
        View view2 = this.LJII;
        if (view2 != null) {
            view2.startAnimation(loadAnimation);
            MethodCollector.o(12621);
            return;
        }
        MethodCollector.o(12621);
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [com.bytedance.widget.Widget, com.ss.android.ugc.aweme.profile.widgets.BaseMyProfileGuideWidget] */
    public void LJFF() {
        View view;
        Animation animation;
        View view2;
        BaseMyProfileGuideWidget.super.LJFF();
        View view3 = this.LJII;
        if (view3 != null && view3.getVisibility() == 0) {
            LJIL();
        }
        ObjectAnimator objectAnimator = this.LJIIJJI;
        if (objectAnimator != null && (view2 = this.LJIIJ) != null && view2.getVisibility() == 0 && objectAnimator.isPaused()) {
            objectAnimator.resume();
        }
        View view4 = this.LJIIL;
        if (!(view4 == null || view4.getVisibility() != 0 || (animation = view4.getAnimation()) == null)) {
            animation.start();
        }
        AnimatorSet animatorSet = this.LJIILIIL;
        if (animatorSet != null && (view = this.LJIIL) != null && view.getVisibility() == 0 && animatorSet.isPaused()) {
            animatorSet.resume();
        }
        LJIILLIIL();
    }

    public final void LJIILLIIL() {
        ESE LJIIJJI2;
        ESE LJIIJJI3;
        ESE LJIIJJI4 = LJIIJJI();
        if (LJIIJJI4 != null && LJIIJJI4.getVisibility() == 0) {
            C3794ERy LIZ = C3794ERy.LIZ();
            n.LIZIZ(LIZ, "");
            if (LIZ.LIZJ() && (LJIIJJI3 = LJIIJJI()) != null) {
                LJIIJJI3.setVisibility(8);
            }
            C3794ERy.LIZ().LIZIZ();
            C3794ERy LIZ2 = C3794ERy.LIZ();
            n.LIZIZ(LIZ2, "");
            if (LIZ2.LIZJ() && (LJIIJJI2 = LJIIJJI()) != null) {
                LJIIJJI2.setVisibility(8);
            }
        }
    }

    public final void LJIIZILJ() {
        int i;
        C3784ERo eRo = this.LJIIIIZZ;
        if (eRo != null && eRo.LJIILIIL) {
            C3784ERo eRo2 = this.LJIIIIZZ;
            if (eRo2 == null) {
                n.LIZIZ();
            }
            eRo2.LIZIZ();
            C3767EQx LIZ = C3767EQx.LIZ();
            C3784ERo eRo3 = this.LJIIIIZZ;
            if (eRo3 == null) {
                n.LIZIZ();
            }
            int i2 = 0;
            if (eRo3.LJIIJJI != null) {
                i = eRo3.LJIIJJI.LIZ;
            } else {
                i = 0;
            }
            C3784ERo eRo4 = this.LJIIIIZZ;
            if (eRo4 == null) {
                n.LIZIZ();
            }
            if (eRo4.LJIIJJI != null) {
                i2 = eRo4.LJIIJJI.LJIIIIZZ;
            }
            LIZ.LIZ(new C3779ERj(3, i, i2));
        }
    }

    /* JADX WARNING: type inference failed for: r7v0, types: [X.DV1, com.ss.android.ugc.aweme.profile.widgets.BaseMyProfileGuideWidget, java.lang.Object, com.ss.android.ugc.aweme.profile.widgets.ProfileWidget] */
    public void LIZLLL() {
        ViewGroup.LayoutParams layoutParams;
        ViewGroup.LayoutParams layoutParams2;
        BaseMyProfileGuideWidget.super.LIZLLL();
        EventBus.LIZ(EventBus.LIZ(), this);
        2cN unused = selectSubscribe(LJIJJ(), ERY.LIZ, C2977DyX.LIZ, C3027DzL.LIZ, C2980Dya.LIZ, DUS.LIZ(), new C3754EQk(this));
        2cN unused2 = selectSubscribe(LJIJJ(), C2975DyV.LIZ, DUS.LIZ(), new ER6(this));
        2cN unused3 = subscribe(LJIILJJIL(), DUS.LIZ(), new C3763EQt(this));
        if (a.LJIILJJIL().LIZ()) {
            LJIILJJIL().LJI(ERH.LIZ);
        } else {
            IAccountUserService LJFF = 46i.LJFF();
            n.LIZIZ(LJFF, "");
            if (LJFF.isChildrenMode()) {
                LJIILJJIL().LJI(ERI.LIZ);
            } else {
                C3767EQx.LIZ().LIZIZ = new ERV(LJIILJJIL());
                C3767EQx LIZ = C3767EQx.LIZ();
                0Gp<C3782ERm> LIZ2 = SurveyApi.LIZ();
                if (LIZ2 != null) {
                    LIZ2.LIZ(new ERE(LIZ));
                }
            }
        }
        C3973EYv.LIZ.needShowDiskManagerGuideView().LIZIZ(new ERP(this));
        ViewGroup.MarginLayoutParams marginLayoutParams = null;
        0Gp.LIZ(C0253Cpt.LIZ).LIZ(new B33(this), 0Gp.LIZIZ, (0Gf) null);
        MyProfileGuideViewModel LJIILJJIL2 = LJIILJJIL();
        M12.LIZ(LJIILJJIL2);
        C3772ERc.LIZIZ = new WeakReference<>(LJIILJJIL2);
        ES7 LJIIJ2 = LJIIJ();
        if (LJIIJ2 != null) {
            layoutParams = LJIIJ2.getLayoutParams();
        } else {
            layoutParams = null;
        }
        if (!(layoutParams instanceof ViewGroup.MarginLayoutParams)) {
            layoutParams = null;
        }
        ViewGroup.MarginLayoutParams marginLayoutParams2 = (ViewGroup.MarginLayoutParams) layoutParams;
        if (marginLayoutParams2 != null) {
            3Fl r0 = 2HV.LIZ;
            n.LIZIZ(r0, "");
            marginLayoutParams2.bottomMargin = r0.LIZ();
        }
        ESE LJIIJJI2 = LJIIJJI();
        if (LJIIJJI2 != null) {
            layoutParams2 = LJIIJJI2.getLayoutParams();
        } else {
            layoutParams2 = null;
        }
        if (layoutParams2 instanceof ViewGroup.MarginLayoutParams) {
            marginLayoutParams = layoutParams2;
        }
        ViewGroup.MarginLayoutParams marginLayoutParams3 = marginLayoutParams;
        if (marginLayoutParams3 != null) {
            3Fl r02 = 2HV.LIZ;
            n.LIZIZ(r02, "");
            marginLayoutParams3.bottomMargin = r02.LIZ();
        }
        ES7 LJIIJ3 = LJIIJ();
        if (LJIIJ3 != null) {
            LJIIJ3.setNoticeBackgroundColor(070.LIZJ(LJIJI(), 2131099762));
        }
    }

    public final void LIZ(View view) {
        this.LJIIL = view;
        if (view != null) {
            view.post(new CjD(this, view));
        }
    }

    @ISm
    public final void onI18nRecommendUserDialogDissmissEvent(C2793DvZ dvZ) {
        M12.LIZ(dvZ);
        LJIILJJIL().LJI(ER9.LIZ);
    }

    @ISm(LIZ = ThreadMode.MAIN)
    public final void onProfilePageScrolledEvent(DGZ dgz) {
        M12.LIZ(dgz);
        ESE LJIIL2 = LJIIL();
        if (LJIIL2 != null) {
            LJIIL2.setVisibility(8);
        }
    }

    public final boolean LIZ(MyProfileGuideState myProfileGuideState) {
        M12.LIZ(myProfileGuideState);
        if (!myProfileGuideState.getNeedShowBindPhoneNumberNotice() || !EQW.LJFF.LJIIIZ()) {
            return false;
        }
        return true;
    }

    public final boolean LJ(ProfileState profileState) {
        M12.LIZ(profileState);
        if (!n.LIZ(profileState.isPostGuideShow(), false) || !LJFF(profileState)) {
            return false;
        }
        return true;
    }

    public final boolean LJI(ProfileState profileState) {
        M12.LIZ(profileState);
        if (!n.LIZ(profileState.getFrom(), "from_main") || !a.LIZJ().LIZ()) {
            return false;
        }
        return true;
    }

    public final boolean LJII(ProfileState profileState) {
        M12.LIZ(profileState);
        if (!n.LIZ(profileState.getFrom(), "from_main") || !a.LIZJ().LJFF()) {
            return false;
        }
        return true;
    }

    public final void LIZ(int i) {
        if (i == 0) {
            View view = this.LJII;
            if (view == null || view.getVisibility() != 0) {
                LJJ();
                View view2 = this.LJII;
                if (view2 != null) {
                    view2.setVisibility(i);
                    view2.setScaleX(0.8f);
                    view2.setScaleY(0.8f);
                    LJIL();
                    return;
                }
                return;
            }
            return;
        }
        View view3 = this.LJII;
        if (view3 != null) {
            view3.setVisibility(i);
            View view4 = this.LJII;
            if (view4 != null) {
                view4.clearAnimation();
            }
        }
    }

    public final boolean LJIIIIZZ(ProfileState profileState) {
        int i;
        M12.LIZ(profileState);
        try {
            i = SettingsManager.LIZ().LIZ("download_setting_enable", 0);
        } catch (4Ek unused) {
            i = 0;
        }
        if (!n.LIZ(profileState.getFrom(), "from_main") || !n.LIZ(profileState.isPostAwemeEmpty(), false) || profileState.getCurrentDownloadSetting() == null || ESC.LIZLLL() || i != 1) {
            return false;
        }
        return true;
    }

    /* JADX WARNING: type inference failed for: r6v0, types: [com.bytedance.widget.Widget, com.ss.android.ugc.aweme.profile.widgets.BaseMyProfileGuideWidget] */
    public BaseMyProfileGuideWidget(ViewGroup viewGroup) {
        M12.LIZ(viewGroup);
        this.LJ = viewGroup;
        D1G LIZ = KEM.LIZ.LIZ(MyProfileGuideViewModel.class);
        B30 b30 = new B30(this, LIZ);
        this.LJIJ = new WidgetLifecycleAwareLazy(this, b30, new B2z(this, b30, LIZ, ERK.INSTANCE));
        this.LJIILJJIL = new Mjy();
    }

    public final void LIZ(boolean z) {
        Keva repo = Keva.getRepo("account_security_keva_name");
        M12.LIZ("prior_to_safe_info");
        StringBuilder sb = new StringBuilder();
        sb.append("prior_to_safe_info");
        sb.append('_');
        IAccountUserService LJFF = 46i.LJFF();
        n.LIZIZ(LJFF, "");
        sb.append(LJFF.getCurUserId());
        repo.storeBoolean(sb.toString(), z);
        C3974EYw.LIZ.postSafeInfoNoticeEvent(z);
    }

    public final void LIZIZ(ES7 es7) {
        M12.LIZ(es7);
        es7.setIconImage(2131233577);
        es7.setTitleText(2131832292);
        String string = LJIJI().getString(2131832287);
        n.LIZIZ(string, "");
        SpannableString spannableString = new SpannableString(new Lf3("(.)").replace(string, "⁠"));
        spannableString.setSpan(new ForegroundColorSpan(070.LIZJ(LJIJI(), 2131099698)), 0, spannableString.length(), 18);
        spannableString.setSpan(new StyleSpan(1), 0, spannableString.length(), 18);
        es7.setTitleText((CharSequence) new SpannableStringBuilder(LJIJI().getString(2131832292)).append(spannableString));
        es7.setOnInternalClickListener(new ER4(this, es7));
        es7.setVisibility(0);
    }

    public final boolean LIZJ(ProfileState profileState) {
        UgProfileActivityButton profileActivityButton;
        String h5Link;
        M12.LIZ(profileState);
        if (n.LIZ(profileState.getFrom(), "from_main")) {
            Boolean bool = C3774ERe.LIZ;
            n.LIZIZ(bool, "");
            if (bool.booleanValue() && !ESC.LIZLLL()) {
                C3794ERy LIZ = C3794ERy.LIZ();
                n.LIZIZ(LIZ, "");
                if (!LIZ.LIZJ()) {
                    C3794ERy LIZ2 = C3794ERy.LIZ();
                    if (LIZ2.LIZJ.contains("show_bubble") && !LIZ2.LIZJ.getBoolean("show_bar", false)) {
                        try {
                            IESSettingsProxy iESSettingsProxy = 2OR.LIZ.LIZIZ;
                            n.LIZIZ(iESSettingsProxy, "");
                            UgAwemeActivitySetting awemeActivitySetting = iESSettingsProxy.getAwemeActivitySetting();
                            if (awemeActivitySetting == null || (profileActivityButton = awemeActivitySetting.getProfileActivityButton()) == null || (h5Link = profileActivityButton.getH5Link()) == null || h5Link.length() == 0) {
                                return false;
                            }
                            return true;
                        } catch (4Ek unused) {
                        }
                    }
                }
            }
        }
        return false;
    }

    public final boolean LIZLLL(ProfileState profileState) {
        boolean z;
        ViewerEntranceInfo viewerEntranceInfo;
        M12.LIZ(profileState);
        boolean LIZJ = ES0.LIZIZ.LIZJ();
        User user = profileState.getUser();
        if (user == null || (viewerEntranceInfo = user.viewerEntranceInfo) == null) {
            z = false;
        } else {
            z = viewerEntranceInfo.getCanShowEntrance();
        }
        IAccountUserService LJFF = 46i.LJFF();
        n.LIZIZ(LJFF, "");
        boolean isLogin = LJFF.isLogin();
        boolean z2 = Keva.getRepo("keva_repo_profile_viewer").getBoolean(4Q6.LIZ.LIZ("profile_entrance_tips_has_show"), false);
        boolean LIZ = n.LIZ(profileState.getFrom(), "from_main");
        if (!LIZJ || !z || !isLogin || z2 || !LIZ) {
            return false;
        }
        return true;
    }

    public final boolean LIZIZ(ProfileState profileState) {
        M12.LIZ(profileState);
        if (!n.LIZ(profileState.getFrom(), "from_main")) {
            return false;
        }
        IAccountUserService LJFF = 46i.LJFF();
        n.LIZIZ(LJFF, "");
        if (!LJFF.isLogin()) {
            return false;
        }
        IAccountUserService LJFF2 = 46i.LJFF();
        n.LIZIZ(LJFF2, "");
        User curUser = LJFF2.getCurUser();
        n.LIZIZ(curUser, "");
        if (!curUser.isSecret()) {
            return false;
        }
        SharePrefCache inst = SharePrefCache.inst();
        n.LIZIZ(inst, "");
        2sK shouldShowPrivateAccountTipInProfile = inst.getShouldShowPrivateAccountTipInProfile();
        n.LIZIZ(shouldShowPrivateAccountTipInProfile, "");
        Object LIZLLL = shouldShowPrivateAccountTipInProfile.LIZLLL();
        n.LIZIZ(LIZLLL, "");
        if (((Boolean) LIZLLL).booleanValue()) {
            return true;
        }
        return false;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:9:0x0037, code lost:
        if (r0.getAwemeCount() == 0) goto L_0x004b;
     */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final boolean LJFF(com.ss.android.ugc.aweme.profile.viewmodel.ProfileState r4) {
        /*
            r3 = this;
            X.M12.LIZ(r4)
            boolean r0 = X.ESC.LIZLLL()
            if (r0 != 0) goto L_0x005e
            java.lang.String r1 = r4.getFrom()
            java.lang.String r0 = "from_main"
            boolean r0 = kotlin.h.b.n.LIZ(r1, r0)
            if (r0 == 0) goto L_0x005e
            java.lang.Boolean r1 = r4.isPostAwemeEmpty()
            r2 = 1
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r2)
            boolean r0 = kotlin.h.b.n.LIZ(r1, r0)
            if (r0 == 0) goto L_0x0039
            com.ss.android.ugc.aweme.IAccountUserService r1 = X.46i.LJFF()
            java.lang.String r0 = ""
            kotlin.h.b.n.LIZIZ(r1, r0)
            com.ss.android.ugc.aweme.profile.model.User r0 = r1.getCurUser()
            if (r0 == 0) goto L_0x0039
            int r0 = r0.getAwemeCount()
            if (r0 == 0) goto L_0x004b
        L_0x0039:
            boolean r0 = X.C3777ERh.LIZ
            if (r0 == 0) goto L_0x005e
            java.lang.Boolean r1 = r4.isPostAwemeEmptyWhenPrivateShow()
            java.lang.Boolean r0 = java.lang.Boolean.valueOf(r2)
            boolean r0 = kotlin.h.b.n.LIZ(r1, r0)
            if (r0 == 0) goto L_0x005e
        L_0x004b:
            X.EQW r0 = X.EQW.LJFF
            boolean r0 = r0.LJFF()
            if (r0 == 0) goto L_0x005e
            com.ss.android.ugc.aweme.compliance.api.services.banappeal.IBanAppealService r0 = com.ss.android.ugc.aweme.compliance.api.a.LIZJ()
            boolean r0 = r0.LIZ(r2)
            if (r0 != 0) goto L_0x005e
            return r2
        L_0x005e:
            r0 = 0
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.profile.widgets.BaseMyProfileGuideWidget.LJFF(com.ss.android.ugc.aweme.profile.viewmodel.ProfileState):boolean");
    }

    public final boolean LIZ(ProfileState profileState) {
        M12.LIZ(profileState);
        if ((!n.LIZ(profileState.getFrom(), "from_main")) || !ESC.LIZLLL()) {
            return false;
        }
        IAccountUserService LJFF = 46i.LJFF();
        n.LIZIZ(LJFF, "");
        User curUser = LJFF.getCurUser();
        n.LIZIZ(curUser, "");
        if (curUser.getUserPeriod() != 1) {
            return false;
        }
        4vE r0 = 3hr.LIZ;
        n.LIZIZ(r0, "");
        2sK LJIJ2 = r0.LJIJ();
        n.LIZIZ(LJIJ2, "");
        Long l = (Long) LJIJ2.LIZLLL();
        if (l == null || l.longValue() != 0) {
            long currentTimeMillis = System.currentTimeMillis();
            n.LIZIZ(l, "");
            if (currentTimeMillis - l.longValue() > TimeUnit.DAYS.toMillis(30)) {
                return false;
            }
        }
        4vE r02 = 3hr.LIZ;
        n.LIZIZ(r02, "");
        2sK LJIIZILJ2 = r02.LJIIZILJ();
        n.LIZIZ(LJIIZILJ2, "");
        Long l2 = (Long) LJIIZILJ2.LIZLLL();
        long currentTimeMillis2 = System.currentTimeMillis();
        n.LIZIZ(l2, "");
        if (currentTimeMillis2 - l2.longValue() > TimeUnit.DAYS.toMillis(1)) {
            return true;
        }
        return false;
    }

    public final boolean LIZIZ(ProfileState profileState, MyProfileGuideState myProfileGuideState) {
        M12.LIZ(profileState, myProfileGuideState);
        if (!n.LIZ(profileState.getFrom(), "from_main") || a.LJIILJJIL().LIZ() || !C3784ERo.LIZ(myProfileGuideState.getSurveyData())) {
            return false;
        }
        return true;
    }

    public final void LIZ(ES7 es7, MyProfileGuideState myProfileGuideState) {
        M12.LIZ(es7, myProfileGuideState);
        String string = LJIJI().getString(2131830873);
        n.LIZIZ(string, "");
        String string2 = LJIJI().getString(2131830874);
        n.LIZIZ(string2, "");
        es7.setIconImage(2131233581);
        es7.setTitleText(2131830873);
        SpannableString spannableString = new SpannableString(string);
        ER5 er5 = new ER5(this, es7, myProfileGuideState);
        int LIZ = z.LIZ(string, string2, 0, false, 6);
        if (LIZ < 0) {
            LIZ = string.length();
        }
        spannableString.setSpan(er5, LIZ, string.length(), 17);
        es7.setTitleText((CharSequence) spannableString);
        TextView textView = (TextView) es7.findViewById(2131372426);
        if (textView != null) {
            textView.setMovementMethod(LinkMovementMethod.getInstance());
        }
        View findViewById = es7.findViewById(2131371276);
        if (findViewById != null) {
            findViewById.setClickable(false);
        }
        es7.setOnInternalClickListener(new ERX(es7));
        C3973EYv.LIZ.setPrivateSettingItem("download_prompt", 1).LIZ(ERO.LIZ, ER7.LIZ);
        LIZ((View) es7);
    }

    /* JADX WARNING: type inference failed for: r14v0, types: [X.DV1, com.ss.android.ugc.aweme.profile.widgets.BaseMyProfileGuideWidget, com.ss.android.ugc.aweme.profile.widgets.ProfileWidget] */
    public final void LIZ(ESE ese, ProfileState profileState, MyProfileGuideState myProfileGuideState) {
        MyProfileGuideState myProfileGuideState2 = myProfileGuideState;
        M12.LIZ(ese, profileState, myProfileGuideState2);
        ese.setOnInternalClickListener(new C3746EQc(this, ese));
        Resources system = Resources.getSystem();
        n.LIZIZ(system, "");
        int LIZ = LnI.LIZ(TypedValue.applyDimension(1, 16.0f, system.getDisplayMetrics()));
        Resources system2 = Resources.getSystem();
        n.LIZIZ(system2, "");
        int LIZ2 = LnI.LIZ(TypedValue.applyDimension(1, 4.0f, system2.getDisplayMetrics()));
        Resources system3 = Resources.getSystem();
        n.LIZIZ(system3, "");
        int LIZ3 = LnI.LIZ(TypedValue.applyDimension(1, 88.0f, system3.getDisplayMetrics()));
        Resources system4 = Resources.getSystem();
        n.LIZIZ(system4, "");
        int LIZ4 = LnI.LIZ(TypedValue.applyDimension(1, 16.0f, system4.getDisplayMetrics()));
        LinearLayout linearLayout = (LinearLayout) ese.LIZIZ(2131371276);
        n.LIZIZ(linearLayout, "");
        Qen.LIZIZ(linearLayout, Integer.valueOf(LIZ), (Integer) null, Integer.valueOf(LIZ2), (Integer) null, false, 26);
        ese.LIZIZ(2131366372).setTuxFont(61);
        NuY LIZIZ = ese.LIZIZ(2131366326);
        n.LIZIZ(LIZIZ, "");
        ViewGroup.LayoutParams layoutParams = LIZIZ.getLayoutParams();
        if (layoutParams != null) {
            layoutParams.width = LIZ3;
            LIZIZ.setLayoutParams(layoutParams);
            ImageView imageView = (ImageView) ese.LIZIZ(2131366353);
            n.LIZIZ(imageView, "");
            imageView.setPadding(LIZ2, LIZ2, LIZ2, LIZ2);
            imageView.setImageDrawable(2xd.LIZ(new B31(this, LIZ2, LIZ4)).LIZ(LJIJI()));
            ImageView imageView2 = (ImageView) ese.LIZIZ(2131366481);
            n.LIZIZ(imageView2, "");
            imageView2.setVisibility(8);
            4Dd.LIZ(selectSubscribe(LJIJJ(), DJU.LIZ, C2978DyY.LIZ, DUS.LIZ(), new C3747EQd(this, ese, myProfileGuideState2)), this.LJIILJJIL);
            return;
        }
        throw new 7xU("null cannot be cast to non-null type android.view.ViewGroup.LayoutParams");
    }
}
