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


package com.shizhuang.duapp.modules.home.dialog;

import a.f;
import android.annotation.SuppressLint;
import android.app.Dialog;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewStub;
import android.view.Window;
import android.view.WindowManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.view.animation.LinearInterpolator;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.AppCompatTextView;
import androidx.recyclerview.widget.LinearLayoutManager;
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.shizhuang.duapp.R;
import com.shizhuang.duapp.common.component.recyclerview.LinearItemDecoration;
import com.shizhuang.duapp.common.dialog.BaseDialogFragment;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.recyclerview.adapter.DuListAdapter;
import com.shizhuang.duapp.common.recyclerview.holder.DuViewHolder;
import com.shizhuang.duapp.common.widget.font.FontText;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.modules.home.model.CouponItemModel;
import com.shizhuang.duapp.modules.home.model.CouponModel;
import com.shizhuang.duapp.modules.home.model.CouponPackageModel;
import h2.d;
import ij.z;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import jn.b;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

@Metadata(bv = {}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0007\u0018\u00002\u00020\u0001:\u0003\u0006\u0007\bB\u0007¢\u0006\u0004\b\u0004\u0010\u0005J\b\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006\t"}, d2 = {"Lcom/shizhuang/duapp/modules/home/dialog/CouponPackageDialog;", "Lcom/shizhuang/duapp/common/dialog/BaseDialogFragment;", "", "onResume", "<init>", "()V", "a", "ItemAdapter", "ItemViewHolder", "du_home_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: CouponPackageDialog.kt */
public final class CouponPackageDialog extends BaseDialogFragment {
    public static ChangeQuickRedirect changeQuickRedirect;
    @NotNull
    public static final a n = new a(null);
    public final String e = "https://cdn.poizon.com/node-common/c19432cf203444dab385393f7aaf812f.png";
    public Animation f;

    /* renamed from: g  reason: collision with root package name */
    public CouponPackageModel f15762g;

    /* renamed from: h  reason: collision with root package name */
    public boolean f15763h;
    public String i;
    public String j;
    @Nullable
    public Function0<Unit> k;
    public String l;
    public HashMap m;

    @Metadata(bv = {}, d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001¨\u0006\u0003"}, d2 = {"Lcom/shizhuang/duapp/modules/home/dialog/CouponPackageDialog$ItemAdapter;", "Lcom/shizhuang/duapp/common/recyclerview/adapter/DuListAdapter;", "Lcom/shizhuang/duapp/modules/home/model/CouponItemModel;", "du_home_release"}, k = 1, mv = {1, 4, 2})
    /* compiled from: CouponPackageDialog.kt */
    public static final class ItemAdapter extends DuListAdapter<CouponItemModel> {
        public static ChangeQuickRedirect changeQuickRedirect;

        public ItemAdapter(@NotNull List<CouponItemModel> list) {
            setItems(list);
        }

        @Override // com.shizhuang.duapp.common.recyclerview.adapter.AdapterLoader, com.shizhuang.duapp.common.recyclerview.adapter.DuListAdapter
        @NotNull
        public DuViewHolder<CouponItemModel> onViewHolderCreate(@NotNull ViewGroup viewGroup, int i) {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{viewGroup, new Integer(i)}, this, changeQuickRedirect, false, 154689, new Class[]{ViewGroup.class, Integer.TYPE}, DuViewHolder.class);
            return proxy.isSupported ? (DuViewHolder) proxy.result : new ItemViewHolder(ViewExtensionKt.w(viewGroup, R.layout.item_cp_dialog_content, false, 2));
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001¨\u0006\u0003"}, d2 = {"Lcom/shizhuang/duapp/modules/home/dialog/CouponPackageDialog$ItemViewHolder;", "Lcom/shizhuang/duapp/common/recyclerview/holder/DuViewHolder;", "Lcom/shizhuang/duapp/modules/home/model/CouponItemModel;", "du_home_release"}, k = 1, mv = {1, 4, 2})
    /* compiled from: CouponPackageDialog.kt */
    public static final class ItemViewHolder extends DuViewHolder<CouponItemModel> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public ImageView b;

        /* renamed from: c  reason: collision with root package name */
        public ImageView f15766c;
        public TextView d;
        public FontText e;
        public TextView f;

        /* renamed from: g  reason: collision with root package name */
        public TextView f15767g;

        /* renamed from: h  reason: collision with root package name */
        public TextView f15768h;

        public ItemViewHolder(@NotNull View view) {
            super(view);
            this.b = (ImageView) view.findViewById(R.id.ivItemBg);
            this.f15766c = (ImageView) view.findViewById(R.id.ivItemMarkType);
            this.d = (TextView) view.findViewById(R.id.tvItemMarkType);
            this.e = (FontText) view.findViewById(R.id.tvItemAmount);
            this.f = (TextView) view.findViewById(R.id.tvItemLimit);
            this.f15767g = (TextView) view.findViewById(R.id.tvType);
            this.f15768h = (TextView) view.findViewById(R.id.tvItemLimitTime);
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, int] */
        @Override // com.shizhuang.duapp.common.recyclerview.holder.DuViewHolder
        public void onBind(CouponItemModel couponItemModel, int i) {
            CouponItemModel couponItemModel2 = couponItemModel;
            int i3 = 0;
            Integer num = new Integer(i);
            boolean z = true;
            if (!PatchProxy.proxy(new Object[]{couponItemModel2, num}, this, changeQuickRedirect, false, 154690, new Class[]{CouponItemModel.class, Integer.TYPE}, Void.TYPE).isSupported) {
                boolean areEqual = Intrinsics.areEqual(couponItemModel2.getType(), "COUPON");
                ImageView imageView = this.f15766c;
                if (imageView != null) {
                    String limitDesc = couponItemModel2.getLimitDesc();
                    imageView.setVisibility(!(limitDesc == null || limitDesc.length() == 0) ? 0 : 8);
                }
                TextView textView = this.d;
                if (textView != null) {
                    String limitDesc2 = couponItemModel2.getLimitDesc();
                    if (!(limitDesc2 == null || limitDesc2.length() == 0)) {
                        z = false;
                    }
                    if (z) {
                        i3 = 8;
                    }
                    textView.setVisibility(i3);
                }
                TextView textView2 = this.d;
                if (textView2 != null) {
                    textView2.setText(couponItemModel2.getLimitDesc());
                }
                TextView textView3 = this.f;
                if (textView3 != null) {
                    textView3.setText(couponItemModel2.thresholdStr());
                }
                TextView textView4 = this.f15767g;
                if (textView4 != null) {
                    textView4.setText(areEqual ? "专属优惠券" : "无门槛津贴");
                }
                TextView textView5 = this.f15768h;
                if (textView5 != null) {
                    StringBuilder h12 = f.h("有效期至");
                    h12.append(jo.a.c(couponItemModel2.getExpireTime(), "yyyy.MM.dd"));
                    textView5.setText(h12.toString());
                }
                ImageView imageView2 = this.b;
                if (imageView2 != null) {
                    imageView2.setImageResource(areEqual ? R.drawable.bg_cp_dialog_list_coupon : R.drawable.bg_cp_dialog_list_allowance);
                }
                if (couponItemModel2.isCoupon() && couponItemModel2.getAmount() == 0) {
                    FontText fontText = this.e;
                    if (fontText != null) {
                        fontText.setText("包邮");
                    }
                    FontText fontText2 = this.e;
                    if (fontText2 != null) {
                        fontText2.setTextSize(28.0f);
                    }
                    FontText fontText3 = this.e;
                    if (fontText3 != null) {
                        fontText3.setTextColor(d.a(R.color.color_blue_5ffeff));
                    }
                    TextView textView6 = this.f;
                    if (textView6 != null) {
                        textView6.setTextColor(d.a(R.color.color_white));
                    }
                    TextView textView7 = this.f15767g;
                    if (textView7 != null) {
                        textView7.setText("包邮券");
                    }
                } else if (areEqual) {
                    FontText fontText4 = this.e;
                    if (fontText4 != null) {
                        fontText4.c(String.valueOf(couponItemModel2.getAmount()), 17, 34);
                    }
                    FontText fontText5 = this.e;
                    if (fontText5 != null) {
                        fontText5.setTextColor(d.a(R.color.color_blue_5ffeff));
                    }
                    TextView textView8 = this.f;
                    if (textView8 != null) {
                        textView8.setTextColor(d.a(R.color.color_white));
                    }
                } else {
                    FontText fontText6 = this.e;
                    if (fontText6 != null) {
                        fontText6.c(String.valueOf(couponItemModel2.getAmount()), 17, 34);
                    }
                    FontText fontText7 = this.e;
                    if (fontText7 != null) {
                        fontText7.setTextColor(d.a(R.color.color_01C2C3));
                    }
                    TextView textView9 = this.f;
                    if (textView9 != null) {
                        textView9.setTextColor(d.a(R.color.color_gray_7f7f8e));
                    }
                }
            }
        }
    }

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

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

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

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

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

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

        public a(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

    public static void s(CouponPackageDialog couponPackageDialog, Bundle bundle) {
        boolean z = false;
        if (!PatchProxy.proxy(new Object[]{bundle}, couponPackageDialog, changeQuickRedirect, false, 154672, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
            Bundle arguments = couponPackageDialog.getArguments();
            String str = null;
            couponPackageDialog.f15762g = arguments != null ? (CouponPackageModel) arguments.getParcelable("couponPackageModel") : null;
            Bundle arguments2 = couponPackageDialog.getArguments();
            if (arguments2 != null) {
                z = arguments2.getBoolean("isShowSwellTask");
            }
            couponPackageDialog.f15763h = z;
            Bundle arguments3 = couponPackageDialog.getArguments();
            couponPackageDialog.i = arguments3 != null ? arguments3.getString("flag") : null;
            Bundle arguments4 = couponPackageDialog.getArguments();
            if (arguments4 != null) {
                str = arguments4.getString("loadUrl");
            }
            couponPackageDialog.j = str;
        }
    }

    public static void t(CouponPackageDialog couponPackageDialog) {
        if (!PatchProxy.proxy(new Object[0], couponPackageDialog, changeQuickRedirect, false, 154677, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
            z.f33482a.f(((AppCompatTextView) couponPackageDialog._$_findCachedViewById(R.id.tvTitle)).getText().toString(), couponPackageDialog.l, "1", couponPackageDialog.j, couponPackageDialog.i);
        }
    }

    public static void u(CouponPackageDialog couponPackageDialog) {
        if (!PatchProxy.proxy(new Object[0], couponPackageDialog, changeQuickRedirect, false, 154683, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
        }
    }

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

    public static void w(CouponPackageDialog couponPackageDialog, View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, couponPackageDialog, changeQuickRedirect, false, 154687, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            super.onViewCreated(view, bundle);
        }
    }

    public View _$_findCachedViewById(int i3) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3)}, this, changeQuickRedirect, false, 154680, 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;
    }

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

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, 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, 154671, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onCreate(this, bundle);
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, 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, 154684, 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, com.shizhuang.duapp.common.dialog.BaseDialogFragment, androidx.fragment.app.DialogFragment
    public void onDestroyView() {
        HashMap hashMap;
        super.onDestroyView();
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 154681, new Class[0], Void.TYPE).isSupported && (hashMap = this.m) != null) {
            hashMap.clear();
        }
    }

    @Override // androidx.fragment.app.Fragment, androidx.fragment.app.DialogFragment
    public void onDetach() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 154679, new Class[0], Void.TYPE).isSupported) {
            super.onDetach();
            Animation animation = this.f;
            if (animation != null) {
                animation.cancel();
            }
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, 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, 154676, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onResume(this);
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, 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, 154682, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onStart(this);
        }
    }

    @Override // com.shizhuang.duapp.common.dialog.DuDialogFragment, 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, 154686, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onViewCreated(this, view, bundle);
        }
    }

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

    /* JADX WARNING: Removed duplicated region for block: B:102:0x033e  */
    /* JADX WARNING: Removed duplicated region for block: B:103:0x0340  */
    /* JADX WARNING: Removed duplicated region for block: B:105:0x0343  */
    /* JADX WARNING: Removed duplicated region for block: B:106:0x0359  */
    /* JADX WARNING: Removed duplicated region for block: B:99:0x0314  */
    @Override // com.shizhuang.duapp.common.dialog.BaseDialogFragment
    @SuppressLint({"SetTextI18n"})
    public void r(@NotNull View view) {
        TextView textView;
        String str;
        List<CouponItemModel> items;
        List<CouponItemModel> items2;
        List<CouponItemModel> items3;
        CouponItemModel couponItemModel;
        CouponModel swell;
        List<CouponItemModel> items4;
        CouponItemModel couponItemModel2;
        List<CouponItemModel> items5;
        if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 154675, new Class[]{View.class}, Void.TYPE).isSupported) {
            ((ImageView) view.findViewById(R.id.ivClose)).setOnClickListener(new CouponPackageDialog$initView$1(this));
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 154678, new Class[0], Void.TYPE).isSupported) {
                ((DuImageLoaderView) _$_findCachedViewById(R.id.ivBgCircle)).i(this.e).x();
                this.f = AnimationUtils.loadAnimation(getActivity(), R.anim.dh_anim_display_coupon_circle);
                LinearInterpolator linearInterpolator = new LinearInterpolator();
                Animation animation = this.f;
                if (animation != null) {
                    animation.setInterpolator(linearInterpolator);
                }
                ((DuImageLoaderView) _$_findCachedViewById(R.id.ivBgCircle)).startAnimation(this.f);
            }
            CouponPackageModel couponPackageModel = this.f15762g;
            if (couponPackageModel != null) {
                String str2 = "优惠券";
                int i3 = 8;
                if (this.f15763h) {
                    CouponModel strategy = couponPackageModel.getStrategy();
                    if (((strategy == null || (items5 = strategy.getItems()) == null) ? 0 : items5.size()) == 0) {
                        CouponModel normal = couponPackageModel.getNormal();
                        if (normal != null && (items3 = normal.getItems()) != null && (couponItemModel = (CouponItemModel) CollectionsKt___CollectionsKt.firstOrNull((List) items3)) != null && (swell = couponPackageModel.getSwell()) != null && (items4 = swell.getItems()) != null && (couponItemModel2 = (CouponItemModel) CollectionsKt___CollectionsKt.firstOrNull((List) items4)) != null) {
                            int amount = couponItemModel2.getAmount() + couponItemModel.getAmount();
                            boolean areEqual = Intrinsics.areEqual(couponItemModel.getType(), "COUPON");
                            AppCompatTextView appCompatTextView = (AppCompatTextView) _$_findCachedViewById(R.id.tvTitle);
                            StringBuilder h12 = f.h("恭喜获得");
                            if (!areEqual) {
                                str2 = "津贴";
                            }
                            h12.append(str2);
                            appCompatTextView.setText(h12.toString());
                            ((AppCompatTextView) _$_findCachedViewById(R.id.tvCouponSwellExplain)).setText("最高可膨胀至" + amount + (char) 20803);
                            ((AppCompatTextView) _$_findCachedViewById(R.id.tvCouponSwellExplain)).setVisibility(0);
                            ((ViewStub) getView().findViewById(R.id.vsCouponContent)).setLayoutResource(areEqual ? R.layout.vs_cp_dialog_coupon : R.layout.vs_cp_dialog_allowance);
                            ViewGroup.LayoutParams layoutParams = ((ViewStub) getView().findViewById(R.id.vsCouponContent)).getLayoutParams();
                            if (!(layoutParams instanceof LinearLayout.LayoutParams)) {
                                layoutParams = null;
                            }
                            LinearLayout.LayoutParams layoutParams2 = (LinearLayout.LayoutParams) layoutParams;
                            if (layoutParams2 != null) {
                                layoutParams2.topMargin = fi.b.b((float) (areEqual ? 59 : 44));
                                float f12 = (float) 5;
                                layoutParams2.leftMargin = fi.b.b(f12);
                                layoutParams2.rightMargin = fi.b.b(f12);
                                layoutParams2.bottomMargin = fi.b.b((float) 9);
                            }
                            ((ViewStub) getView().findViewById(R.id.vsCouponContent)).setVisibility(0);
                            FontText fontText = (FontText) view.findViewById(R.id.tvAmount1);
                            TextView textView2 = (TextView) view.findViewById(R.id.tvLimit1);
                            FontText fontText2 = (FontText) view.findViewById(R.id.tvAmount2);
                            TextView textView3 = (TextView) view.findViewById(R.id.tvLimit2);
                            int i12 = 12;
                            fontText.c(String.valueOf(couponItemModel.getAmount()), areEqual ? 14 : 12, areEqual ? 26 : 24);
                            String valueOf = String.valueOf(amount);
                            if (areEqual) {
                                i12 = 16;
                            }
                            fontText2.c(valueOf, i12, areEqual ? 34 : 28);
                            textView2.setText(couponItemModel.thresholdStr());
                            textView3.setText(couponItemModel.thresholdStr());
                            TextView textView4 = (TextView) view.findViewById(R.id.tvToUse);
                            textView = (TextView) view.findViewById(R.id.tvToDouble);
                            if (this.f15763h) {
                                i3 = 0;
                            }
                            textView.setVisibility(i3);
                            textView4.setOnClickListener(new CouponPackageDialog$initView$$inlined$let$lambda$1(textView4, this, view));
                            textView.setOnClickListener(new CouponPackageDialog$initView$$inlined$let$lambda$2(textView, this, view));
                            StringBuilder sb2 = new StringBuilder();
                            sb2.append(textView4.getText().toString());
                            if (!(textView.getVisibility() != 0)) {
                                StringBuilder h13 = f.h(",");
                                h13.append(textView.getText().toString());
                                str = h13.toString();
                            } else {
                                str = "";
                            }
                            sb2.append(str);
                            this.l = sb2.toString();
                        }
                        return;
                    }
                }
                ((AppCompatTextView) _$_findCachedViewById(R.id.tvTitle)).setText("恭喜获得");
                ((ViewStub) getView().findViewById(R.id.vsCouponContent)).setLayoutResource(R.layout.vs_cp_dialog_list);
                ((ViewStub) getView().findViewById(R.id.vsCouponContent)).setVisibility(0);
                FrameLayout frameLayout = (FrameLayout) view.findViewById(R.id.flContent);
                RecyclerView recyclerView = (RecyclerView) view.findViewById(R.id.rvList);
                CouponModel normal2 = couponPackageModel.getNormal();
                CouponItemModel couponItemModel3 = (normal2 == null || (items2 = normal2.getItems()) == null) ? null : (CouponItemModel) CollectionsKt___CollectionsKt.firstOrNull((List) items2);
                CouponModel swell2 = couponPackageModel.getSwell();
                CouponItemModel couponItemModel4 = (swell2 == null || (items = swell2.getItems()) == null) ? null : (CouponItemModel) CollectionsKt___CollectionsKt.firstOrNull((List) items);
                if (couponItemModel3 == null || !this.f15763h || couponItemModel4 == null) {
                    ((AppCompatTextView) _$_findCachedViewById(R.id.tvCouponSwellExplain)).setVisibility(8);
                } else {
                    ((AppCompatTextView) _$_findCachedViewById(R.id.tvCouponSwellExplain)).setVisibility(0);
                    boolean areEqual2 = Intrinsics.areEqual(couponItemModel3.getType(), "COUPON");
                    int amount2 = couponItemModel4.getAmount() + couponItemModel3.getAmount();
                    AppCompatTextView appCompatTextView2 = (AppCompatTextView) _$_findCachedViewById(R.id.tvCouponSwellExplain);
                    StringBuilder sb3 = new StringBuilder();
                    if (!areEqual2) {
                        str2 = "津贴";
                    }
                    sb3.append(str2);
                    sb3.append("最高可膨胀至");
                    sb3.append(amount2);
                    sb3.append((char) 20803);
                    appCompatTextView2.setText(sb3.toString());
                }
                ArrayList arrayList = new ArrayList();
                if (couponItemModel3 != null) {
                    arrayList.add(couponItemModel3);
                }
                CouponModel strategy2 = couponPackageModel.getStrategy();
                if ((strategy2 != null ? strategy2.getItems() : null) != null) {
                    arrayList.addAll(couponPackageModel.getStrategy().getItems());
                }
                frameLayout.getLayoutParams().height = fi.b.b((float) (arrayList.size() > 2 ? 208 : 168));
                recyclerView.setLayoutManager(new LinearLayoutManager(getContext()));
                recyclerView.addItemDecoration(new LinearItemDecoration(0, fi.b.b(8.0f), 0, false, false, 24));
                recyclerView.setAdapter(new ItemAdapter(arrayList));
                TextView textView42 = (TextView) view.findViewById(R.id.tvToUse);
                textView = (TextView) view.findViewById(R.id.tvToDouble);
                if (this.f15763h) {
                }
                textView.setVisibility(i3);
                textView42.setOnClickListener(new CouponPackageDialog$initView$$inlined$let$lambda$1(textView42, this, view));
                textView.setOnClickListener(new CouponPackageDialog$initView$$inlined$let$lambda$2(textView, this, view));
                StringBuilder sb22 = new StringBuilder();
                sb22.append(textView42.getText().toString());
                if (!(textView.getVisibility() != 0)) {
                }
                sb22.append(str);
                this.l = sb22.toString();
            }
        }
    }
}