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


package com.shizhuang.duapp.modules.live.common.widget.gift;

import a.f;
import android.content.Context;
import android.graphics.drawable.GradientDrawable;
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.constraintlayout.widget.Group;
import com.lxj.xpopup.core.CenterPopupView;
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.extension.ViewExtensionKt;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.duimageloaderview.options.DuRequestOptions;
import com.shizhuang.duapp.modules.live.common.pkmic.qixi.AdaptiveSizeGroup;
import da.c;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
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 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0010\u0014\n\u0002\b\u0007\n\u0002\u0018\u0002\n\u0002\b\u0005\u0018\u00002\u00020\u0001:\u0001\"B\u000f\u0012\u0006\u0010\u001f\u001a\u00020\u001e¢\u0006\u0004\b \u0010!J\u0018\u0010\u0006\u001a\u00020\u00052\u000e\u0010\u0004\u001a\n\u0012\u0004\u0012\u00020\u0003\u0018\u00010\u0002H\u0002J\b\u0010\b\u001a\u00020\u0007H\u0014J\u000e\u0010\u000b\u001a\u00020\u00052\u0006\u0010\n\u001a\u00020\tJ\b\u0010\r\u001a\u00020\fH\u0014J\b\u0010\u000e\u001a\u00020\u0007H\u0014R*\u0010\u0015\u001a\n\u0012\u0004\u0012\u00020\u0003\u0018\u00010\u00028\u0006@\u0006X†\u000e¢\u0006\u0012\n\u0004\b\u000f\u0010\u0010\u001a\u0004\b\u0011\u0010\u0012\"\u0004\b\u0013\u0010\u0014R$\u0010\u001d\u001a\u0004\u0018\u00010\u00168\u0006@\u0006X†\u000e¢\u0006\u0012\n\u0004\b\u0017\u0010\u0018\u001a\u0004\b\u0019\u0010\u001a\"\u0004\b\u001b\u0010\u001c¨\u0006#"}, d2 = {"Lcom/shizhuang/duapp/modules/live/common/widget/gift/LiveGiftResultView;", "Lcom/lxj/xpopup/core/CenterPopupView;", "", "Lcom/shizhuang/duapp/modules/live/common/widget/gift/IGiftInfoConvert;", "gifts", "", "setGiftInfo", "", "getImplLayoutId", "Landroid/view/View$OnClickListener;", "onClickListener", "setOnCloseClickListener", "Lda/c;", "getPopupAnimator", "getMaxWidth", "w", "Ljava/util/List;", "getGiftInfos", "()Ljava/util/List;", "setGiftInfos", "(Ljava/util/List;)V", "giftInfos", "", "x", "[F", "getDismissLocation", "()[F", "setDismissLocation", "([F)V", "dismissLocation", "Landroid/content/Context;", "context", "<init>", "(Landroid/content/Context;)V", "a", "du_live_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: LiveGiftResultView.kt */
public final class LiveGiftResultView extends CenterPopupView {
    @NotNull
    public static final a A = new a(null);
    public static ChangeQuickRedirect changeQuickRedirect;
    public static int z;
    @Nullable
    public List<? extends IGiftInfoConvert> w;
    @Nullable
    public float[] x;
    public HashMap y;

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

        public a(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

    /* compiled from: LiveGiftResultView.kt */
    public static final class b implements Runnable {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ LiveGiftResultView b;

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ boolean f18750c;

        public b(LiveGiftResultView liveGiftResultView, boolean z) {
            this.b = liveGiftResultView;
            this.f18750c = z;
        }

        public final void run() {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 202634, new Class[0], Void.TYPE).isSupported) {
                if (!this.f18750c) {
                    this.b.e();
                } else {
                    this.b.p();
                }
            }
        }
    }

    public LiveGiftResultView(@NotNull Context context) {
        super(context);
    }

    private final void setGiftInfo(List<? extends IGiftInfoConvert> list) {
        String str;
        String str2;
        if (!PatchProxy.proxy(new Object[]{list}, this, changeQuickRedirect, false, 202617, new Class[]{List.class}, Void.TYPE).isSupported) {
            if (list == null || list.isEmpty()) {
                ((Group) s(R.id.giftSuccess)).setVisibility(8);
                ((ImageView) s(R.id.giftResultClose)).setVisibility(8);
                ((Group) s(R.id.giftFail)).setVisibility(0);
                ViewExtensionKt.i((TextView) s(R.id.iKnowGiftNone), 1000, new LiveGiftResultView$setGiftInfo$1(this));
                return;
            }
            ((Group) s(R.id.giftSuccess)).setVisibility(0);
            ((Group) s(R.id.giftFail)).setVisibility(8);
            ((ImageView) s(R.id.giftResultClose)).setVisibility(0);
            TextView textView = (TextView) s(R.id.giftDesc);
            String string = getResources().getString(R.string.live_accept_gift);
            Object[] objArr = new Object[1];
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{list}, this, changeQuickRedirect, false, 202618, new Class[]{List.class}, String.class);
            if (proxy.isSupported) {
                str = (String) proxy.result;
            } else {
                String str3 = "";
                if (!(list == null || list.isEmpty())) {
                    int i = 0;
                    for (T t : list) {
                        int i3 = i + 1;
                        if (i < 0) {
                            CollectionsKt__CollectionsKt.throwIndexOverflow();
                        }
                        mp0.a convert = t.convert();
                        StringBuilder i12 = f.i(str3, 12300);
                        PatchProxyResult proxy2 = PatchProxy.proxy(new Object[0], convert, mp0.a.changeQuickRedirect, false, 202588, new Class[0], String.class);
                        if (proxy2.isSupported) {
                            str2 = (String) proxy2.result;
                        } else {
                            str2 = convert.d;
                        }
                        str3 = fu.a.l(i12, str2, 12301);
                        i = i3;
                    }
                }
                str = str3;
            }
            objArr[0] = str;
            textView.setText(String.format(string, Arrays.copyOf(objArr, 1)));
            ((AdaptiveSizeGroup) s(R.id.giftIcon)).setGiftInfo(list);
            ViewExtensionKt.i((TextView) s(R.id.acceptGift), 1000, new LiveGiftResultView$setGiftInfo$2(this));
            ViewExtensionKt.i((ImageView) s(R.id.giftResultClose), 1000, new LiveGiftResultView$setGiftInfo$3(this));
        }
    }

    @Override // com.lxj.xpopup.core.BasePopupView
    public void b() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 202616, new Class[0], Void.TYPE).isSupported) {
            setGiftInfo(this.w);
        }
    }

    @Nullable
    public final float[] getDismissLocation() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 202611, new Class[0], float[].class);
        return proxy.isSupported ? (float[]) proxy.result : this.x;
    }

    /* JADX DEBUG: Type inference failed for r0v2. Raw type applied. Possible types: java.util.List<? extends com.shizhuang.duapp.modules.live.common.widget.gift.IGiftInfoConvert>, java.util.List<com.shizhuang.duapp.modules.live.common.widget.gift.IGiftInfoConvert> */
    @Nullable
    public final List<IGiftInfoConvert> getGiftInfos() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 202609, new Class[0], List.class);
        return proxy.isSupported ? (List) proxy.result : this.w;
    }

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

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

    @Override // com.lxj.xpopup.core.BasePopupView, com.lxj.xpopup.core.CenterPopupView
    @NotNull
    public c getPopupAnimator() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 202621, new Class[0], c.class);
        return proxy.isSupported ? (c) proxy.result : new mp0.b(this.x, getPopupContentView());
    }

    @Override // com.lxj.xpopup.core.BasePopupView
    public void onCreate() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 202615, new Class[0], Void.TYPE).isSupported) {
            GradientDrawable gradientDrawable = new GradientDrawable();
            gradientDrawable.setCornerRadius((float) fi.b.b((float) 8));
            gradientDrawable.setColor(getContext().getResources().getColor(R.color.white));
            ((ConstraintLayout) s(R.id.giftContent)).setBackground(gradientDrawable);
            ((DuImageLoaderView) s(R.id.poizonLogo)).setBackgroundResource(z);
            setOnCloseClickListener(new LiveGiftResultView$onCreate$1(this));
            ((DuRequestOptions) mn.a.f35714a.g("https://apk.poizon.com/duApp/Android_Config/live/img/qixi_lottery_bg.png").G(this.b.l).u(new LiveGiftResultView$onCreate$2(this))).y();
        }
    }

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

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

    public final void setDismissLocation(@Nullable float[] fArr) {
        if (!PatchProxy.proxy(new Object[]{fArr}, this, changeQuickRedirect, false, 202612, new Class[]{float[].class}, Void.TYPE).isSupported) {
            this.x = fArr;
        }
    }

    public final void setGiftInfos(@Nullable List<? extends IGiftInfoConvert> list) {
        if (!PatchProxy.proxy(new Object[]{list}, this, changeQuickRedirect, false, 202610, new Class[]{List.class}, Void.TYPE).isSupported) {
            this.w = list;
        }
    }

    public final void setOnCloseClickListener(@NotNull View.OnClickListener onClickListener) {
        if (!PatchProxy.proxy(new Object[]{onClickListener}, this, changeQuickRedirect, false, 202620, new Class[]{View.OnClickListener.class}, Void.TYPE).isSupported) {
            ViewExtensionKt.i((ImageView) s(R.id.giftResultClose), 1000, new LiveGiftResultView$setOnCloseClickListener$1(this, onClickListener));
        }
    }

    public final void t(boolean z4) {
        if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 202619, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            post(new b(this, z4));
        }
    }
}