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


package com.shizhuang.duapp.modules.product_detail.detailv3.dialog;

import android.app.Dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.TextView;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import cd.g;
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.shizhuang.duapp.R;
import com.shizhuang.duapp.common.extension.DrawableScale;
import com.shizhuang.duapp.common.utils.livebus.PageEventBus;
import com.shizhuang.duapp.common.widget.font.IconFontTextView;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.du_mall_common.extension.ViewExtensionKt;
import com.shizhuang.duapp.modules.du_mall_common.limit_sale.model.PartakeStatus;
import com.shizhuang.duapp.modules.product_detail.detailv3.model.PmDetailInfoModel;
import com.shizhuang.duapp.modules.product_detail.detailv3.model.PmLimitSaleModel;
import com.shizhuang.duapp.modules.product_detail.detailv3.model.PmModel;
import com.shizhuang.duapp.modules.product_detail.detailv3.widget.PmBottomLimitSaleView;
import java.util.HashMap;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.jvm.internal.DefaultConstructorMarker;
import org.jetbrains.annotations.NotNull;
import q01.c;

@Metadata(bv = {}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u00002\u00020\u0001:\u0001\u0004B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0005"}, d2 = {"Lcom/shizhuang/duapp/modules/product_detail/detailv3/dialog/PmCheckInDialog;", "Lcom/shizhuang/duapp/modules/product_detail/detailv3/dialog/PmBaseDialog;", "<init>", "()V", "a", "du_product_detail_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: PmCheckInDialog.kt */
public final class PmCheckInDialog extends PmBaseDialog {
    public static ChangeQuickRedirect changeQuickRedirect;
    @NotNull
    public static final a k = new a(null);
    public HashMap j;

    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(PmCheckInDialog pmCheckInDialog, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{pmCheckInDialog, bundle}, null, changeQuickRedirect, true, 263795, new Class[]{PmCheckInDialog.class, Bundle.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                PmCheckInDialog.J(pmCheckInDialog, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (pmCheckInDialog.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.product_detail.detailv3.dialog.PmCheckInDialog")) {
                    jn.b.f34396a.fragmentOnCreateMethod(pmCheckInDialog, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.fragment.app.Fragment")
        @Insert(mayCreateSuper = true, value = "onCreateView")
        @Keep
        public static View FragmentMethodWeaver_onCreateView(@NonNull PmCheckInDialog pmCheckInDialog, @Nullable LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, Bundle bundle) {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{pmCheckInDialog, layoutInflater, viewGroup, bundle}, null, changeQuickRedirect, true, 263797, new Class[]{PmCheckInDialog.class, LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
            if (proxy.isSupported) {
                return (View) proxy.result;
            }
            long currentTimeMillis = System.currentTimeMillis();
            View L = PmCheckInDialog.L(pmCheckInDialog, layoutInflater, viewGroup, bundle);
            long currentTimeMillis2 = System.currentTimeMillis();
            if (pmCheckInDialog.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.product_detail.detailv3.dialog.PmCheckInDialog")) {
                jn.b.f34396a.fragmentOnCreateViewMethod(pmCheckInDialog, currentTimeMillis, currentTimeMillis2);
            }
            return L;
        }

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

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

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

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

        public a(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

    /* compiled from: PmCheckInDialog.kt */
    public static final class b implements PmBottomLimitSaleView.OnTimerCountDownCallback {
        public static ChangeQuickRedirect changeQuickRedirect;

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

        public b(PmCheckInDialog pmCheckInDialog, boolean z, PmLimitSaleModel pmLimitSaleModel, PartakeStatus partakeStatus) {
            this.f22072a = pmCheckInDialog;
        }

        @Override // com.shizhuang.duapp.modules.product_detail.detailv3.widget.PmBottomLimitSaleView.OnTimerCountDownCallback
        public void onFinished() {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 263801, new Class[0], Void.TYPE).isSupported) {
                PageEventBus j = PageEventBus.j(this.f22072a.getContext());
                if (j != null) {
                    j.f(new c());
                }
                this.f22072a.dismissAllowingStateLoss();
            }
        }
    }

    public static void J(PmCheckInDialog pmCheckInDialog, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, pmCheckInDialog, changeQuickRedirect, false, 263785, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
        }
    }

    public static void K(PmCheckInDialog pmCheckInDialog) {
        if (!PatchProxy.proxy(new Object[0], pmCheckInDialog, changeQuickRedirect, false, 263787, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
        }
    }

    public static View L(PmCheckInDialog pmCheckInDialog, LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, pmCheckInDialog, changeQuickRedirect, false, 263789, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
        return proxy.isSupported ? (View) proxy.result : super.onCreateView(layoutInflater, viewGroup, bundle);
    }

    public static void M(PmCheckInDialog pmCheckInDialog) {
        if (!PatchProxy.proxy(new Object[0], pmCheckInDialog, changeQuickRedirect, false, 263791, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
        }
    }

    public static void N(PmCheckInDialog pmCheckInDialog, View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, pmCheckInDialog, changeQuickRedirect, false, 263793, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            super.onViewCreated(view, bundle);
        }
    }

    @Override // com.shizhuang.duapp.modules.product_detail.detailv3.dialog.PmBaseDialog
    public void _$_clearFindViewByIdCache() {
        HashMap hashMap;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 263783, new Class[0], Void.TYPE).isSupported && (hashMap = this.j) != null) {
            hashMap.clear();
        }
    }

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

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment
    public void g() {
        Dialog dialog;
        Window window;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 263781, new Class[0], Void.TYPE).isSupported && (dialog = getDialog()) != null && (window = dialog.getWindow()) != null) {
            WindowManager.LayoutParams attributes = window.getAttributes();
            attributes.height = -1;
            attributes.width = -1;
            window.setAttributes(attributes);
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, com.shizhuang.duapp.modules.product_detail.detailv3.dialog.PmBaseDialog, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
    public void onCreate(Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 263784, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onCreate(this, bundle);
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, com.shizhuang.duapp.modules.product_detail.detailv3.dialog.PmBaseDialog, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, 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, 263788, new Class[]{LayoutInflater.class, ViewGroup.class, Bundle.class}, View.class);
        return proxy.isSupported ? (View) proxy.result : _boostWeave.FragmentMethodWeaver_onCreateView(this, layoutInflater, viewGroup, bundle);
    }

    @Override // com.shizhuang.duapp.modules.product_detail.detailv3.dialog.PmBaseDialog, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
    public /* synthetic */ void onDestroyView() {
        super.onDestroyView();
        _$_clearFindViewByIdCache();
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, com.shizhuang.duapp.modules.product_detail.detailv3.dialog.PmBaseDialog, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
    public void onResume() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 263790, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onResume(this);
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, com.shizhuang.duapp.modules.product_detail.detailv3.dialog.PmBaseDialog, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
    public void onStart() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 263786, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onStart(this);
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, com.shizhuang.duapp.modules.product_detail.detailv3.dialog.PmBaseDialog, androidx.appcompat.app.AppCompatDialogFragment, androidx.fragment.app.Fragment, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
    public void onViewCreated(View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, this, changeQuickRedirect, false, 263792, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onViewCreated(this, view, bundle);
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.BaseDialogFragment
    public int p() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 263778, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.style.CheckInDialogTheme;
    }

    @Override // com.shizhuang.duapp.common.dialog.BaseDialogFragment
    public int q() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 263777, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.dialog_pm_check_in;
    }

    @Override // com.shizhuang.duapp.common.dialog.BaseDialogFragment
    public void r(@org.jetbrains.annotations.Nullable View view) {
        PartakeStatus partakeStatus;
        if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 263779, new Class[]{View.class}, Void.TYPE).isSupported) {
            ViewExtensionKt.e((IconFontTextView) _$_findCachedViewById(R.id.closeIcon), 0, new PmCheckInDialog$initView$1(this), 1);
            PmModel value = A().getModel().getValue();
            String str = null;
            PmLimitSaleModel limitedSaleInfo = value != null ? value.getLimitedSaleInfo() : null;
            PmModel value2 = A().getModel().getValue();
            Pair pair = new Pair(limitedSaleInfo, value2 != null ? value2.getDetail() : null);
            PmLimitSaleModel pmLimitSaleModel = (PmLimitSaleModel) pair.component1();
            PmDetailInfoModel pmDetailInfoModel = (PmDetailInfoModel) pair.component2();
            if (pmLimitSaleModel == null) {
                dismissAllowingStateLoss();
                return;
            }
            PartakeStatus[] values = PartakeStatus.values();
            int length = values.length;
            int i = 0;
            while (true) {
                if (i >= length) {
                    partakeStatus = null;
                    break;
                }
                partakeStatus = values[i];
                if (partakeStatus.getStatus() == pmLimitSaleModel.getUserPartakeStatus()) {
                    break;
                }
                i++;
            }
            if (partakeStatus == null) {
                partakeStatus = PartakeStatus.NO_CHECK;
            }
            PartakeStatus partakeStatus2 = PartakeStatus.NO_PURCHASED;
            boolean z = partakeStatus == partakeStatus2 || partakeStatus == PartakeStatus.WAITING_PAY;
            ((ImageView) _$_findCachedViewById(R.id.imgResult)).setImageResource(partakeStatus == partakeStatus2 ? R.drawable.ic_limit_check_in : R.drawable.ic_limit_no_check);
            TextView textView = (TextView) _$_findCachedViewById(R.id.tvContent);
            String resultTips = pmLimitSaleModel.getResultTips();
            if (resultTips == null) {
                resultTips = "";
            }
            textView.setText(resultTips);
            textView.setVisibility(z ? 4 : 0);
            ((TextView) _$_findCachedViewById(R.id.tvTitle)).setText(pmDetailInfoModel != null ? pmDetailInfoModel.detailTitle() : null);
            ((DuImageLoaderView) _$_findCachedViewById(R.id.imgTitleBg)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/bg_check_in_title.png").x();
            DuImageLoaderView duImageLoaderView = (DuImageLoaderView) _$_findCachedViewById(R.id.imgLogo);
            ConstraintLayout.LayoutParams layoutParams = (ConstraintLayout.LayoutParams) duImageLoaderView.getLayoutParams();
            int b2 = fi.b.b((float) (A().k().B() ? 40 : 20));
            layoutParams.setMarginStart(b2);
            layoutParams.setMarginEnd(b2);
            duImageLoaderView.setLayoutParams(layoutParams);
            if (pmDetailInfoModel != null) {
                str = pmDetailInfoModel.getLogoUrl();
            }
            ((co.c) g.a(duImageLoaderView.i(str), DrawableScale.ProductList).u(new PmCheckInDialog$initView$$inlined$let$lambda$1(this, pmDetailInfoModel, z))).x();
            PmBottomLimitSaleView pmBottomLimitSaleView = (PmBottomLimitSaleView) _$_findCachedViewById(R.id.saleView);
            if (z) {
                pmBottomLimitSaleView.d(true);
                pmBottomLimitSaleView.setTime(pmLimitSaleModel.getCountdownSeconds());
                pmBottomLimitSaleView.setOnTimerCountDownCallback(new b(this, z, pmLimitSaleModel, partakeStatus));
            } else {
                pmBottomLimitSaleView.d(false);
            }
            pmBottomLimitSaleView.a(partakeStatus.getTitle(), partakeStatus.getTips());
            ViewExtensionKt.e(pmBottomLimitSaleView, 0, new PmCheckInDialog$initView$$inlined$let$lambda$3(this, z, pmLimitSaleModel, partakeStatus), 1);
        }
    }
}