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


package com.shizhuang.duapp.modules.productv2.sxs;

import android.app.Dialog;
import android.graphics.Rect;
import android.os.Bundle;
import android.os.CountDownTimer;
import android.os.Handler;
import android.os.Looper;
import android.os.MessageQueue;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.animation.Animation;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.fragment.app.DialogFragment;
import androidx.recyclerview.widget.RecyclerView;
import com.knightboost.weaver.api.Scope;
import com.knightboost.weaver.api.annotations.Insert;
import com.knightboost.weaver.api.annotations.TargetClass;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.sensorsdata.analytics.android.sdk.autotrack.aop.FragmentTrackHelper;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.widget.font.FontText;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.productv2.model.DanmuModel;
import com.shizhuang.duapp.modules.productv2.model.RemoteSxsLotteryModel;
import com.shizhuang.duapp.modules.productv2.model.SxsLotteryModel;
import com.shizhuang.duapp.modules.productv2.sxs.damu.SxsDanmuAdaper;
import com.shizhuang.duapp.modules.productv2.sxs.damu.SxsSingleLineDanmuAdaper;
import df.n0;
import f71.m;
import f71.o;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import o5.i;
import org.jetbrains.annotations.NotNull;
import td.j;
import td.s;

@Metadata(bv = {}, d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0005\u0018\u00002\u00020\u0001:\u0001\nJ\u001a\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0003\u001a\u00020\u00022\b\u0010\u0005\u001a\u0004\u0018\u00010\u0004H\u0016J\b\u0010\b\u001a\u00020\u0006H\u0016J\b\u0010\t\u001a\u00020\u0006H\u0016¨\u0006\u000b"}, d2 = {"Lcom/shizhuang/duapp/modules/productv2/sxs/SxsLotteryDialogFragment;", "Landroidx/fragment/app/DialogFragment;", "Landroid/view/View;", "view", "Landroid/os/Bundle;", "savedInstanceState", "", "onViewCreated", "onResume", "onPause", "a", "du_product_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: SxsLotteryDialogFragment.kt */
public final class SxsLotteryDialogFragment extends DialogFragment {
    public static ChangeQuickRedirect changeQuickRedirect;
    @NotNull
    public static final a n = new a(null);
    public final Rect b;

    /* renamed from: c  reason: collision with root package name */
    public final Handler f24189c;
    public int d;
    public CountDownTimer e;
    public boolean f;

    /* renamed from: g  reason: collision with root package name */
    public RemoteSxsLotteryModel f24190g;

    /* renamed from: h  reason: collision with root package name */
    public String f24191h;
    public final Random i;
    public float j;
    public Function1<? super RemoteSxsLotteryModel, Unit> k;
    public Function1<? super Boolean, Unit> l;
    public HashMap m;

    public class _boostWeave {
        public static ChangeQuickRedirect changeQuickRedirect;

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onCreate")
        @Keep
        public static void FragmentMethodWeaver_onCreate(SxsLotteryDialogFragment sxsLotteryDialogFragment, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{sxsLotteryDialogFragment, bundle}, null, changeQuickRedirect, true, 303495, new Class[]{SxsLotteryDialogFragment.class, Bundle.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                SxsLotteryDialogFragment.a(sxsLotteryDialogFragment, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (sxsLotteryDialogFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.sxs.SxsLotteryDialogFragment")) {
                    jn.b.f34396a.fragmentOnCreateMethod(sxsLotteryDialogFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onCreateView")
        @Keep
        public static View FragmentMethodWeaver_onCreateView(@NonNull SxsLotteryDialogFragment sxsLotteryDialogFragment, @Nullable LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, Bundle bundle) {
            View view;
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{sxsLotteryDialogFragment, layoutInflater, viewGroup, bundle}, null, changeQuickRedirect, true, 303496, new Class[]{SxsLotteryDialogFragment.class, LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
            if (proxy.isSupported) {
                return (View) proxy.result;
            }
            long currentTimeMillis = System.currentTimeMillis();
            ChangeQuickRedirect changeQuickRedirect2 = SxsLotteryDialogFragment.changeQuickRedirect;
            PatchProxyResult proxy2 = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, sxsLotteryDialogFragment, SxsLotteryDialogFragment.changeQuickRedirect, false, 303453, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
            if (proxy2.isSupported) {
                view = (View) proxy2.result;
            } else {
                view = layoutInflater.inflate(R.layout.dialog_sxs_lotterty, viewGroup, false);
            }
            long currentTimeMillis2 = System.currentTimeMillis();
            if (sxsLotteryDialogFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.sxs.SxsLotteryDialogFragment")) {
                jn.b.f34396a.fragmentOnCreateViewMethod(sxsLotteryDialogFragment, currentTimeMillis, currentTimeMillis2);
            }
            return view;
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onResume")
        @Keep
        public static void FragmentMethodWeaver_onResume(SxsLotteryDialogFragment sxsLotteryDialogFragment) {
            if (!PatchProxy.proxy(new Object[]{sxsLotteryDialogFragment}, null, changeQuickRedirect, true, 303499, new Class[]{SxsLotteryDialogFragment.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                SxsLotteryDialogFragment.d(sxsLotteryDialogFragment);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (sxsLotteryDialogFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.sxs.SxsLotteryDialogFragment")) {
                    jn.b.f34396a.fragmentOnResumeMethod(sxsLotteryDialogFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onStart")
        @Keep
        public static void FragmentMethodWeaver_onStart(SxsLotteryDialogFragment sxsLotteryDialogFragment) {
            if (!PatchProxy.proxy(new Object[]{sxsLotteryDialogFragment}, null, changeQuickRedirect, true, 303497, new Class[]{SxsLotteryDialogFragment.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                SxsLotteryDialogFragment.b(sxsLotteryDialogFragment);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (sxsLotteryDialogFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.sxs.SxsLotteryDialogFragment")) {
                    jn.b.f34396a.fragmentOnStartMethod(sxsLotteryDialogFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onViewCreated")
        @Keep
        public static void FragmentMethodWeaver_onViewCreated(@NonNull SxsLotteryDialogFragment sxsLotteryDialogFragment, @Nullable View view, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{sxsLotteryDialogFragment, view, bundle}, null, changeQuickRedirect, true, 303498, new Class[]{SxsLotteryDialogFragment.class, View.class, Bundle.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                SxsLotteryDialogFragment.c(sxsLotteryDialogFragment, view, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (sxsLotteryDialogFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.sxs.SxsLotteryDialogFragment")) {
                    jn.b.f34396a.fragmentOnViewCreatedMethod(sxsLotteryDialogFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }
    }

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

        public a(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

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

        public b(View view) {
            this.b = view;
        }

        public final void run() {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303500, new Class[0], Void.TYPE).isSupported) {
                this.b.setVisibility(8);
            }
        }
    }

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

        public c(SxsLotteryDialogFragment sxsLotteryDialogFragment) {
            this.b = sxsLotteryDialogFragment;
        }

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

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

        public d(RecyclerView recyclerView, int i, int i3) {
            this.b = recyclerView;
        }

        public final void run() {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303520, new Class[0], Void.TYPE).isSupported) {
                this.b.smoothScrollBy(fi.b.f32351a * 11111, 0, null, 177776000);
            }
        }
    }

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

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

            public a(e eVar) {
                this.b = eVar;
            }

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

        public e(SxsLotteryDialogFragment sxsLotteryDialogFragment) {
            this.b = sxsLotteryDialogFragment;
        }

        public final void run() {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303532, new Class[0], Void.TYPE).isSupported && ((LinearLayout) this.b._$_findCachedViewById(R.id.sxsOpenButtonLayout)) != null) {
                ((LinearLayout) this.b._$_findCachedViewById(R.id.sxsOpenButtonLayout)).animate().scaleX(1.0f).scaleY(1.0f).setDuration(500).withEndAction(new a(this)).start();
            }
        }
    }

    /* compiled from: SxsLotteryDialogFragment.kt */
    public static final class f implements MessageQueue.IdleHandler {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ SxsLotteryDialogFragment b;

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

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

            public a(f fVar) {
                this.b = fVar;
            }

            public final void run() {
                if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303537, new Class[0], Void.TYPE).isSupported) {
                    this.b.f24192c.smoothScrollBy(0, (-this.b.f24192c.getHeight()) * 11111, null, 44444000);
                    this.b.b.d++;
                }
            }
        }

        public f(SxsLotteryDialogFragment sxsLotteryDialogFragment, RecyclerView recyclerView, int i, int i3) {
            this.b = sxsLotteryDialogFragment;
            this.f24192c = recyclerView;
        }

        public final boolean queueIdle() {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303536, new Class[0], Boolean.TYPE);
            if (proxy.isSupported) {
                return ((Boolean) proxy.result).booleanValue();
            }
            SxsLotteryDialogFragment sxsLotteryDialogFragment = this.b;
            sxsLotteryDialogFragment.f24189c.postDelayed(new a(this), (long) sxsLotteryDialogFragment.i.nextInt(800));
            return false;
        }
    }

    public SxsLotteryDialogFragment() {
        this(AnonymousClass1.INSTANCE, null);
    }

    public static void a(SxsLotteryDialogFragment sxsLotteryDialogFragment, Bundle bundle) {
        String string;
        if (!PatchProxy.proxy(new Object[]{bundle}, sxsLotteryDialogFragment, changeQuickRedirect, false, 303451, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
            sxsLotteryDialogFragment.setStyle(0, R.style.SxsTransparentTheme);
            Bundle arguments = sxsLotteryDialogFragment.getArguments();
            if (arguments == null || (string = arguments.getString("product_id")) == null) {
                throw new IllegalArgumentException("productId is null in SxsLotteryDialogFragment");
            }
            sxsLotteryDialogFragment.f24191h = string;
        }
    }

    public static void b(SxsLotteryDialogFragment sxsLotteryDialogFragment) {
        Window window;
        if (!PatchProxy.proxy(new Object[0], sxsLotteryDialogFragment, changeQuickRedirect, false, 303455, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
            Dialog dialog = sxsLotteryDialogFragment.getDialog();
            if (dialog != null) {
                dialog.setCancelable(false);
            }
            Dialog dialog2 = sxsLotteryDialogFragment.getDialog();
            if (dialog2 != null && (window = dialog2.getWindow()) != null) {
                ChangeQuickRedirect changeQuickRedirect2 = o.changeQuickRedirect;
                if (!PatchProxy.proxy(new Object[]{window, new Byte((byte) 1)}, null, o.changeQuickRedirect, true, 303547, new Class[]{Window.class, Boolean.TYPE}, Void.TYPE).isSupported) {
                    window.setStatusBarColor(0);
                    window.setNavigationBarColor(0);
                    window.addFlags(Integer.MIN_VALUE);
                    window.getDecorView().setSystemUiVisibility(1280);
                }
                o.a(window, true);
            }
        }
    }

    public static void c(SxsLotteryDialogFragment sxsLotteryDialogFragment, View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, sxsLotteryDialogFragment, changeQuickRedirect, false, 303457, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            super.onViewCreated(view, bundle);
            if (!PatchProxy.proxy(new Object[0], sxsLotteryDialogFragment, changeQuickRedirect, false, 303458, new Class[0], Void.TYPE).isSupported) {
                ((ConstraintLayout) sxsLotteryDialogFragment._$_findCachedViewById(R.id.contentView)).setAlpha(i.f36333a);
                sxsLotteryDialogFragment._$_findCachedViewById(R.id.couponAFake).setAlpha(i.f36333a);
                sxsLotteryDialogFragment._$_findCachedViewById(R.id.couponBFake).setAlpha(i.f36333a);
                sxsLotteryDialogFragment._$_findCachedViewById(R.id.couponCFake).setAlpha(i.f36333a);
                ((TextView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.countdownView)).setAlpha(i.f36333a);
                ((UnTouchedRecyclerView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.danmuViewBottom)).setAlpha(i.f36333a);
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.holoView)).setAlpha(i.f36333a);
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.holoView)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/product/sxs_card_bg_holo.webp").x();
                ((ImageView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.closeView)).setOnClickListener(new SxsLotteryDialogFragment$initUi$1(sxsLotteryDialogFragment));
                ((ImageView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.closeViewB)).setVisibility(8);
                ((ImageView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.closeViewB)).setOnClickListener(new SxsLotteryDialogFragment$initUi$2(sxsLotteryDialogFragment));
                ((LinearLayout) sxsLotteryDialogFragment._$_findCachedViewById(R.id.sxsOpenButtonLayout)).setVisibility(8);
                float f12 = (float) 375;
                float f13 = (((float) fi.b.f32351a) * 1.0f) / f12;
                float f14 = (((float) fi.b.b) * 1.0f) / ((float) 812);
                int i3 = (int) (f12 * f13);
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.animBgView)).getLayoutParams().width = i3;
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.animBgView)).getLayoutParams().height = i3;
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.holoView)).getLayoutParams().width = i3;
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.holoView)).getLayoutParams().height = i3;
                int i12 = (int) (((float) 180) * f13);
                ((ViewGroup.MarginLayoutParams) ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.animBgView)).getLayoutParams()).setMargins(0, i12, 0, 0);
                ((ViewGroup.MarginLayoutParams) ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.holoView)).getLayoutParams()).setMargins(0, i12, 0, 0);
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.couponShadow)).h(R.drawable.sxs_psq_coupon_shadow).x();
                ((ImageView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.animFlowerView)).setScaleX(1.3f);
                ((ImageView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.animFlowerView)).setScaleY(1.3f);
                int i13 = (int) (((float) 420) * f13);
                ((ImageView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.animFlowerView)).getLayoutParams().height = i13;
                ((ViewGroup.MarginLayoutParams) ((ImageView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.animFlowerView)).getLayoutParams()).setMargins(0, (int) (((float) 90) * f14), 0, 0);
                ((ImageView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.cardStartFlowerView)).setScaleX(1.0f);
                ((ImageView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.cardStartFlowerView)).setScaleY(1.0f);
                ((ImageView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.cardStartFlowerView)).getLayoutParams().height = i13;
                ((ViewGroup.MarginLayoutParams) ((ImageView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.cardStartFlowerView)).getLayoutParams()).setMargins(0, (int) (((float) 150) * f14), 0, 0);
                ((ConstraintLayout) sxsLotteryDialogFragment._$_findCachedViewById(R.id.sxsResultCard)).getLayoutParams().width = (int) (((float) 277) * f13);
                ((ConstraintLayout) sxsLotteryDialogFragment._$_findCachedViewById(R.id.sxsResultCard)).getLayoutParams().height = (int) (((float) 202) * f13);
                ((ConstraintLayout) sxsLotteryDialogFragment._$_findCachedViewById(R.id.sxsResultCard)).setAlpha(i.f36333a);
                ((FontText) sxsLotteryDialogFragment._$_findCachedViewById(R.id.cardPriceTextView)).setTextScaleX(0.9f);
                ((ConstraintLayout.LayoutParams) ((FontText) sxsLotteryDialogFragment._$_findCachedViewById(R.id.cardPriceTextView)).getLayoutParams()).setMargins(0, 0, (int) (((float) 58) * f13), fi.b.b((float) 11));
                ((ConstraintLayout.LayoutParams) ((ConstraintLayout) sxsLotteryDialogFragment._$_findCachedViewById(R.id.sxsResultCard)).getLayoutParams()).setMargins((int) (((float) 66) * f13), (int) (((float) 248) * f14), (int) (((float) 32) * f13), 0);
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.sxsResultTitle)).getLayoutParams().width = (int) (((float) 259) * f13);
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.sxsResultTitle)).getLayoutParams().height = (int) (f13 * ((float) 76));
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.sxsResultTitle)).h(R.drawable.sxs_result_title).x();
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.sxsResultTitle)).setAlpha(i.f36333a);
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.sxsResultCardImage)).h(R.drawable.sxs_result_card).x();
                ((DuImageLoaderView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.psqBg)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/product/sxs_psq_bg.webp").x();
            }
            if (!PatchProxy.proxy(new Object[0], sxsLotteryDialogFragment, changeQuickRedirect, false, 303459, new Class[0], Void.TYPE).isSupported) {
                f71.b bVar = f71.b.f32133a;
                String str = sxsLotteryDialogFragment.f24191h;
                if (str == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("productId");
                }
                f71.e eVar = new f71.e(sxsLotteryDialogFragment, sxsLotteryDialogFragment);
                if (!PatchProxy.proxy(new Object[]{str, eVar}, bVar, f71.b.changeQuickRedirect, false, 303447, new Class[]{String.class, s.class}, Void.TYPE).isSupported) {
                    j.doRequest(((Api) j.getJavaGoApi(Api.class)).getPriceConfig(bVar.k(str)), eVar);
                }
            }
        }
    }

    public static void d(SxsLotteryDialogFragment sxsLotteryDialogFragment) {
        if (!PatchProxy.proxy(new Object[0], sxsLotteryDialogFragment, changeQuickRedirect, false, 303478, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
            fi.c.a(sxsLotteryDialogFragment.requireActivity());
            if (!sxsLotteryDialogFragment.f) {
                sxsLotteryDialogFragment.h((UnTouchedRecyclerView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.couponA));
                sxsLotteryDialogFragment.h((UnTouchedRecyclerView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.couponB));
                sxsLotteryDialogFragment.h((UnTouchedRecyclerView) sxsLotteryDialogFragment._$_findCachedViewById(R.id.couponC));
                n0.f31459a.f("activity_common_pageview", "507", null);
                return;
            }
            n0.f31459a.f("activity_common_pageview", "508", null);
        }
    }

    public static void i(SxsLotteryDialogFragment sxsLotteryDialogFragment, UnTouchedRecyclerView unTouchedRecyclerView, SxsLotteryModel sxsLotteryModel, int i3, int i12) {
        int i13;
        int i14 = (i12 & 4) != 0 ? 0 : i3;
        if (!PatchProxy.proxy(new Object[]{unTouchedRecyclerView, sxsLotteryModel, new Integer(i14)}, sxsLotteryDialogFragment, changeQuickRedirect, false, 303464, new Class[]{UnTouchedRecyclerView.class, SxsLotteryModel.class, Integer.TYPE}, Void.TYPE).isSupported) {
            int height = unTouchedRecyclerView.getHeight();
            RecyclerView.LayoutManager layoutManager = unTouchedRecyclerView.getLayoutManager();
            SxsCouponAdapter sxsCouponAdapter = null;
            if (!(layoutManager instanceof RepeatLayoutManager)) {
                layoutManager = null;
            }
            RepeatLayoutManager repeatLayoutManager = (RepeatLayoutManager) layoutManager;
            if (repeatLayoutManager != null) {
                RecyclerView.Adapter adapter = unTouchedRecyclerView.getAdapter();
                if (adapter instanceof SxsCouponAdapter) {
                    sxsCouponAdapter = adapter;
                }
                SxsCouponAdapter sxsCouponAdapter2 = sxsCouponAdapter;
                if (sxsCouponAdapter2 != null) {
                    int i15 = 0;
                    for (T t : sxsCouponAdapter2.getList()) {
                        int i16 = i15 + 1;
                        if (i15 < 0) {
                            CollectionsKt__CollectionsKt.throwIndexOverflow();
                        }
                        if (Intrinsics.areEqual(t.getPrice(), sxsLotteryModel.getPrice())) {
                            if (!PatchProxy.proxy(new Object[]{new Integer(i15)}, sxsCouponAdapter2, SxsCouponAdapter.changeQuickRedirect, false, 303436, new Class[]{Integer.TYPE}, Void.TYPE).isSupported) {
                                sxsCouponAdapter2.f24187a = i15;
                            }
                        }
                        i15 = i16;
                    }
                    int findLastVisibleItemPosition = repeatLayoutManager.findLastVisibleItemPosition();
                    PatchProxyResult proxy = PatchProxy.proxy(new Object[0], sxsCouponAdapter2, SxsCouponAdapter.changeQuickRedirect, false, 303440, new Class[0], Integer.TYPE);
                    if (proxy.isSupported) {
                        i13 = ((Integer) proxy.result).intValue();
                    } else {
                        i13 = sxsCouponAdapter2.f24187a;
                    }
                    int i17 = findLastVisibleItemPosition - i13;
                    View childAt = unTouchedRecyclerView.getChildAt(unTouchedRecyclerView.getChildCount() - 1);
                    if (childAt != null) {
                        childAt.getLocalVisibleRect(sxsLotteryDialogFragment.b);
                        Rect rect = sxsLotteryDialogFragment.b;
                        int i18 = rect.bottom - rect.top;
                        sxsCouponAdapter2.a();
                        if (i18 == height) {
                            Math.abs(i17);
                        } else if (i17 != 0) {
                            if (i17 > 0) {
                                Math.abs(i17);
                            } else {
                                sxsCouponAdapter2.a();
                            }
                        }
                        Looper.myQueue().addIdleHandler(new f71.f(sxsLotteryDialogFragment, unTouchedRecyclerView, height, i14, sxsLotteryModel));
                        unTouchedRecyclerView.addOnScrollListener(new SxsLotteryDialogFragment$scrollToWining$3(sxsLotteryDialogFragment, unTouchedRecyclerView, sxsLotteryModel));
                    }
                }
            }
        }
    }

    public View _$_findCachedViewById(int i3) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 303484, new Class[]{Integer.TYPE}, View.class);
        if (proxy.isSupported) {
            return (View) proxy.result;
        }
        if (this.m == null) {
            this.m = new HashMap();
        }
        View view = (View) this.m.get(Integer.valueOf(i3));
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i3);
        this.m.put(Integer.valueOf(i3), findViewById);
        return findViewById;
    }

    public final void e(View view) {
        if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 303480, new Class[]{View.class}, Void.TYPE).isSupported) {
            if (!(view instanceof ViewGroup)) {
                view = null;
            }
            ViewGroup viewGroup = (ViewGroup) view;
            if (viewGroup != null) {
                int childCount = viewGroup.getChildCount();
                for (int i3 = 0; i3 < childCount; i3++) {
                    View childAt = viewGroup.getChildAt(i3);
                    Animation animation = childAt.getAnimation();
                    if (animation != null) {
                        animation.cancel();
                    }
                    childAt.animate().cancel();
                    childAt.clearAnimation();
                    e(childAt);
                }
            }
        }
    }

    public final boolean f() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303449, new Class[0], Boolean.TYPE);
        if (proxy.isSupported) {
            return ((Boolean) proxy.result).booleanValue();
        }
        return this.d >= 3;
    }

    public final void g(View view) {
        if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 303472, new Class[]{View.class}, Void.TYPE).isSupported) {
            view.animate().alpha(i.f36333a).setDuration(166).withEndAction(new b(view)).start();
        }
    }

    public final void h(RecyclerView recyclerView) {
        if (!PatchProxy.proxy(new Object[]{recyclerView}, this, changeQuickRedirect, false, 303474, new Class[]{RecyclerView.class}, Void.TYPE).isSupported && f()) {
            RecyclerView.Adapter adapter = recyclerView.getAdapter();
            if (adapter != null) {
                adapter.notifyDataSetChanged();
            }
            recyclerView.stopScroll();
            n(recyclerView);
        }
    }

    public final void j() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303468, new Class[0], Void.TYPE).isSupported && ((DuImageLoaderView) _$_findCachedViewById(R.id.animBgView)) != null) {
            this.j += (float) 360;
            ((DuImageLoaderView) _$_findCachedViewById(R.id.animBgView)).animate().rotation(this.j).setInterpolator(null).setDuration(((long) 1) * 3000).withEndAction(new c(this)).start();
        }
    }

    public final void k(RecyclerView recyclerView, List<DanmuModel> list) {
        if (!PatchProxy.proxy(new Object[]{recyclerView, list}, this, changeQuickRedirect, false, 303462, new Class[]{RecyclerView.class, List.class}, Void.TYPE).isSupported) {
            recyclerView.setAlpha(1.0f);
            recyclerView.setLayoutManager(new RepeatLayoutManager(requireContext(), 0, false));
            recyclerView.setAdapter(recyclerView == ((UnTouchedRecyclerView) _$_findCachedViewById(R.id.danmuViewTop)) ? new SxsDanmuAdaper(list) : new SxsSingleLineDanmuAdaper(list));
            recyclerView.postDelayed(new d(recyclerView, 11111, 16000), 100);
        }
    }

    public final void l(View view, String str) {
        if (!PatchProxy.proxy(new Object[]{view, str}, this, changeQuickRedirect, false, 303465, new Class[]{View.class, String.class}, Void.TYPE).isSupported) {
            FontText fontText = (FontText) view.findViewById(R.id.price);
            fontText.c(str, 14, m.f32144a.a(str, 28, 20));
            fontText.setTextScaleX(0.9f);
            view.setTranslationY((float) fi.b.b((float) -3));
            view.setAlpha(1.0f);
            view.animate().translationY(i.f36333a).alpha(1.0f).start();
        }
    }

    public final void m() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303470, new Class[0], Void.TYPE).isSupported && ((LinearLayout) _$_findCachedViewById(R.id.sxsOpenButtonLayout)) != null) {
            ((LinearLayout) _$_findCachedViewById(R.id.sxsOpenButtonLayout)).animate().scaleX(1.1f).scaleY(1.1f).setDuration(500).withEndAction(new e(this)).start();
        }
    }

    public final void n(RecyclerView recyclerView) {
        if (!PatchProxy.proxy(new Object[]{recyclerView}, this, changeQuickRedirect, false, 303475, new Class[]{RecyclerView.class}, Void.TYPE).isSupported) {
            Looper.myQueue().addIdleHandler(new f(this, recyclerView, 11111, 500));
        }
    }

    @Override // androidx.fragment.app.Fragment, androidx.fragment.app.DialogFragment
    public void onCreate(Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 303450, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onCreate(this, bundle);
        }
    }

    @Override // androidx.fragment.app.Fragment, androidx.fragment.app.DialogFragment
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, this, changeQuickRedirect, false, 303452, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
        return proxy.isSupported ? (View) proxy.result : _boostWeave.FragmentMethodWeaver_onCreateView(this, layoutInflater, viewGroup, bundle);
    }

    @Override // androidx.fragment.app.Fragment
    public void onDestroy() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303483, new Class[0], Void.TYPE).isSupported) {
            super.onDestroy();
            this.l = null;
            CountDownTimer countDownTimer = this.e;
            if (countDownTimer != null) {
                countDownTimer.cancel();
            }
            this.k = SxsLotteryDialogFragment$onDestroy$1.INSTANCE;
            this.f24189c.removeCallbacksAndMessages(null);
        }
    }

    @Override // androidx.fragment.app.Fragment, androidx.fragment.app.DialogFragment
    public void onDestroyView() {
        HashMap hashMap;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303476, new Class[0], Void.TYPE).isSupported) {
            e(getView());
            super.onDestroyView();
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303485, new Class[0], Void.TYPE).isSupported && (hashMap = this.m) != null) {
                hashMap.clear();
            }
        }
    }

    @Override // androidx.fragment.app.Fragment
    @SensorsDataInstrumented
    public void onHiddenChanged(boolean z) {
        if (!PatchProxy.proxy(new Object[]{new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 303488, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            super.onHiddenChanged(z);
            FragmentTrackHelper.trackOnHiddenChanged(this, z);
        }
    }

    @Override // androidx.fragment.app.Fragment
    @SensorsDataInstrumented
    public void onPause() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303479, new Class[0], Void.TYPE).isSupported) {
            super.onPause();
            if (!this.f) {
                ((UnTouchedRecyclerView) _$_findCachedViewById(R.id.couponA)).stopScroll();
                ((UnTouchedRecyclerView) _$_findCachedViewById(R.id.couponB)).stopScroll();
                ((UnTouchedRecyclerView) _$_findCachedViewById(R.id.couponC)).stopScroll();
            }
            FragmentTrackHelper.trackFragmentPause(this);
        }
    }

    @Override // androidx.fragment.app.Fragment, androidx.fragment.app.DialogFragment
    @SensorsDataInstrumented
    public void onResume() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303477, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onResume(this);
            FragmentTrackHelper.trackFragmentResume(this);
        }
    }

    @Override // androidx.fragment.app.Fragment, androidx.fragment.app.DialogFragment
    public void onStart() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 303454, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onStart(this);
        }
    }

    @Override // androidx.fragment.app.Fragment, androidx.fragment.app.DialogFragment
    @SensorsDataInstrumented
    public void onViewCreated(View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, this, changeQuickRedirect, false, 303456, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onViewCreated(this, view, bundle);
            FragmentTrackHelper.onFragmentViewCreated(this, view, bundle);
        }
    }

    @Override // androidx.fragment.app.Fragment
    @SensorsDataInstrumented
    public void setUserVisibleHint(boolean z) {
        if (!PatchProxy.proxy(new Object[]{new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 303489, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            super.setUserVisibleHint(z);
            FragmentTrackHelper.trackFragmentSetUserVisibleHint(this, z);
        }
    }

    public SxsLotteryDialogFragment(@NotNull Function1<? super RemoteSxsLotteryModel, Unit> function1, @org.jetbrains.annotations.Nullable Function1<? super Boolean, Unit> function12) {
        this.k = function1;
        this.l = function12;
        this.b = new Rect();
        this.f24189c = new Handler(Looper.getMainLooper());
        this.i = new Random();
    }
}