得物.apk(点击下载) / RedPacRainViewXp.java


package com.shizhuang.duapp.modules.live.common.doubleele;

import a.f;
import android.animation.Animator;
import android.content.Context;
import android.graphics.LinearGradient;
import android.graphics.Shader;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import com.lxj.xpopup.core.BasePopupView;
import com.lxj.xpopup.core.CenterPopupView;
import com.lxj.xpopup.enums.PopupType;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.bean.UsersModel;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.view.AvatarLayout;
import com.shizhuang.duapp.common.widget.font.FontText;
import com.shizhuang.duapp.libs.animation.DuAnimationView;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.dulogger.Printer;
import com.shizhuang.duapp.libs.yeezy.Yeezy;
import com.shizhuang.duapp.modules.live.audience.detail.viewmodel.RedPacViewModel;
import com.shizhuang.duapp.modules.live.common.doubleele.RedPacRainFollowView;
import com.shizhuang.duapp.modules.live.common.doubleele.model.RedPacRainModel;
import com.shizhuang.duapp.modules.live.common.model.live.message.RedPacRainDataModel;
import com.shizhuang.duapp.modules.live.common.widget.SimpleAnimationListener;
import com.shizhuang.duapp.modules.live.common.widget.view.CircularProgressView;
import df.b0;
import java.util.HashMap;
import java.util.List;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import ln0.j;
import ln0.k;
import o5.i;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@Metadata(bv = {}, d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0018\u0002\n\u0002\b\u000e\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0005\u0018\u00002\u00020\u0001:\u0001.B\u000f\u0012\u0006\u0010+\u001a\u00020*¢\u0006\u0004\b,\u0010-J\b\u0010\u0003\u001a\u00020\u0002H\u0014J\b\u0010\u0004\u001a\u00020\u0002H\u0014J\b\u0010\u0005\u001a\u00020\u0002H\u0014J\u0010\u0010\b\u001a\u00020\u00072\u0006\u0010\u0006\u001a\u00020\u0002H\u0002R?\u0010\u0014\u001a\u001f\u0012\u0015\u0012\u0013\u0018\u00010\n¢\u0006\f\b\u000b\u0012\b\b\f\u0012\u0004\b\b(\r\u0012\u0004\u0012\u00020\u00070\t8\u0006@\u0006X†\u000e¢\u0006\u0012\n\u0004\b\u000e\u0010\u000f\u001a\u0004\b\u0010\u0010\u0011\"\u0004\b\u0012\u0010\u0013R$\u0010\u001c\u001a\u0004\u0018\u00010\u00158\u0006@\u0006X†\u000e¢\u0006\u0012\n\u0004\b\u0016\u0010\u0017\u001a\u0004\b\u0018\u0010\u0019\"\u0004\b\u001a\u0010\u001bR.\u0010\r\u001a\u0004\u0018\u00010\n2\b\u0010\u001d\u001a\u0004\u0018\u00010\n8\u0006@FX†\u000e¢\u0006\u0012\n\u0004\b\u001e\u0010\u001f\u001a\u0004\b \u0010!\"\u0004\b\"\u0010#R\u001b\u0010)\u001a\u00020$8FX†„\u0002¢\u0006\f\n\u0004\b%\u0010&\u001a\u0004\b'\u0010(¨\u0006/"}, d2 = {"Lcom/shizhuang/duapp/modules/live/common/doubleele/RedPacRainViewXp;", "Lcom/lxj/xpopup/core/CenterPopupView;", "", "getImplLayoutId", "getMaxWidth", "getMaxHeight", "position", "", "setProgressIcon", "Lkotlin/Function1;", "Lcom/shizhuang/duapp/modules/live/common/doubleele/model/RedPacRainModel;", "Lkotlin/ParameterName;", "name", "redPacRainModel", "x", "Lkotlin/jvm/functions/Function1;", "getOnCountDownEnd", "()Lkotlin/jvm/functions/Function1;", "setOnCountDownEnd", "(Lkotlin/jvm/functions/Function1;)V", "onCountDownEnd", "Lcom/shizhuang/duapp/modules/live/audience/detail/viewmodel/RedPacViewModel;", "B", "Lcom/shizhuang/duapp/modules/live/audience/detail/viewmodel/RedPacViewModel;", "getRedPacViewModel", "()Lcom/shizhuang/duapp/modules/live/audience/detail/viewmodel/RedPacViewModel;", "setRedPacViewModel", "(Lcom/shizhuang/duapp/modules/live/audience/detail/viewmodel/RedPacViewModel;)V", "redPacViewModel", "value", "C", "Lcom/shizhuang/duapp/modules/live/common/doubleele/model/RedPacRainModel;", "getRedPacRainModel", "()Lcom/shizhuang/duapp/modules/live/common/doubleele/model/RedPacRainModel;", "setRedPacRainModel", "(Lcom/shizhuang/duapp/modules/live/common/doubleele/model/RedPacRainModel;)V", "Lcom/shizhuang/duapp/libs/animation/DuAnimationView;", "E", "Lkotlin/Lazy;", "getRedPacRainAnim", "()Lcom/shizhuang/duapp/libs/animation/DuAnimationView;", "redPacRainAnim", "Landroid/content/Context;", "context", "<init>", "(Landroid/content/Context;)V", "a", "du_live_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: RedPacRainViewXp.kt */
public final class RedPacRainViewXp extends CenterPopupView {
    @NotNull
    public static final a J = new a(null);
    public static ChangeQuickRedirect changeQuickRedirect;
    public Integer A = -1;
    @Nullable
    public RedPacViewModel B;
    @Nullable
    public RedPacRainModel C;
    public final List<Integer> D = CollectionsKt__CollectionsKt.listOf((Object[]) new Integer[]{Integer.valueOf((int) R.drawable.live_red_pac_process_1), Integer.valueOf((int) R.drawable.live_red_pac_process_2), Integer.valueOf((int) R.drawable.live_red_pac_process_3), Integer.valueOf((int) R.drawable.live_red_pac_process_4), Integer.valueOf((int) R.drawable.live_red_pac_process_5)});
    @NotNull
    public final Lazy E;
    public int F;
    public int G;
    public final c H;
    public HashMap I;
    public boolean w = true;
    @NotNull
    public Function1<? super RedPacRainModel, Unit> x = RedPacRainViewXp$onCountDownEnd$1.INSTANCE;
    public int y;
    public UsersModel z;

    /* compiled from: RedPacRainViewXp.kt */
    public static final class a {
        public static ChangeQuickRedirect changeQuickRedirect;

        public a(DefaultConstructorMarker defaultConstructorMarker) {
        }

        @NotNull
        public final RedPacRainViewXp a(@NotNull Context context) {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{context}, this, changeQuickRedirect, false, 192962, new Class[]{Context.class}, RedPacRainViewXp.class);
            if (proxy.isSupported) {
                return (RedPacRainViewXp) proxy.result;
            }
            ea.b bVar = new ea.b();
            bVar.n = 2;
            bVar.i = false;
            bVar.f31770a = Boolean.TRUE;
            bVar.b = Boolean.FALSE;
            bVar.j = true;
            bVar.m = true;
            RedPacRainViewXp redPacRainViewXp = new RedPacRainViewXp(context);
            PopupType popupType = PopupType.Center;
            redPacRainViewXp.b = bVar;
            return redPacRainViewXp;
        }
    }

    /* compiled from: RedPacRainViewXp.kt */
    public static final class b implements RedPacRainFollowView.IFollowJoCallback {
        public static ChangeQuickRedirect changeQuickRedirect;

        /* renamed from: a  reason: collision with root package name */
        public final /* synthetic */ RedPacRainViewXp f18292a;

        /* JADX WARN: Incorrect args count in method signature: ()V */
        public b(RedPacRainViewXp redPacRainViewXp) {
            this.f18292a = redPacRainViewXp;
        }

        @Override // com.shizhuang.duapp.modules.live.common.doubleele.RedPacRainFollowView.IFollowJoCallback
        public void onJoined() {
            String str;
            UsersModel kolUserInfo;
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192965, new Class[0], Void.TYPE).isSupported) {
                RedPacRainModel redPacRainModel = this.f18292a.getRedPacRainModel();
                if (redPacRainModel != null) {
                    redPacRainModel.setFollow(true);
                }
                this.f18292a.t();
                ((ImageView) this.f18292a.s(R.id.redPacRainClose)).setVisibility(0);
                RedPacRainModel redPacRainModel2 = this.f18292a.getRedPacRainModel();
                if (redPacRainModel2 != null) {
                    redPacRainModel2.getGameNo();
                    RedPacViewModel redPacViewModel = this.f18292a.getRedPacViewModel();
                    if (redPacViewModel != null) {
                        redPacViewModel.setNeedLoop(true);
                    }
                    RedPacViewModel redPacViewModel2 = this.f18292a.getRedPacViewModel();
                    if (redPacViewModel2 != null) {
                        RedPacRainModel redPacRainModel3 = this.f18292a.getRedPacRainModel();
                        if (redPacRainModel3 == null || (kolUserInfo = redPacRainModel3.getKolUserInfo()) == null || (str = kolUserInfo.userId) == null) {
                            str = "";
                        }
                        RedPacRainModel redPacRainModel4 = this.f18292a.getRedPacRainModel();
                        RedPacViewModel.getDouble11Num$default(redPacViewModel2, str, redPacRainModel4 != null ? redPacRainModel4.getGameNo() : 0, 0, 4, null);
                    }
                }
            }
        }
    }

    /* compiled from: RedPacRainViewXp.kt */
    public static final class c implements SimpleAnimationListener {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ RedPacRainViewXp b;

        /* JADX WARN: Incorrect args count in method signature: ()V */
        public c(RedPacRainViewXp redPacRainViewXp) {
            this.b = redPacRainViewXp;
        }

        @Override // com.shizhuang.duapp.modules.live.common.widget.SimpleAnimationListener
        public void onAnimationCancel(@Nullable Animator animator) {
            if (!PatchProxy.proxy(new Object[]{animator}, this, changeQuickRedirect, false, 192969, new Class[]{Animator.class}, Void.TYPE).isSupported) {
                onAnimationEnd(animator);
            }
        }

        @Override // com.shizhuang.duapp.modules.live.common.widget.SimpleAnimationListener
        public void onAnimationEnd(@Nullable Animator animator) {
            if (!PatchProxy.proxy(new Object[]{animator}, this, changeQuickRedirect, false, 192970, new Class[]{Animator.class}, Void.TYPE).isSupported) {
                this.b.s(R.id.redPacPlus1).setVisibility(8);
                this.b.s(R.id.redPacPlus1).setTranslationY(i.f36333a);
            }
        }

        @Override // com.shizhuang.duapp.modules.live.common.widget.SimpleAnimationListener
        public void onAnimationRepeat(@Nullable Animator animator) {
            if (!PatchProxy.proxy(new Object[]{animator}, this, changeQuickRedirect, false, 192972, new Class[]{Animator.class}, Void.TYPE).isSupported) {
                SimpleAnimationListener.a.c(this, animator);
            }
        }

        @Override // com.shizhuang.duapp.modules.live.common.widget.SimpleAnimationListener
        public void onAnimationStart(@Nullable Animator animator) {
            if (!PatchProxy.proxy(new Object[]{animator}, this, changeQuickRedirect, false, 192971, new Class[]{Animator.class}, Void.TYPE).isSupported) {
                SimpleAnimationListener.a.d(this, animator);
            }
        }
    }

    public RedPacRainViewXp(@NotNull Context context) {
        super(context);
        this.E = LazyKt__LazyJVMKt.lazy(new RedPacRainViewXp$redPacRainAnim$2(context));
        this.G = 1;
        this.H = new c(this);
    }

    @Override // com.lxj.xpopup.core.BasePopupView
    public void a() {
        FrameLayout frameLayout;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192946, new Class[0], Void.TYPE).isSupported && !PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192959, new Class[0], Void.TYPE).isSupported && (frameLayout = (FrameLayout) s(R.id.redPacRainAnimFl)) != null) {
            frameLayout.removeView(getRedPacRainAnim());
        }
    }

    @Override // com.lxj.xpopup.core.BasePopupView
    public void b() {
        RedPacRainDataModel entryModel;
        RedPacRainDataModel entryModel2;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192942, new Class[0], Void.TYPE).isSupported) {
            t();
            RedPacRainModel redPacRainModel = this.C;
            if (redPacRainModel != null && (entryModel = redPacRainModel.getEntryModel()) != null) {
                int countDown = entryModel.getCountDown();
                RedPacRainModel redPacRainModel2 = this.C;
                if (redPacRainModel2 != null && (entryModel2 = redPacRainModel2.getEntryModel()) != null) {
                    int fullCount = entryModel2.getFullCount();
                    if (fullCount == 0) {
                        fullCount = 1;
                    }
                    CircularProgressView circularProgressView = (CircularProgressView) s(R.id.redPacCountProcess);
                    if (circularProgressView != null) {
                        circularProgressView.setProgress(((float) countDown) / ((float) fullCount));
                    }
                    CircularProgressView circularProgressView2 = (CircularProgressView) s(R.id.redPacCountProcess);
                    if (circularProgressView2 != null) {
                        circularProgressView2.a(i.f36333a, ((long) countDown) * 1000);
                    }
                }
            }
        }
    }

    @Override // com.lxj.xpopup.core.BasePopupView, com.lxj.xpopup.core.CenterPopupView
    public int getImplLayoutId() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192939, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.live_red_pac_rain_layout;
    }

    @Override // com.lxj.xpopup.core.BasePopupView
    public int getMaxHeight() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192948, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : jr.b.a(getContext());
    }

    @Override // com.lxj.xpopup.core.BasePopupView, com.lxj.xpopup.core.CenterPopupView
    public int getMaxWidth() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192947, new Class[0], Integer.TYPE);
        if (proxy.isSupported) {
            return ((Integer) proxy.result).intValue();
        }
        return 0;
    }

    /* JADX DEBUG: Type inference failed for r0v2. Raw type applied. Possible types: kotlin.jvm.functions.Function1<? super com.shizhuang.duapp.modules.live.common.doubleele.model.RedPacRainModel, kotlin.Unit>, kotlin.jvm.functions.Function1<com.shizhuang.duapp.modules.live.common.doubleele.model.RedPacRainModel, kotlin.Unit> */
    @NotNull
    public final Function1<RedPacRainModel, Unit> getOnCountDownEnd() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192932, new Class[0], Function1.class);
        return proxy.isSupported ? (Function1) proxy.result : this.x;
    }

    @NotNull
    public final DuAnimationView getRedPacRainAnim() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192938, new Class[0], DuAnimationView.class);
        return (DuAnimationView) (proxy.isSupported ? proxy.result : this.E.getValue());
    }

    @Nullable
    public final RedPacRainModel getRedPacRainModel() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192936, new Class[0], RedPacRainModel.class);
        return proxy.isSupported ? (RedPacRainModel) proxy.result : this.C;
    }

    @Nullable
    public final RedPacViewModel getRedPacViewModel() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192934, new Class[0], RedPacViewModel.class);
        return proxy.isSupported ? (RedPacViewModel) proxy.result : this.B;
    }

    @Override // com.lxj.xpopup.core.BasePopupView
    public void o() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192945, new Class[0], Void.TYPE).isSupported) {
            ((ImageView) s(R.id.redPacRainClose)).setVisibility(0);
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192949, new Class[0], Void.TYPE).isSupported) {
                ((ConstraintLayout) s(R.id.redPacClick)).setOnClickListener(new RedPacRainViewXp$redPacViewClick$1(this));
            }
            Object[] objArr = {"0"};
            h.a.w(objArr, 1, ViewExtensionKt.u(this, R.string.red_pac_join_count), (TextView) s(R.id.redPacCount));
        }
    }

    @Override // com.lxj.xpopup.core.BasePopupView
    public void onCreate() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192941, new Class[0], Void.TYPE).isSupported) {
            CircularProgressView circularProgressView = (CircularProgressView) s(R.id.redPacCountProcess);
            Object[] objArr = {new Integer((int) R.color.white), new Integer((int) R.color.color_blue_01c2c3)};
            ChangeQuickRedirect changeQuickRedirect2 = CircularProgressView.changeQuickRedirect;
            Class cls = Integer.TYPE;
            if (!PatchProxy.proxy(objArr, circularProgressView, changeQuickRedirect2, false, 203332, new Class[]{cls, cls}, Void.TYPE).isSupported) {
                circularProgressView.e = new int[]{ContextCompat.getColor(circularProgressView.getContext(), R.color.white), ContextCompat.getColor(circularProgressView.getContext(), R.color.color_blue_01c2c3)};
                circularProgressView.f18810c.setShader(new LinearGradient((float) i.f36333a, (float) i.f36333a, (float) i.f36333a, (float) circularProgressView.getMeasuredWidth(), circularProgressView.e, (float[]) null, Shader.TileMode.MIRROR));
                circularProgressView.invalidate();
            }
            ViewExtensionKt.i((ImageView) s(R.id.redPacRainClose), 500, new RedPacRainViewXp$onCreate$1(this));
            ConstraintLayout constraintLayout = (ConstraintLayout) s(R.id.redPacClick);
            if (!PatchProxy.proxy(new Object[]{constraintLayout, new Float(0.9f), new Long(50)}, null, k.changeQuickRedirect, true, 193179, new Class[]{View.class, Float.TYPE, Long.TYPE}, Void.TYPE).isSupported) {
                constraintLayout.setOnTouchListener(new j(constraintLayout, 0.9f, 50));
            }
            ((RedPacRainFollowView) s(R.id.redPacRainFollowView)).setFollowCallback(new b(this));
        }
    }

    @Override // com.lxj.xpopup.core.BasePopupView
    @NotNull
    public BasePopupView p() {
        RedPacRainModel redPacRainModel;
        RedPacRainDataModel entryModel;
        RedPacRainDataModel entryModel2;
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192957, new Class[0], BasePopupView.class);
        if (proxy.isSupported) {
            return (BasePopupView) proxy.result;
        }
        super.p();
        if (!(PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192954, new Class[0], Void.TYPE).isSupported || (redPacRainModel = this.C) == null || (entryModel = redPacRainModel.getEntryModel()) == null)) {
            int countDown = entryModel.getCountDown();
            RedPacRainModel redPacRainModel2 = this.C;
            if (!(redPacRainModel2 == null || (entryModel2 = redPacRainModel2.getEntryModel()) == null)) {
                int fullCount = entryModel2.getFullCount();
                if (fullCount == 0) {
                    fullCount = 1;
                }
                CircularProgressView circularProgressView = (CircularProgressView) s(R.id.redPacCountProcess);
                if (circularProgressView != null) {
                    circularProgressView.setProgress(((float) countDown) / ((float) fullCount));
                }
                RedPacViewModel redPacViewModel = this.B;
                if (redPacViewModel != null) {
                    redPacViewModel.startCountDown(((long) (fullCount - countDown)) * 1000, ((long) fullCount) * 1000, 1000, new RedPacRainViewXp$showCountDown$1(this));
                }
            }
        }
        sq0.a.a();
        return this;
    }

    @Override // com.lxj.xpopup.core.CenterPopupView
    public void q() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192940, new Class[0], Void.TYPE).isSupported) {
            FrameLayout frameLayout = this.f5340u;
            ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) frameLayout.getLayoutParams();
            marginLayoutParams.height = -1;
            frameLayout.setLayoutParams(marginLayoutParams);
            super.q();
        }
    }

    public View s(int i) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 192960, new Class[]{Integer.TYPE}, View.class);
        if (proxy.isSupported) {
            return (View) proxy.result;
        }
        if (this.I == null) {
            this.I = new HashMap();
        }
        View view = (View) this.I.get(Integer.valueOf(i));
        if (view != null) {
            return view;
        }
        View findViewById = findViewById(i);
        this.I.put(Integer.valueOf(i), findViewById);
        return findViewById;
    }

    public final void setOnCountDownEnd(@NotNull Function1<? super RedPacRainModel, Unit> function1) {
        if (!PatchProxy.proxy(new Object[]{function1}, this, changeQuickRedirect, false, 192933, new Class[]{Function1.class}, Void.TYPE).isSupported) {
            this.x = function1;
        }
    }

    public final void setProgressIcon(int i) {
        if (!PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 192952, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
            DuImageLoaderView duImageLoaderView = (DuImageLoaderView) s(R.id.redPacProcessIcon);
            ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) duImageLoaderView.getLayoutParams();
            layoutParams.dimensionRatio = i > 2 ? "h,750:320" : "h,750:160";
            duImageLoaderView.setLayoutParams(layoutParams);
            ((DuImageLoaderView) s(R.id.redPacProcessIcon)).h(this.D.get(i).intValue()).x();
            ((DuImageLoaderView) s(R.id.redPacProcessIcon)).setScaleX(0.3f);
            ((DuImageLoaderView) s(R.id.redPacProcessIcon)).setScaleY(0.3f);
            ((DuImageLoaderView) s(R.id.redPacProcessIcon)).animate().scaleX(1.0f).scaleY(1.0f).setDuration(200).start();
        }
    }

    public final void setRedPacRainModel(@Nullable RedPacRainModel redPacRainModel) {
        if (!PatchProxy.proxy(new Object[]{redPacRainModel}, this, changeQuickRedirect, false, 192937, new Class[]{RedPacRainModel.class}, Void.TYPE).isSupported) {
            this.C = redPacRainModel;
            if (redPacRainModel != null) {
                Integer num = this.A;
                int gameNo = redPacRainModel.getGameNo();
                if (num == null || num.intValue() != gameNo) {
                    this.A = Integer.valueOf(redPacRainModel.getGameNo());
                    this.z = redPacRainModel.getKolUserInfo();
                }
            }
        }
    }

    public final void setRedPacViewModel(@Nullable RedPacViewModel redPacViewModel) {
        if (!PatchProxy.proxy(new Object[]{redPacViewModel}, this, changeQuickRedirect, false, 192935, new Class[]{RedPacViewModel.class}, Void.TYPE).isSupported) {
            this.B = redPacViewModel;
        }
    }

    public final void t() {
        RedPacRainDataModel entryModel;
        Integer actType;
        RedPacRainDataModel entryModel2;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192953, new Class[0], Void.TYPE).isSupported) {
            Printer u4 = fo.a.u("RedPacRainViewXp");
            StringBuilder h12 = f.h("initStatus");
            RedPacRainModel redPacRainModel = this.C;
            Integer num = null;
            h12.append(redPacRainModel != null ? Integer.valueOf(redPacRainModel.getGameNo()) : null);
            u4.d(h12.toString(), new Object[0]);
            RedPacRainModel redPacRainModel2 = this.C;
            if (redPacRainModel2 != null) {
                boolean isFollow = redPacRainModel2.isFollow();
                RedPacRainModel redPacRainModel3 = this.C;
                if (redPacRainModel3 != null) {
                    this.A = Integer.valueOf(redPacRainModel3.getGameNo());
                    StringBuilder sb2 = new StringBuilder();
                    jn0.a aVar = jn0.a.f34397a;
                    RedPacRainModel redPacRainModel4 = this.C;
                    int i = 1;
                    sb2.append(aVar.a(redPacRainModel4 != null ? redPacRainModel4.getActType() : 1));
                    sb2.append(this.A);
                    String sb3 = sb2.toString();
                    Boolean bool = Boolean.FALSE;
                    Boolean bool2 = (Boolean) b0.f(sb3, bool);
                    if (!isFollow || !bool2.booleanValue()) {
                        u(true);
                        RedPacRainFollowView redPacRainFollowView = (RedPacRainFollowView) s(R.id.redPacRainFollowView);
                        RedPacRainModel redPacRainModel5 = this.C;
                        if (!PatchProxy.proxy(new Object[]{redPacRainModel5}, redPacRainFollowView, RedPacRainFollowView.changeQuickRedirect, false, 192916, new Class[]{RedPacRainModel.class}, Void.TYPE).isSupported) {
                            redPacRainFollowView.b = redPacRainModel5;
                            if (redPacRainModel5 != null) {
                                ((AvatarLayout) redPacRainFollowView.a(R.id.ivRedRainAvatar)).c(redPacRainModel5.getKolUserInfo());
                                ((DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainAvatarFrame)).g(redPacRainModel5.getKolUserInfo().avatarFrame);
                                ((TextView) redPacRainFollowView.a(R.id.tvRedPacKolName)).setText(redPacRainModel5.getKolUserInfo().userName);
                                boolean isFollow2 = redPacRainModel5.isFollow();
                                StringBuilder sb4 = new StringBuilder();
                                RedPacRainDataModel entryModel3 = redPacRainModel5.getEntryModel();
                                if (!(entryModel3 == null || (actType = entryModel3.getActType()) == null)) {
                                    i = actType.intValue();
                                }
                                sb4.append(aVar.a(i));
                                sb4.append(redPacRainModel5.getGameNo());
                                Boolean bool3 = (Boolean) b0.f(sb4.toString(), bool);
                                if (!isFollow2) {
                                    ((TextView) redPacRainFollowView.a(R.id.tvRedRainFollow)).setText("关注主播并参与");
                                } else if (!bool3.booleanValue()) {
                                    ((TextView) redPacRainFollowView.a(R.id.tvRedRainFollow)).setText("参与活动");
                                }
                                mq0.b.c("community_live_activity_exposure", "876", null, new RedPacRainFollowView$bindData$1(redPacRainFollowView), 4);
                                RedPacRainModel redPacRainModel6 = redPacRainFollowView.b;
                                if (!(redPacRainModel6 == null || (entryModel = redPacRainModel6.getEntryModel()) == null)) {
                                    num = entryModel.getActType();
                                }
                                if (num != null && num.intValue() == 2) {
                                    ((DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainHomeBg)).i("https://apk.poizon.com/duApp/Android_Config/resource/live/img/redpac/bg_pk_mic_right_mantle_year.png").x();
                                    ((DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainTitle)).setVisibility(0);
                                    ((DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainTitle)).h(R.drawable.live_anchor_year_red_pac_title_icon).y().x();
                                } else if (num != null && num.intValue() == 5) {
                                    ((DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainHomeBg)).i("https://apk.poizon.com/duApp/Android_Config/resource/live/img/redpac/bg_pk_mic_right_mantle_year.png").x();
                                    ((DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainTitle)).setVisibility(0);
                                    ((DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainTitle)).h(R.drawable.du_live_red_pac_520_title_bg).y().x();
                                } else if (num != null && num.intValue() == 4) {
                                    ((DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainHomeBg)).i("https://apk.poizon.com/duApp/Android_Config/resource/live/img/redpac/bg_pk_mic_right_mantle_year.png").x();
                                    ((DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainTitle)).setVisibility(0);
                                    DuImageLoaderView duImageLoaderView = (DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainTitle);
                                    ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) duImageLoaderView.getLayoutParams();
                                    marginLayoutParams.height = fi.b.b((float) 53);
                                    marginLayoutParams.width = -2;
                                    duImageLoaderView.setLayoutParams(marginLayoutParams);
                                    ((DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainTitle)).h(R.drawable.live_red_pac_title_icon).y().x();
                                } else {
                                    ((DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainTitle)).setVisibility(8);
                                    ((DuImageLoaderView) redPacRainFollowView.a(R.id.ivRedRainHomeBg)).g("https://apk.poizon.com/duApp/Android_Config/live/pk/bg_red_pac_rain_home.png");
                                }
                            }
                        }
                    } else {
                        u(false);
                        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192943, new Class[0], Void.TYPE).isSupported) {
                            RedPacRainModel redPacRainModel7 = this.C;
                            if (!(redPacRainModel7 == null || (entryModel2 = redPacRainModel7.getEntryModel()) == null)) {
                                num = entryModel2.getActType();
                            }
                            Yeezy.Companion.load(false, getContext(), new RedPacRainViewXp$playRobAnim$1(this), RedPacRainViewXp$playRobAnim$2.INSTANCE, (num != null && num.intValue() == 1) ? "7e15f7644763f483d9d17ccc2103eee6" : "f97bf4b6b0375155a326dfaca3355f77");
                        }
                        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 192944, new Class[0], Void.TYPE).isSupported && this.f5330g && this.C != null) {
                            ((ImageView) s(R.id.redPacRainClose)).setVisibility(8);
                            setProgressIcon(0);
                            UsersModel usersModel = this.z;
                            if (usersModel != null) {
                                ((AvatarLayout) s(R.id.redPacKolIcon)).c(usersModel);
                                ((TextView) s(R.id.redPacKolName)).setText(usersModel.userName);
                                ((DuImageLoaderView) s(R.id.redPacKolFrame)).g(usersModel.avatarFrame);
                            }
                            s(R.id.redPacPlus1).setVisibility(8);
                            s(R.id.redPacPlus1).setTranslationY(i.f36333a);
                            this.G = 1;
                            ((FontText) s(R.id.redPacClickCount)).setText("+1");
                            v(this.y);
                        }
                    }
                    RedPacViewModel redPacViewModel = this.B;
                    if (redPacViewModel != null) {
                        redPacViewModel.setRedPacRainModel(this.C);
                    }
                }
            }
        }
    }

    public final void u(boolean z4) {
        int i = 0;
        if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 192955, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            this.w = z4;
            int i3 = 4;
            getRedPacRainAnim().setVisibility(z4 ? 4 : 0);
            ((ConstraintLayout) s(R.id.redPacClick)).setVisibility(z4 ? 4 : 0);
            s(R.id.redPacPlus1).setVisibility(z4 ? 4 : 0);
            ((FontText) s(R.id.redPacClickCount)).setVisibility(z4 ? 4 : 0);
            ((DuImageLoaderView) s(R.id.redPacProcessIcon)).setVisibility(z4 ? 4 : 0);
            DuImageLoaderView duImageLoaderView = (DuImageLoaderView) s(R.id.redPacProcessIconLarge);
            if (!z4) {
                i3 = 0;
            }
            duImageLoaderView.setVisibility(i3);
            RedPacRainFollowView redPacRainFollowView = (RedPacRainFollowView) s(R.id.redPacRainFollowView);
            if (!z4) {
                i = 8;
            }
            redPacRainFollowView.setVisibility(i);
        }
    }

    public final void v(int i) {
        if (!PatchProxy.proxy(new Object[]{new Integer(i)}, this, changeQuickRedirect, false, 192951, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
            this.y = i;
            TextView textView = (TextView) s(R.id.redPacCount);
            if (textView != null) {
                String u4 = ViewExtensionKt.u(this, R.string.red_pac_join_count);
                h.a.w(new Object[]{Integer.valueOf(i)}, 1, u4, textView);
            }
        }
    }
}