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


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

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ObjectAnimator;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.text.SpannableStringBuilder;
import android.text.style.ForegroundColorSpan;
import android.util.ArrayMap;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.core.content.ContextCompat;
import androidx.core.view.ViewKt;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentViewModelLazyKt;
import androidx.lifecycle.LifecycleOwnerKt;
import androidx.lifecycle.LiveData;
import com.alibaba.android.vlayout.DelegateAdapter;
import com.knightboost.observability.extension.pagestartup.PageStartupTraceManager;
import com.knightboost.observability.extension.pagestartup.PageStartupTracer;
import com.knightboost.observability.extension.pagestartup.annotation.StartupTracePage;
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.base.inter.IViewController;
import com.shizhuang.duapp.common.base.list.DuListFragment;
import com.shizhuang.duapp.common.component.module.DuModuleAdapter;
import com.shizhuang.duapp.common.event.FavoriteChangeEvent;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.helper.LoginHelper;
import com.shizhuang.duapp.common.utils.livebus.LiveEventBus;
import com.shizhuang.duapp.common.utils.livebus.PageEventBus;
import com.shizhuang.duapp.common.utils.screenshot.ScreenShotUtils;
import com.shizhuang.duapp.common.widget.font.IconFontTextView;
import com.shizhuang.duapp.libs.bpm.BM;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.duimageloaderview.options.DuRequestOptions;
import com.shizhuang.duapp.libs.smartlayout.DuSmartLayout;
import com.shizhuang.duapp.libs.yeezy.Yeezy;
import com.shizhuang.duapp.modules.du_mall_common.api.CommonProductFacade;
import com.shizhuang.duapp.modules.du_mall_common.constant.MallABTest;
import com.shizhuang.duapp.modules.du_mall_common.extension.LiveDataExtensionKt;
import com.shizhuang.duapp.modules.du_mall_common.fav.FeedItemQuickFavCSpuModel;
import com.shizhuang.duapp.modules.du_mall_common.fav.FeedItemQuickFavHelper;
import com.shizhuang.duapp.modules.du_mall_common.model.ABTestModel;
import com.shizhuang.duapp.modules.du_mall_common.model.FavoriteCouponEntryModel;
import com.shizhuang.duapp.modules.du_mall_common.model.ProductListItemModel;
import com.shizhuang.duapp.modules.du_mall_common.model.product.PmPreviewModel;
import com.shizhuang.duapp.modules.du_mall_common.router.model.MallProductJumpModel;
import com.shizhuang.duapp.modules.du_mall_common.utils.exposure.IMallExposureHelper;
import com.shizhuang.duapp.modules.du_mall_common.utils.exposure.MallModuleExposureHelper;
import com.shizhuang.duapp.modules.du_mall_common.views.ProductItemDecoration;
import com.shizhuang.duapp.modules.productv2.api.ProductFacadeV2;
import com.shizhuang.duapp.modules.productv2.api.ProductService;
import com.shizhuang.duapp.modules.productv2.favorite.ReducePriceNoticeDialogV2;
import com.shizhuang.duapp.modules.productv2.favorite.coupon.FavoriteCouponEntranceDialog;
import com.shizhuang.duapp.modules.productv2.favorite.coupon.facade.CouponEntranceModel;
import com.shizhuang.duapp.modules.productv2.favorite.coupon.facade.CouponService;
import com.shizhuang.duapp.modules.productv2.favorite.model.BaseFavoriteItemModel;
import com.shizhuang.duapp.modules.productv2.favorite.model.FavModelAggregation;
import com.shizhuang.duapp.modules.productv2.favorite.model.FavModelExtend;
import com.shizhuang.duapp.modules.productv2.favorite.model.FavModelNotice;
import com.shizhuang.duapp.modules.productv2.favorite.model.FavModelPushNotice;
import com.shizhuang.duapp.modules.productv2.favorite.model.FavRequestEvent;
import com.shizhuang.duapp.modules.productv2.favorite.model.FavSloganModel;
import com.shizhuang.duapp.modules.productv2.favorite.model.FavoriteInfoModel;
import com.shizhuang.duapp.modules.productv2.favorite.model.FavoriteItemModel;
import com.shizhuang.duapp.modules.productv2.favorite.model.FavoriteProperties;
import com.shizhuang.duapp.modules.productv2.favorite.model.FavoriteToExpireDiscountVO;
import com.shizhuang.duapp.modules.productv2.favorite.model.Remind;
import com.shizhuang.duapp.modules.productv2.favorite.model.SimilarModel;
import com.shizhuang.duapp.modules.productv2.favorite.views.FavHeaderFilterView;
import com.shizhuang.duapp.modules.productv2.model.FavoriteEmptyContentModel;
import com.shizhuang.duapp.modules.productv2.model.RecommendTitleModel;
import com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener;
import com.shizhuang.dudatastatistics.factory.PoizonAnalyzeFactory;
import df.q;
import ij.z;
import ik1.b0;
import ik1.h0;
import j50.p;
import j60.f0;
import j60.x;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.concurrent.CancellationException;
import k60.a;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Metadata;
import kotlin.Pair;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt__IterablesKt;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.coroutines.CoroutineContext;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.functions.Function2;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlin.jvm.internal.TypeIntrinsics;
import kotlin.text.StringsKt__StringsJVMKt;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Job;
import kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1;
import l51.k;
import l51.m;
import l51.n;
import l51.o;
import l51.u;
import mn.a;
import nc.j;
import nc.t;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
import org.json.JSONArray;
import rd.l;
import td.r;
import td.s;

@StartupTracePage(traceRealUserExperience = true)
@Metadata(bv = {}, d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\u000b\n\u0002\b\u0006\b\u0007\u0018\u00002\u00020\u00012\u00020\u00022\u00020\u0003:\u0001\u0011B\u0007¢\u0006\u0004\b\u000f\u0010\u0010J\u0010\u0010\u0007\u001a\u00020\u00062\u0006\u0010\u0005\u001a\u00020\u0004H\u0007J\u0010\u0010\t\u001a\u00020\u00062\u0006\u0010\u0005\u001a\u00020\bH\u0007J\b\u0010\n\u001a\u00020\u0006H\u0016J\b\u0010\u000b\u001a\u00020\u0006H\u0016J\u0010\u0010\u000e\u001a\u00020\u00062\u0006\u0010\r\u001a\u00020\fH\u0016¨\u0006\u0012"}, d2 = {"Lcom/shizhuang/duapp/modules/productv2/favorite/FavoriteListFragment;", "Lcom/shizhuang/duapp/common/base/list/DuListFragment;", "Lcom/shizhuang/duapp/modules/productv2/views/OnFavoriteItemEventListener;", "Lcom/shizhuang/duapp/modules/productv2/favorite/ReducePriceNoticeDialogV2$OnModifyReminderListener;", "Lcom/shizhuang/duapp/common/event/FavoriteChangeEvent;", "event", "", "onEventChanged", "Lh50/j;", "onEventChange", "onResume", "onPause", "", "hidden", "onHiddenChanged", "<init>", "()V", "a", "du_product_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: FavoriteListFragment.kt */
public final class FavoriteListFragment extends DuListFragment implements OnFavoriteItemEventListener, ReducePriceNoticeDialogV2.OnModifyReminderListener {
    @NotNull
    public static final a W = new a(null);
    public static ChangeQuickRedirect changeQuickRedirect;
    public MallModuleExposureHelper A;
    public CoroutineScope B;
    public Job C;
    public int D;
    public boolean E;
    public boolean F;
    public boolean G;
    public final List<BaseFavoriteItemModel> H;
    public final List<Object> I;
    public int J;
    public final String K;
    public FavoriteCouponEntranceDialog L;
    public long M;
    public final Lazy N;
    public final Lazy O;
    public final List<ABTestModel> P;
    public boolean Q;
    public boolean R;
    public final LinkedHashSet<Long> S;
    public boolean T;
    public final k60.a U;
    public HashMap V;
    public final boolean i;
    public FeedItemQuickFavHelper j;
    public final DuModuleAdapter k;
    public MallModuleExposureHelper l;
    public final Lazy m;
    @NotNull
    public final DuModuleAdapter n;
    @NotNull
    public final DuModuleAdapter o;
    public boolean p;
    @NotNull

    /* renamed from: q  reason: collision with root package name */
    public String f23725q;
    @NotNull
    public String r;
    public int s;
    public boolean t;

    /* renamed from: u  reason: collision with root package name */
    public boolean f23726u;

    /* renamed from: v  reason: collision with root package name */
    public boolean f23727v;
    public boolean w;
    public final Function0<Unit> x;
    public FavoriteCouponEntryModel y;
    public final ef.b<FavoriteInfoModel> z;

    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(FavoriteListFragment favoriteListFragment, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{favoriteListFragment, bundle}, null, changeQuickRedirect, true, 295437, new Class[]{FavoriteListFragment.class, Bundle.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                FavoriteListFragment.E(favoriteListFragment, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (favoriteListFragment.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.productv2.favorite.FavoriteListFragment")) {
                    jn.b.f34396a.fragmentOnCreateMethod(favoriteListFragment, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

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

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

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

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

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

        public a(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

    /* compiled from: FavoriteListFragment.kt */
    public static final class b extends k60.a {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ FavoriteListFragment e;

        /* JADX WARN: Incorrect args count in method signature: ()V */
        public b(FavoriteListFragment favoriteListFragment) {
            this.e = favoriteListFragment;
        }

        @Override // k60.a
        public void m(@NotNull a.C0525a aVar) {
            if (!PatchProxy.proxy(new Object[]{aVar}, this, changeQuickRedirect, false, 295443, new Class[]{a.C0525a.class}, Void.TYPE).isSupported) {
                super.m(aVar);
                BM.mall().b("mall_favorite_load", aVar.a(), aVar.f(), MapsKt__MapsKt.mapOf(tf.a.e(aVar, "prepareDuration"), u1.a.h(aVar, "requestDuration"), us.h.e(aVar, "layoutDuration")));
                PageStartupTracer c5 = PageStartupTraceManager.f5275a.c(this.e);
                if (c5 != null) {
                    c5.setTag("section", "mall_favorite_load");
                    c5.setTag("isCache", aVar.f());
                    c5.setMetric("allDuration", Long.valueOf(aVar.a()));
                    c5.setMetric("prepareDuration", Long.valueOf(aVar.c()));
                    c5.setMetric("requestDuration", Long.valueOf(aVar.e()));
                    c5.setMetric("layoutDuration", Long.valueOf(aVar.b()));
                    c5.endStartupOfUserExperience();
                }
            }
        }
    }

    /* compiled from: FavoriteListFragment.kt */
    public static final class c implements Function1<ArrayMap<String, Object>, Unit> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ BaseFavoriteItemModel b;

        public c(BaseFavoriteItemModel baseFavoriteItemModel) {
            this.b = baseFavoriteItemModel;
        }

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // kotlin.jvm.functions.Function1
        public Unit invoke(ArrayMap<String, Object> arrayMap) {
            ArrayMap<String, Object> arrayMap2 = arrayMap;
            if (!PatchProxy.proxy(new Object[]{arrayMap2}, this, changeQuickRedirect, false, 295447, new Class[]{ArrayMap.class}, Void.TYPE).isSupported) {
                FavoriteProperties favoriteProperties = this.b.getFavoriteProperties();
                String name = favoriteProperties != null ? favoriteProperties.getName() : null;
                if (name == null) {
                    name = "";
                }
                arrayMap2.put("product_name", name);
                arrayMap2.put("sku_id", Long.valueOf(this.b.getSkuId()));
                arrayMap2.put("sku_price", x.f(x.f34215a, Long.valueOf(this.b.getShowPrice()), false, null, 6));
                arrayMap2.put("spu_id", Long.valueOf(this.b.getSpuId()));
                arrayMap2.put("price_variance", String.valueOf(this.b.getShowPrice() - this.b.getPrice()));
            }
            return Unit.INSTANCE;
        }
    }

    /* compiled from: FavoriteListFragment.kt */
    public static final class d implements DialogInterface.OnDismissListener {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ FavoriteListFragment b;

        public d(FavoriteListFragment favoriteListFragment) {
            this.b = favoriteListFragment;
        }

        public final void onDismiss(DialogInterface dialogInterface) {
            if (!PatchProxy.proxy(new Object[]{dialogInterface}, this, changeQuickRedirect, false, 295448, new Class[]{DialogInterface.class}, Void.TYPE).isSupported) {
                this.b.L = null;
            }
        }
    }

    /* compiled from: FavoriteListFragment.kt */
    public static final class e extends AnimatorListenerAdapter {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ FavoriteListFragment b;

        /* JADX WARN: Incorrect args count in method signature: ()V */
        public e(FavoriteListFragment favoriteListFragment) {
            this.b = favoriteListFragment;
        }

        public void onAnimationEnd(@org.jetbrains.annotations.Nullable Animator animator, boolean z) {
            if (!PatchProxy.proxy(new Object[]{animator, new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 295449, new Class[]{Animator.class, Boolean.TYPE}, Void.TYPE).isSupported) {
                super.onAnimationEnd(animator, z);
                fo.a.m("dismissTips end", new Object[0]);
                FavoriteListFragment favoriteListFragment = this.b;
                favoriteListFragment.f23727v = false;
                RelativeLayout relativeLayout = (RelativeLayout) favoriteListFragment._$_findCachedViewById(R.id.bottomFloatLayout);
                if (relativeLayout != null) {
                    ViewKt.setVisible(relativeLayout, false);
                }
                this.b.w = false;
            }
        }
    }

    /* compiled from: FavoriteListFragment.kt */
    public static final class f extends r<FavoriteInfoModel> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ FavoriteListFragment b;

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

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public f(FavoriteListFragment favoriteListFragment, boolean z, String str, IViewController iViewController, boolean z4) {
            super(iViewController, z4);
            this.b = favoriteListFragment;
            this.f23728c = z;
            this.d = str;
        }

        @Override // td.r, com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.s, td.a
        public void onBzError(@org.jetbrains.annotations.Nullable l<FavoriteInfoModel> lVar) {
            if (!PatchProxy.proxy(new Object[]{lVar}, this, changeQuickRedirect, false, 295453, new Class[]{l.class}, Void.TYPE).isSupported) {
                super.onBzError(lVar);
                this.b.N().q(null);
                FavoriteListFragment favoriteListFragment = this.b;
                favoriteListFragment.Q = false;
                favoriteListFragment.U.c(lVar);
                this.b.C(this.f23728c, false);
            }
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onFinish() {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295454, new Class[0], Void.TYPE).isSupported) {
                super.onFinish();
                FavoriteListFragment favoriteListFragment = this.b;
                favoriteListFragment.Q = false;
                MallModuleExposureHelper mallModuleExposureHelper = favoriteListFragment.A;
                if (mallModuleExposureHelper == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("listExposureHelper");
                }
                mallModuleExposureHelper.startAttachExposure(this.f23728c);
            }
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        /* JADX DEBUG: Failed to insert an additional move for type inference into block B:281:0x05da */
        /* JADX DEBUG: Multi-variable search result rejected for r5v11, resolved type: java.lang.String */
        /* JADX DEBUG: Multi-variable search result rejected for r5v12, resolved type: java.lang.String */
        /* JADX DEBUG: Multi-variable search result rejected for r5v14, resolved type: java.lang.String */
        /* JADX DEBUG: Multi-variable search result rejected for r5v15, resolved type: java.lang.String */
        /* JADX WARN: Multi-variable type inference failed */
        /* JADX WARN: Type inference failed for: r1v1, types: [byte, boolean] */
        /* JADX WARNING: Removed duplicated region for block: B:185:0x0483  */
        /* JADX WARNING: Removed duplicated region for block: B:193:0x04e4  */
        /* JADX WARNING: Unknown variable types count: 1 */
        @Override // td.r, com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(FavoriteInfoModel favoriteInfoModel) {
            String str;
            String str2;
            List<BaseFavoriteItemModel> list;
            Pair pair;
            Long l;
            boolean z;
            int i;
            Integer visibleDay;
            FavModelExtend extend;
            Integer reducePriceCount;
            FavModelExtend extend2;
            Integer totalCount;
            Object obj;
            boolean z4;
            Integer scope;
            FavoriteInfoModel favoriteInfoModel2 = favoriteInfoModel;
            if (!PatchProxy.proxy(new Object[]{favoriteInfoModel2}, this, changeQuickRedirect, false, 295452, new Class[]{FavoriteInfoModel.class}, Void.TYPE).isSupported) {
                super.onSuccess(favoriteInfoModel2);
                FavoriteListFragment favoriteListFragment = this.b;
                ?? r12 = this.f23728c;
                String str3 = this.d;
                if (!PatchProxy.proxy(new Object[]{favoriteInfoModel2, new Byte(r12 == true ? (byte) 1 : 0), str3}, favoriteListFragment, FavoriteListFragment.changeQuickRedirect, false, 295376, new Class[]{FavoriteInfoModel.class, Boolean.TYPE, String.class}, Void.TYPE).isSupported) {
                    if (r12 != 0) {
                        if ((str3.length() == 0) || favoriteListFragment.N().k()) {
                            favoriteListFragment.N().r(favoriteInfoModel2);
                        }
                    }
                    if (r12 != 0) {
                        favoriteListFragment.f23726u = favoriteInfoModel2 != null ? favoriteInfoModel2.getNewUser() : false;
                    }
                    if (!(favoriteInfoModel2 == null || (scope = favoriteInfoModel2.getScope()) == null)) {
                        favoriteListFragment.s = scope.intValue();
                    }
                    if (favoriteInfoModel2 == null || (str2 = favoriteInfoModel2.getLastId()) == null) {
                        str2 = "";
                    }
                    favoriteListFragment.f23725q = str2;
                    ArrayList arrayList = new ArrayList();
                    List<BaseFavoriteItemModel> response = favoriteInfoModel2 != null ? favoriteInfoModel2.getResponse() : null;
                    if (response == null) {
                        response = CollectionsKt__CollectionsKt.emptyList();
                    }
                    ArrayList arrayList2 = new ArrayList();
                    Iterator<T> it2 = response.iterator();
                    while (it2.hasNext()) {
                        Object mapToModel = it2.next().mapToModel(2);
                        if (mapToModel != null) {
                            arrayList2.add(mapToModel);
                        }
                    }
                    arrayList.addAll(arrayList2);
                    if (!PatchProxy.proxy(new Object[]{arrayList}, favoriteListFragment, FavoriteListFragment.changeQuickRedirect, false, 295375, new Class[]{List.class}, Void.TYPE).isSupported && !favoriteListFragment.E && !favoriteListFragment.R) {
                        ArrayList arrayList3 = new ArrayList();
                        Iterator it3 = arrayList.iterator();
                        while (it3.hasNext()) {
                            Object next = it3.next();
                            if (next instanceof BaseFavoriteItemModel) {
                                arrayList3.add(next);
                            }
                        }
                        Iterator it4 = arrayList3.iterator();
                        while (true) {
                            if (!it4.hasNext()) {
                                obj = null;
                                break;
                            }
                            obj = it4.next();
                            List<SimilarModel> similarList = ((BaseFavoriteItemModel) obj).getSimilarList();
                            if ((similarList != null ? similarList.size() : 0) > 4) {
                                z4 = true;
                                continue;
                            } else {
                                z4 = false;
                                continue;
                            }
                            if (z4) {
                                break;
                            }
                        }
                        BaseFavoriteItemModel baseFavoriteItemModel = (BaseFavoriteItemModel) obj;
                        if (baseFavoriteItemModel != null) {
                            favoriteListFragment.R = true;
                            baseFavoriteItemModel.setSimilarLayoutOpen(true);
                        }
                    }
                    if (!favoriteListFragment.N().k()) {
                        if (favoriteListFragment.f23725q.length() == 0) {
                            arrayList.add(new j(fi.b.b((float) 30), null, 2));
                        }
                    }
                    if (r12 != 0) {
                        if ((favoriteInfoModel2 != null ? favoriteInfoModel2.getExpireDiscountVO() : null) == null || favoriteInfoModel2.getExpireDiscountVO().getExpireTime() <= 0 || favoriteInfoModel2.getExpireDiscountVO().getExpireAmt() <= 0) {
                            favoriteListFragment.D = 0;
                            ((RelativeLayout) favoriteListFragment._$_findCachedViewById(R.id.bottomFloatLayout)).setVisibility(8);
                            if (!PatchProxy.proxy(new Object[0], favoriteListFragment, FavoriteListFragment.changeQuickRedirect, false, 295370, new Class[0], Void.TYPE).isSupported) {
                                ProductFacadeV2 productFacadeV2 = ProductFacadeV2.f23068a;
                                s withoutToast = new o(favoriteListFragment, favoriteListFragment).withoutToast();
                                if (!PatchProxy.proxy(new Object[]{withoutToast}, productFacadeV2, ProductFacadeV2.changeQuickRedirect, false, 285254, new Class[]{s.class}, Void.TYPE).isSupported) {
                                    td.j.doRequest(((ProductService) td.j.getJavaGoApi(ProductService.class)).getFavoriteCouponEntry(), withoutToast);
                                }
                            }
                        } else {
                            favoriteListFragment.D = 2;
                            FavoriteToExpireDiscountVO expireDiscountVO = favoriteInfoModel2.getExpireDiscountVO();
                            if (!PatchProxy.proxy(new Object[]{expireDiscountVO}, favoriteListFragment, FavoriteListFragment.changeQuickRedirect, false, 295357, new Class[]{FavoriteToExpireDiscountVO.class}, Void.TYPE).isSupported) {
                                if (favoriteListFragment.B == null) {
                                    favoriteListFragment.B = b0.b();
                                }
                                favoriteListFragment.X();
                                ((TextView) favoriteListFragment._$_findCachedViewById(R.id.rightTv)).setText("");
                                ((TextView) favoriteListFragment._$_findCachedViewById(R.id.titleTv)).setText(favoriteListFragment.M(expireDiscountVO));
                                PoizonAnalyzeFactory.a().track("trade_collect_block_content_exposure", MapsKt__MapsKt.mapOf(TuplesKt.to("current_page", "46"), TuplesKt.to("block_type", "1054"), TuplesKt.to("community_type", 1), TuplesKt.to("customer_group_id", 1)));
                                ((RelativeLayout) favoriteListFragment._$_findCachedViewById(R.id.bottomFloatLayout)).setOnClickListener(new FavoriteListFragment$showCountDownTips$1(favoriteListFragment, expireDiscountVO));
                                if (!PatchProxy.proxy(new Object[]{expireDiscountVO}, favoriteListFragment, FavoriteListFragment.changeQuickRedirect, false, 295358, new Class[]{FavoriteToExpireDiscountVO.class}, Void.TYPE).isSupported) {
                                    Job job = favoriteListFragment.C;
                                    if (job != null) {
                                        job.cancel((Job) ((CancellationException) null));
                                    }
                                    CoroutineScope coroutineScope = favoriteListFragment.B;
                                    favoriteListFragment.C = coroutineScope != null ? ik1.f.i(coroutineScope, h0.b(), null, new FavoriteListFragment$startCountDown$1(favoriteListFragment, expireDiscountVO, null), 2, null) : null;
                                }
                            }
                        }
                        favoriteListFragment.n.setItems(arrayList);
                    } else {
                        ArrayList arrayList4 = new ArrayList();
                        Iterator it5 = arrayList.iterator();
                        while (it5.hasNext()) {
                            Object next2 = it5.next();
                            if (next2 instanceof BaseFavoriteItemModel) {
                                arrayList4.add(next2);
                            }
                        }
                        Iterator it6 = arrayList4.iterator();
                        while (it6.hasNext()) {
                            BaseFavoriteItemModel baseFavoriteItemModel2 = (BaseFavoriteItemModel) it6.next();
                            baseFavoriteItemModel2.setBatchRemoveMode(favoriteListFragment.E);
                            if ((favoriteListFragment.E && favoriteListFragment.F) && favoriteListFragment.H.size() < 2000) {
                                baseFavoriteItemModel2.setBatchRemoveSelected(true);
                                favoriteListFragment.H.add(baseFavoriteItemModel2);
                            }
                        }
                        favoriteListFragment.n.appendItems(arrayList);
                        if (favoriteListFragment.E && favoriteListFragment.F) {
                            ArrayList list2 = favoriteListFragment.n.getList();
                            ArrayList arrayList5 = new ArrayList();
                            for (Object obj2 : list2) {
                                if (obj2 instanceof BaseFavoriteItemModel) {
                                    arrayList5.add(obj2);
                                }
                            }
                            if (arrayList5.size() > 2000) {
                                favoriteListFragment.F = false;
                                q.v("数量已达上限,请先删除", 0);
                            }
                            favoriteListFragment.j0();
                        }
                    }
                    if ((((FavHeaderFilterView) favoriteListFragment._$_findCachedViewById(R.id.headerFilterView)).getVisibility() == 0) && r12 != 0) {
                        ((FavHeaderFilterView) favoriteListFragment._$_findCachedViewById(R.id.headerFilterView)).c((favoriteInfoModel2 == null || (extend2 = favoriteInfoModel2.getExtend()) == null || (totalCount = extend2.getTotalCount()) == null) ? 0 : totalCount.intValue(), (favoriteInfoModel2 == null || (extend = favoriteInfoModel2.getExtend()) == null || (reducePriceCount = extend.getReducePriceCount()) == null) ? 0 : reducePriceCount.intValue());
                    }
                    favoriteListFragment.d0();
                    int intValue = (favoriteInfoModel2 == null || (visibleDay = favoriteInfoModel2.getVisibleDay()) == null) ? 7 : visibleDay.intValue();
                    if (!PatchProxy.proxy(new Object[]{new Byte((byte) r12), new Integer(intValue)}, favoriteListFragment, FavoriteListFragment.changeQuickRedirect, false, 295378, new Class[]{Boolean.TYPE, Integer.TYPE}, Void.TYPE).isSupported && !favoriteListFragment.n.isEmpty() && r12 != 0) {
                        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], favoriteListFragment, FavoriteListFragment.changeQuickRedirect, false, 295382, new Class[0], Pair.class);
                        if (proxy.isSupported) {
                            pair = (Pair) proxy.result;
                        } else {
                            int i3 = 0;
                            for (Object obj3 : favoriteListFragment.n.getList()) {
                                int i12 = i3 + 1;
                                if (i3 < 0) {
                                    CollectionsKt__CollectionsKt.throwIndexOverflow();
                                }
                                if (obj3 instanceof BaseFavoriteItemModel) {
                                    pair = TuplesKt.to(Integer.valueOf(i3), obj3);
                                } else {
                                    i3 = i12;
                                }
                            }
                            list = null;
                            pair = TuplesKt.to(-1, null);
                            int intValue2 = ((Number) pair.component1()).intValue();
                            BaseFavoriteItemModel baseFavoriteItemModel3 = (BaseFavoriteItemModel) pair.component2();
                            if (baseFavoriteItemModel3 == null || !baseFavoriteItemModel3.isNotPriceAndOff()) {
                                l = (Long) df.b0.f("first_visit_favorite_similar", -1L);
                                if (l.longValue() > 0) {
                                    Date date = new Date(l.longValue());
                                    Date date2 = new Date(System.currentTimeMillis());
                                    PatchProxyResult proxy2 = PatchProxy.proxy(new Object[]{date, date2}, favoriteListFragment, FavoriteListFragment.changeQuickRedirect, false, 295381, new Class[]{Date.class, Date.class}, Integer.TYPE);
                                    if (proxy2.isSupported) {
                                        i = ((Integer) proxy2.result).intValue();
                                    } else {
                                        i = (int) ((date2.getTime() - date.getTime()) / ((long) 86400000));
                                    }
                                    if (i < intValue) {
                                        z = false;
                                        if (z) {
                                            if (baseFavoriteItemModel3 != null) {
                                                baseFavoriteItemModel3.setShowMask(true);
                                            }
                                            favoriteListFragment.u().post(new k(favoriteListFragment, intValue2));
                                            favoriteListFragment.u().postDelayed(new l51.l(favoriteListFragment, baseFavoriteItemModel3, intValue2), 3000);
                                        }
                                    }
                                }
                                z = true;
                                if (z) {
                                }
                            }
                        }
                        list = null;
                        int intValue22 = ((Number) pair.component1()).intValue();
                        BaseFavoriteItemModel baseFavoriteItemModel32 = (BaseFavoriteItemModel) pair.component2();
                        l = (Long) df.b0.f("first_visit_favorite_similar", -1L);
                        if (l.longValue() > 0) {
                        }
                        z = true;
                        if (z) {
                        }
                    } else {
                        list = null;
                    }
                    if (!PatchProxy.proxy(new Object[]{new Byte((byte) r12)}, favoriteListFragment, FavoriteListFragment.changeQuickRedirect, false, 295379, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
                        if ((!(~r12 ? 1 : 0) && !favoriteListFragment.n.isEmpty()) && !(favoriteListFragment.G ? 1 : 0)) {
                            favoriteListFragment.G = true;
                            favoriteListFragment.u().post(new m(favoriteListFragment, (Boolean) df.b0.f("has_visit_swipe_menu", Boolean.FALSE)));
                        }
                    }
                    favoriteListFragment.p = favoriteListFragment.f23725q.length() == 0;
                    List<BaseFavoriteItemModel> response2 = favoriteInfoModel2 != null ? favoriteInfoModel2.getResponse() : list;
                    if (response2 == null) {
                        response2 = CollectionsKt__CollectionsKt.emptyList();
                    }
                    if (!PatchProxy.proxy(new Object[]{response2}, favoriteListFragment, FavoriteListFragment.changeQuickRedirect, false, 295377, new Class[]{List.class}, Void.TYPE).isSupported) {
                        ArrayList arrayList6 = new ArrayList();
                        for (T t : response2) {
                            if (Intrinsics.areEqual(t.getHasMultiMedia(), Boolean.FALSE)) {
                                arrayList6.add(t);
                            }
                        }
                        ArrayList arrayList7 = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(arrayList6, 10));
                        Iterator it7 = arrayList6.iterator();
                        while (it7.hasNext()) {
                            FavoriteProperties favoriteProperties = ((BaseFavoriteItemModel) it7.next()).getFavoriteProperties();
                            String logoUrl = favoriteProperties != null ? favoriteProperties.getLogoUrl() : list;
                            if (logoUrl == null) {
                                logoUrl = "";
                            }
                            arrayList7.add(p.b(logoUrl));
                        }
                        ArrayList arrayList8 = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(arrayList7, 10));
                        Iterator it8 = arrayList7.iterator();
                        while (it8.hasNext()) {
                            arrayList8.add(jc.d.f34277a.a((String) it8.next(), "heif_section_mall_product_detail"));
                        }
                        ((DuRequestOptions) mn.a.f35714a.h(arrayList8).G(favoriteListFragment).v(e50.b.f31718a.a())).y();
                    }
                }
                if (this.f23728c) {
                    this.b.c0("");
                    this.b.Q().clearItems();
                }
                boolean l12 = this.b.N().l();
                FavoriteListFragment favoriteListFragment2 = this.b;
                favoriteListFragment2.Q = false;
                if (!favoriteListFragment2.p || !l12) {
                    favoriteListFragment2.g0();
                    FavoriteListFragment favoriteListFragment3 = this.b;
                    boolean z5 = this.f23728c;
                    PatchProxyResult proxy3 = PatchProxy.proxy(new Object[0], favoriteListFragment3, FavoriteListFragment.changeQuickRedirect, false, 295332, new Class[0], String.class);
                    if (proxy3.isSupported) {
                        str = (String) proxy3.result;
                    } else {
                        str = favoriteListFragment3.f23725q;
                    }
                    favoriteListFragment3.B(z5, str);
                } else {
                    favoriteListFragment2.h(favoriteListFragment2.v());
                }
                FavoriteListFragment favoriteListFragment4 = this.b;
                favoriteListFragment4.U.g(favoriteListFragment4.u(), false);
            }
        }
    }

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

        /* renamed from: c  reason: collision with root package name */
        public final /* synthetic */ ProductListItemModel f23729c;
        public final /* synthetic */ int d;

        public g(FavoriteListFragment favoriteListFragment, ProductListItemModel productListItemModel, int i) {
            this.b = favoriteListFragment;
            this.f23729c = productListItemModel;
            this.d = i;
        }

        public final void run() {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295491, new Class[0], Void.TYPE).isSupported) {
                FeedItemQuickFavHelper feedItemQuickFavHelper = this.b.j;
                if (feedItemQuickFavHelper == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("favHelper");
                }
                feedItemQuickFavHelper.onFavClick((FeedItemQuickFavCSpuModel) this.f23729c, this.d);
            }
        }
    }

    /* compiled from: FavoriteListFragment.kt */
    public static final class h extends AnimatorListenerAdapter {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ FavoriteListFragment b;

        /* JADX WARN: Incorrect args count in method signature: ()V */
        public h(FavoriteListFragment favoriteListFragment) {
            this.b = favoriteListFragment;
        }

        public void onAnimationEnd(@org.jetbrains.annotations.Nullable Animator animator, boolean z) {
            if (!PatchProxy.proxy(new Object[]{animator, new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 295493, new Class[]{Animator.class, Boolean.TYPE}, Void.TYPE).isSupported) {
                super.onAnimationEnd(animator, z);
                FavoriteListFragment favoriteListFragment = this.b;
                favoriteListFragment.f23727v = true;
                RelativeLayout relativeLayout = (RelativeLayout) favoriteListFragment._$_findCachedViewById(R.id.bottomFloatLayout);
                if (relativeLayout != null) {
                    ViewKt.setVisible(relativeLayout, true);
                }
                this.b.w = false;
            }
        }
    }

    /* compiled from: FavoriteListFragment.kt */
    public static final class i extends s<CouponEntranceModel> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ FavoriteListFragment b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public i(FavoriteListFragment favoriteListFragment, Fragment fragment) {
            super(fragment);
            this.b = favoriteListFragment;
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(Object obj) {
            String str;
            CouponEntranceModel couponEntranceModel = (CouponEntranceModel) obj;
            boolean z = true;
            if (!PatchProxy.proxy(new Object[]{couponEntranceModel}, this, changeQuickRedirect, false, 295505, new Class[]{CouponEntranceModel.class}, Void.TYPE).isSupported) {
                super.onSuccess(couponEntranceModel);
                if (couponEntranceModel != null && (str = couponEntranceModel.styleType) != null) {
                    int hashCode = str.hashCode();
                    if (hashCode != -1268861541) {
                        if (hashCode == 97526364 && str.equals("float")) {
                            if (couponEntranceModel.popTimeSec <= 0) {
                                couponEntranceModel.popTimeSec = 30000;
                            }
                            String str2 = couponEntranceModel.popPicUri;
                            if (!(str2 == null || str2.length() == 0)) {
                                z = false;
                            }
                            if (z) {
                                Yeezy.Companion.load(false, this.b.getContext(), new a(this, couponEntranceModel), "4fdd0339f19bc4c930ae48ee754ac547");
                            } else {
                                this.b.K(couponEntranceModel);
                            }
                        }
                    } else if (str.equals("footer")) {
                        FavoriteListFragment favoriteListFragment = this.b;
                        if (!PatchProxy.proxy(new Object[]{couponEntranceModel}, favoriteListFragment, FavoriteListFragment.changeQuickRedirect, false, 295350, new Class[]{CouponEntranceModel.class}, Void.TYPE).isSupported) {
                            if (!PatchProxy.proxy(new Object[0], z.f33482a, z.changeQuickRedirect, false, 20915, new Class[0], Void.TYPE).isSupported) {
                                PoizonAnalyzeFactory.a().track("activity_common_block_exposure", a01.a.j("current_page", "46", "block_type", "2905"));
                            }
                            String str3 = couponEntranceModel.popPicUri;
                            if (!(str3 == null || str3.length() == 0)) {
                                z = false;
                            }
                            String str4 = "";
                            if (z) {
                                favoriteListFragment._$_findCachedViewById(R.id.layoutBottomDefault).setVisibility(0);
                                favoriteListFragment._$_findCachedViewById(R.id.layoutBottomNew).setVisibility(8);
                                TextView textView = (TextView) favoriteListFragment._$_findCachedViewById(R.id.tvDefault);
                                String str5 = couponEntranceModel.popupText;
                                if (str5 != null) {
                                    str4 = str5;
                                }
                                textView.setText(str4);
                                ViewExtensionKt.h((ImageView) favoriteListFragment._$_findCachedViewById(R.id.ivClose), new FavoriteListFragment$showFooterView$1(favoriteListFragment));
                                ViewExtensionKt.h(favoriteListFragment._$_findCachedViewById(R.id.layoutBottomDefault), new FavoriteListFragment$showFooterView$2(favoriteListFragment));
                                return;
                            }
                            favoriteListFragment._$_findCachedViewById(R.id.layoutBottomDefault).setVisibility(8);
                            favoriteListFragment._$_findCachedViewById(R.id.layoutBottomNew).setVisibility(0);
                            ((DuImageLoaderView) favoriteListFragment._$_findCachedViewById(R.id.viewBgNew)).i(couponEntranceModel.popPicUri).x();
                            TextView textView2 = (TextView) favoriteListFragment._$_findCachedViewById(R.id.tvTextNew);
                            String str6 = couponEntranceModel.popupText;
                            if (str6 != null) {
                                str4 = str6;
                            }
                            textView2.setText(str4);
                            ViewExtensionKt.h(favoriteListFragment._$_findCachedViewById(R.id.closeClickView), new FavoriteListFragment$showFooterView$3(favoriteListFragment));
                            ViewExtensionKt.h(favoriteListFragment._$_findCachedViewById(R.id.layoutBottomNew), new FavoriteListFragment$showFooterView$4(favoriteListFragment));
                        }
                    }
                }
            }
        }
    }

    public FavoriteListFragment() {
        boolean z4;
        MallABTest mallABTest = MallABTest.f13351a;
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], mallABTest, MallABTest.changeQuickRedirect, false, 115546, new Class[0], Boolean.TYPE);
        if (proxy.isSupported) {
            z4 = ((Boolean) proxy.result).booleanValue();
        } else {
            z4 = Intrinsics.areEqual(fd.c.e(MallABTest.Keys.AB_FAV_RECOMMEND_HAS_FAV, "0"), "1");
        }
        this.i = z4;
        this.k = new DuModuleAdapter(false, 0, null, 7);
        this.m = FragmentViewModelLazyKt.createViewModelLazy(this, Reflection.getOrCreateKotlinClass(FavoriteViewModel.class), new FavoriteListFragment$$special$$inlined$activityViewModels$1(this), new FavoriteListFragment$$special$$inlined$activityViewModels$2(this));
        this.n = new DuModuleAdapter(false, 0, null, 7);
        this.o = new DuModuleAdapter(false, 0, null, 7);
        this.f23725q = "";
        this.r = "";
        this.x = new FavoriteListFragment$emptyClick$1(this);
        this.z = new ef.b<>("product_favorite_list");
        this.H = new ArrayList();
        this.I = new ArrayList();
        this.J = 8;
        this.K = "favoritelist_screenshot";
        this.M = -1;
        this.N = LazyKt__LazyJVMKt.lazy(new FavoriteListFragment$quickCleanExposureHelper$2(this));
        this.O = LazyKt__LazyJVMKt.lazy(new FavoriteListFragment$eventHelper$2(this));
        this.P = CollectionsKt__CollectionsKt.mutableListOf(mallABTest.Q(MallABTest.Keys.AB_570_YHJ, "0"));
        this.S = new LinkedHashSet<>();
        this.U = new b(this);
    }

    public static void E(FavoriteListFragment favoriteListFragment, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, favoriteListFragment, changeQuickRedirect, false, 295340, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
            favoriteListFragment.U.d();
        }
    }

    public static void F(FavoriteListFragment favoriteListFragment) {
        Dialog dialog;
        Intent intent;
        if (!PatchProxy.proxy(new Object[0], favoriteListFragment, changeQuickRedirect, false, 295418, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
            i60.a aVar = i60.a.f33292a;
            FragmentActivity activity = favoriteListFragment.getActivity();
            String stringExtra = (activity == null || (intent = activity.getIntent()) == null) ? null : intent.getStringExtra("NTeRQWvye18AkPd6G");
            String sourceName = favoriteListFragment.N().getSourceName();
            if (sourceName == null) {
                sourceName = "";
            }
            aVar.d(stringExtra, sourceName, "列表视图");
            if (!PatchProxy.proxy(new Object[0], favoriteListFragment, changeQuickRedirect, false, 295419, new Class[0], Void.TYPE).isSupported && ai.e.b(favoriteListFragment.getContext())) {
                favoriteListFragment.N().a();
            }
            if (!PatchProxy.proxy(new Object[0], favoriteListFragment, changeQuickRedirect, false, 295414, new Class[0], Void.TYPE).isSupported && !favoriteListFragment.S.isEmpty()) {
                ArrayList list = favoriteListFragment.n.getList();
                ArrayList arrayList = new ArrayList();
                for (Object obj : list) {
                    if (obj instanceof BaseFavoriteItemModel) {
                        arrayList.add(obj);
                    }
                }
                Iterator it2 = arrayList.iterator();
                while (it2.hasNext()) {
                    BaseFavoriteItemModel baseFavoriteItemModel = (BaseFavoriteItemModel) it2.next();
                    if (favoriteListFragment.S.contains(Long.valueOf(baseFavoriteItemModel.getSkuId()))) {
                        favoriteListFragment.n.removeItem(favoriteListFragment.U(baseFavoriteItemModel));
                    }
                }
                favoriteListFragment.S.clear();
            }
            if (!PatchProxy.proxy(new Object[0], favoriteListFragment, changeQuickRedirect, false, 295416, new Class[0], Void.TYPE).isSupported && favoriteListFragment.T) {
                favoriteListFragment.T = false;
                favoriteListFragment.fetchData(true);
                EventBus.b().f(new h50.k());
            }
            FavoriteCouponEntranceDialog favoriteCouponEntranceDialog = favoriteListFragment.L;
            if (!(favoriteCouponEntranceDialog == null || (dialog = favoriteCouponEntranceDialog.getDialog()) == null)) {
                dialog.show();
            }
        }
    }

    public static void G(FavoriteListFragment favoriteListFragment) {
        if (!PatchProxy.proxy(new Object[0], favoriteListFragment, changeQuickRedirect, false, 295429, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
        }
    }

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

    public static void I(FavoriteListFragment favoriteListFragment, View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, favoriteListFragment, changeQuickRedirect, false, 295433, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            super.onViewCreated(view, bundle);
        }
    }

    public static /* synthetic */ void T(FavoriteListFragment favoriteListFragment, Function1 function1, int i3) {
        favoriteListFragment.S((i3 & 1) != 0 ? FavoriteListFragment$hideMask$1.INSTANCE : null);
    }

    public static /* synthetic */ void i0(FavoriteListFragment favoriteListFragment, BaseFavoriteItemModel baseFavoriteItemModel, int i3) {
        favoriteListFragment.h0(null);
    }

    public final void J(@NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295400, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            f0(baseFavoriteItemModel);
            i60.b bVar = i60.b.f33293a;
            c cVar = new c(baseFavoriteItemModel);
            ArrayMap arrayMap = new ArrayMap(8);
            cVar.invoke(arrayMap);
            bVar.b("common_collect_product_price_remind", "46", "32", arrayMap);
        }
    }

    public final void K(CouponEntranceModel couponEntranceModel) {
        FavoriteCouponEntranceDialog favoriteCouponEntranceDialog;
        Dialog dialog;
        Dialog dialog2;
        if (!PatchProxy.proxy(new Object[]{couponEntranceModel}, this, changeQuickRedirect, false, 295349, new Class[]{CouponEntranceModel.class}, Void.TYPE).isSupported && cd.l.c(this)) {
            if (this.L == null) {
                FavoriteCouponEntranceDialog.a aVar = FavoriteCouponEntranceDialog.f23752g;
                int i3 = couponEntranceModel.popTimeSec;
                String str = couponEntranceModel.popPicUri;
                PatchProxyResult proxy = PatchProxy.proxy(new Object[]{new Integer(i3), str}, aVar, FavoriteCouponEntranceDialog.a.changeQuickRedirect, false, 295634, new Class[]{Integer.TYPE, String.class}, FavoriteCouponEntranceDialog.class);
                if (proxy.isSupported) {
                    favoriteCouponEntranceDialog = (FavoriteCouponEntranceDialog) proxy.result;
                } else {
                    FavoriteCouponEntranceDialog favoriteCouponEntranceDialog2 = new FavoriteCouponEntranceDialog();
                    Bundle bundle = new Bundle();
                    bundle.putInt("countTime", i3);
                    bundle.putString("popUrl", str);
                    favoriteCouponEntranceDialog2.setArguments(bundle);
                    favoriteCouponEntranceDialog = favoriteCouponEntranceDialog2;
                }
                this.L = favoriteCouponEntranceDialog;
                if (favoriteCouponEntranceDialog != null) {
                    favoriteCouponEntranceDialog.setOnDismissListener(new d(this));
                }
                FavoriteCouponEntranceDialog favoriteCouponEntranceDialog3 = this.L;
                if (favoriteCouponEntranceDialog3 != null) {
                    favoriteCouponEntranceDialog3.k(getChildFragmentManager());
                }
                if (isResumed()) {
                    FavoriteCouponEntranceDialog favoriteCouponEntranceDialog4 = this.L;
                    if (!(favoriteCouponEntranceDialog4 == null || (dialog2 = favoriteCouponEntranceDialog4.getDialog()) == null)) {
                        dialog2.show();
                    }
                } else {
                    FavoriteCouponEntranceDialog favoriteCouponEntranceDialog5 = this.L;
                    if (!(favoriteCouponEntranceDialog5 == null || (dialog = favoriteCouponEntranceDialog5.getDialog()) == null)) {
                        dialog.hide();
                    }
                }
            }
            if (!PatchProxy.proxy(new Object[0], ij.e.f33457a, ij.e.changeQuickRedirect, false, 20550, new Class[0], Void.TYPE).isSupported) {
                PoizonAnalyzeFactory.a().track("trade_collect_block_content_exposure", a01.a.j("current_page", "46", "block_type", "1544"));
            }
        }
    }

    public final void L() {
        if (PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295354, new Class[0], Void.TYPE).isSupported || this.D <= 0) {
            return;
        }
        if (this.f23727v || !this.w) {
            fo.a.m("dismissTips start", new Object[0]);
            this.w = true;
            ObjectAnimator ofFloat = ObjectAnimator.ofFloat((RelativeLayout) _$_findCachedViewById(R.id.bottomFloatLayout), "translationY", 0.0f, ((float) ((RelativeLayout) _$_findCachedViewById(R.id.bottomFloatLayout)).getHeight()) + ((float) fi.b.b((float) 16)));
            ofFloat.setDuration(100L);
            ofFloat.addListener(new e(this));
            ofFloat.start();
            return;
        }
        fo.a.m("dismissTips playingAnim return", new Object[0]);
    }

    public final SpannableStringBuilder M(FavoriteToExpireDiscountVO favoriteToExpireDiscountVO) {
        String str;
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{favoriteToExpireDiscountVO}, this, changeQuickRedirect, false, 295359, new Class[]{FavoriteToExpireDiscountVO.class}, SpannableStringBuilder.class);
        if (proxy.isSupported) {
            return (SpannableStringBuilder) proxy.result;
        }
        SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder();
        Context context = getContext();
        if (context != null) {
            SpannableStringBuilder append = spannableStringBuilder.append((CharSequence) "您有优惠在");
            StringBuilder sb2 = new StringBuilder();
            long expireTime = favoriteToExpireDiscountVO.getExpireTime() * ((long) 1000);
            PatchProxyResult proxy2 = PatchProxy.proxy(new Object[]{new Long(expireTime)}, this, changeQuickRedirect, false, 295361, new Class[]{Long.TYPE}, String.class);
            if (proxy2.isSupported) {
                str = (String) proxy2.result;
            } else {
                str = f0.f34193a.k(expireTime - System.currentTimeMillis());
            }
            sb2.append(str);
            sb2.append("后过期,立减");
            sb2.append(favoriteToExpireDiscountVO.getExpireAmt() / ((long) 100));
            sb2.append("元起");
            append.append(sb2.toString(), new ForegroundColorSpan(ContextCompat.getColor(context, R.color.color_red_ff4657)), 34);
        }
        return spannableStringBuilder;
    }

    public final FavoriteViewModel N() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295329, new Class[0], FavoriteViewModel.class);
        return (FavoriteViewModel) (proxy.isSupported ? proxy.result : this.m.getValue());
    }

    @NotNull
    public final DuModuleAdapter O() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295330, new Class[0], DuModuleAdapter.class);
        return proxy.isSupported ? (DuModuleAdapter) proxy.result : this.n;
    }

    public final m60.k P() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295337, new Class[0], m60.k.class);
        return (m60.k) (proxy.isSupported ? proxy.result : this.N.getValue());
    }

    @NotNull
    public final DuModuleAdapter Q() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295331, new Class[0], DuModuleAdapter.class);
        return proxy.isSupported ? (DuModuleAdapter) proxy.result : this.o;
    }

    @NotNull
    public final String R() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295334, new Class[0], String.class);
        return proxy.isSupported ? (String) proxy.result : this.r;
    }

    public final void S(Function1<? super BaseFavoriteItemModel, Boolean> function1) {
        if (!PatchProxy.proxy(new Object[]{function1}, this, changeQuickRedirect, false, 295353, new Class[]{Function1.class}, Void.TYPE).isSupported) {
            int i3 = 0;
            for (Object obj : this.n.getList()) {
                int i12 = i3 + 1;
                if (i3 < 0) {
                    CollectionsKt__CollectionsKt.throwIndexOverflow();
                }
                if (obj instanceof BaseFavoriteItemModel) {
                    BaseFavoriteItemModel baseFavoriteItemModel = (BaseFavoriteItemModel) obj;
                    if (baseFavoriteItemModel.isShowMask() && function1.invoke(obj).booleanValue()) {
                        baseFavoriteItemModel.setShowMask(false);
                        this.n.notifyItemChanged(i3);
                    }
                }
                i3 = i12;
            }
        }
    }

    public final int U(BaseFavoriteItemModel baseFavoriteItemModel) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295402, new Class[]{BaseFavoriteItemModel.class}, Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.n.indexOf((Function1<Object, Boolean>) new FavoriteListFragment$indexOfItem$1(baseFavoriteItemModel));
    }

    public final boolean V() {
        int i3;
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295384, new Class[0], Boolean.TYPE);
        if (proxy.isSupported) {
            return ((Boolean) proxy.result).booleanValue();
        }
        ArrayList<Object> list = this.n.getList();
        if (!(list instanceof Collection) || !list.isEmpty()) {
            i3 = 0;
            for (Object obj : list) {
                if ((obj instanceof BaseFavoriteItemModel) && (i3 = i3 + 1) < 0) {
                    CollectionsKt__CollectionsKt.throwCountOverflow();
                }
            }
        } else {
            i3 = 0;
        }
        if (i3 == 0) {
            return true;
        }
        return false;
    }

    public final void W(ProductListItemModel productListItemModel, int i3, int i12) {
        Object[] objArr = {productListItemModel, new Integer(i3), new Integer(i12)};
        ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
        Class cls = Integer.TYPE;
        if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 295352, new Class[]{ProductListItemModel.class, cls, cls}, Void.TYPE).isSupported) {
            Pair[] pairArr = new Pair[8];
            pairArr[0] = TuplesKt.to("contentType", 0);
            pairArr[1] = TuplesKt.to("contentID", Long.valueOf(productListItemModel.getSpuId()));
            pairArr[2] = fd.i.l(i3, 1, "position");
            String requestId = productListItemModel.getRequestId();
            String str = "";
            if (requestId == null) {
                requestId = str;
            }
            pairArr[3] = TuplesKt.to("requestID", requestId);
            pairArr[4] = TuplesKt.to("propertyValueId", Long.valueOf(productListItemModel.getPropertyValueId()));
            String title = productListItemModel.getTitle();
            if (title == null) {
                title = str;
            }
            pairArr[5] = TuplesKt.to("contentTitle", title);
            String cn2 = productListItemModel.getCn();
            if (cn2 == null) {
                cn2 = str;
            }
            pairArr[6] = TuplesKt.to("channel", cn2);
            String acm = productListItemModel.getAcm();
            if (acm == null) {
                acm = str;
            }
            pairArr[7] = TuplesKt.to("acm", acm);
            List listOf = CollectionsKt__CollectionsJVMKt.listOf(MapsKt__MapsKt.hashMapOf(pairArr));
            i60.a aVar = i60.a.f33292a;
            String jSONArray = new JSONArray((Collection) listOf).toString();
            Integer valueOf = Integer.valueOf(productListItemModel.getCollectionType() == 1 ? 0 : 1);
            String sourceName = N().getSourceName();
            if (sourceName != null) {
                str = sourceName;
            }
            if (!PatchProxy.proxy(new Object[]{jSONArray, valueOf, str}, aVar, i60.a.changeQuickRedirect, false, 124948, new Class[]{Object.class, Object.class, Object.class}, Void.TYPE).isSupported) {
                i60.b bVar = i60.b.f33293a;
                ArrayMap b2 = a.f.b(8, "recommend_content_info_list", jSONArray, "status", valueOf);
                b2.put("source_name", str);
                bVar.b("trade_recommend_feed_click", "46", "19", b2);
            }
            LoginHelper.k(getContext(), new g(this, productListItemModel, i12));
        }
    }

    public final void X() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295356, new Class[0], Void.TYPE).isSupported && !this.E && this.D > 0) {
            this.w = true;
            ObjectAnimator ofFloat = ObjectAnimator.ofFloat((RelativeLayout) _$_findCachedViewById(R.id.bottomFloatLayout), "translationY", ((float) ((RelativeLayout) _$_findCachedViewById(R.id.bottomFloatLayout)).getHeight()) + ((float) fi.b.b((float) 16)), 0.0f);
            ofFloat.setDuration(100L);
            ofFloat.addListener(new h(this));
            ofFloat.start();
            ((RelativeLayout) _$_findCachedViewById(R.id.bottomFloatLayout)).setVisibility(0);
        }
    }

    public final void Y() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295424, new Class[0], Void.TYPE).isSupported) {
            EventBus.b().f(new h50.j(1));
        }
    }

    public final void Z(BaseFavoriteItemModel baseFavoriteItemModel) {
        if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295404, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295338, new Class[0], h50.e.class);
            h50.e eVar = (h50.e) (proxy.isSupported ? proxy.result : this.O.getValue());
            if (eVar != null) {
                eVar.a(new FavoriteChangeEvent(baseFavoriteItemModel.getSkuId(), false, null, baseFavoriteItemModel.getId(), false, 41, baseFavoriteItemModel.getSpuId(), 0, 132, null));
            }
        }
    }

    @Override // com.shizhuang.duapp.common.base.list.DuListFragment
    public void _$_clearFindViewByIdCache() {
        HashMap hashMap;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295427, new Class[0], Void.TYPE).isSupported && (hashMap = this.V) != null) {
            hashMap.clear();
        }
    }

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

    public final void a0(String str) {
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 295347, new Class[]{String.class}, Void.TYPE).isSupported) {
            i60.a aVar = i60.a.f33292a;
            List<BaseFavoriteItemModel> list = this.H;
            ArrayList arrayList = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(list, 10));
            Iterator<T> it2 = list.iterator();
            while (it2.hasNext()) {
                arrayList.add(Long.valueOf(it2.next().getSkuId()));
            }
            String joinToString$default = CollectionsKt___CollectionsKt.joinToString$default(arrayList, ",", null, null, 0, null, null, 62, null);
            List<BaseFavoriteItemModel> list2 = this.H;
            ArrayList arrayList2 = new ArrayList(CollectionsKt__IterablesKt.collectionSizeOrDefault(list2, 10));
            Iterator<T> it3 = list2.iterator();
            while (it3.hasNext()) {
                arrayList2.add(Long.valueOf(it3.next().getSpuId()));
            }
            String joinToString$default2 = CollectionsKt___CollectionsKt.joinToString$default(arrayList2, ",", null, null, 0, null, null, 62, null);
            if (!PatchProxy.proxy(new Object[]{joinToString$default, joinToString$default2, str}, aVar, i60.a.changeQuickRedirect, false, 124490, new Class[]{Object.class, Object.class, Object.class}, Void.TYPE).isSupported) {
                i60.b bVar = i60.b.f33293a;
                ArrayMap e6 = g.a.e(8, "sku_id", joinToString$default, "spu_id", joinToString$default2);
                e6.put("button_title", str);
                bVar.b("trade_collect_block_content_click", "46", "1726", e6);
            }
        }
    }

    /* JADX DEBUG: Multi-variable search result rejected for r19v0, resolved type: boolean */
    /* JADX WARN: Multi-variable type inference failed */
    public final void b0(boolean z4) {
        Object[] objArr = {new Byte(z4 ? (byte) 1 : 0)};
        ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
        Class cls = Boolean.TYPE;
        if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 295336, new Class[]{cls}, Void.TYPE).isSupported) {
            this.E = z4;
            FavoriteViewModel N2 = N();
            if (!PatchProxy.proxy(new Object[]{new Byte((byte) z4)}, N2, FavoriteViewModel.changeQuickRedirect, false, 295564, new Class[]{cls}, Void.TYPE).isSupported) {
                N2.x.setValue(Boolean.valueOf(z4));
            }
        }
    }

    public final void c0(@NotNull String str) {
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 295335, new Class[]{String.class}, Void.TYPE).isSupported) {
            this.r = str;
        }
    }

    public final void d0() {
        BaseFavoriteItemModel baseFavoriteItemModel;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295374, new Class[0], Void.TYPE).isSupported) {
            ArrayList list = this.n.getList();
            ArrayList arrayList = new ArrayList();
            for (Object obj : list) {
                if (obj instanceof BaseFavoriteItemModel) {
                    arrayList.add(obj);
                }
            }
            if (arrayList.size() == 1 && (baseFavoriteItemModel = (BaseFavoriteItemModel) CollectionsKt___CollectionsKt.firstOrNull((List) arrayList)) != null) {
                baseFavoriteItemModel.setSingleFavorite(true);
                DuModuleAdapter duModuleAdapter = this.n;
                duModuleAdapter.notifyItemChanged(duModuleAdapter.indexOf(baseFavoriteItemModel));
            }
        }
    }

    public final void e0() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295348, new Class[0], Void.TYPE).isSupported) {
            n51.a aVar = n51.a.f35917a;
            s withoutToast = new i(this, this).withoutToast();
            if (!PatchProxy.proxy(new Object[]{withoutToast}, aVar, n51.a.changeQuickRedirect, false, 295725, new Class[]{s.class}, Void.TYPE).isSupported) {
                td.j.doRequest(((CouponService) td.j.getJavaGoApi(CouponService.class)).getCouponEntrance(rd.g.c()), withoutToast);
            }
        }
    }

    public final void f0(BaseFavoriteItemModel baseFavoriteItemModel) {
        FragmentActivity activity;
        if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295408, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported && (activity = getActivity()) != null) {
            new ReducePriceNoticeDialogV2(activity, 0, this.s, baseFavoriteItemModel, this, 2).show();
        }
    }

    public final void fetchData(boolean z4) {
        if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 295368, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            if (z4) {
                this.R = false;
                u().scrollToPosition(0);
            }
            this.Q = true;
            this.z.setIsEnableWrite(z4);
            this.U.j();
            FavModelAggregation c5 = N().c();
            String id2 = c5 != null ? c5.getId() : null;
            String str = "";
            if (id2 == null) {
                id2 = str;
            }
            if (z4 && !v().r()) {
                showLoadingView();
            }
            ProductFacadeV2 productFacadeV2 = ProductFacadeV2.f23068a;
            long j12 = z4 ? this.M : -1;
            if (!z4) {
                str = this.f23725q;
            }
            productFacadeV2.J(j12, str, id2, ai.e.b(requireContext()), N().m(), new f(this, z4, id2, this, this.n.getList().isEmpty()).withCache(this.z));
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:22:0x004e  */
    /* JADX WARNING: Removed duplicated region for block: B:25:0x007f  */
    /* JADX WARNING: Removed duplicated region for block: B:26:0x0088  */
    public final void g0() {
        boolean z4;
        PatchProxyResult proxy;
        boolean z5;
        boolean z12;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295385, new Class[0], Void.TYPE).isSupported && V()) {
            ArrayList list = this.o.getList();
            boolean z13 = true;
            if (!(list instanceof Collection) || !list.isEmpty()) {
                Iterator it2 = list.iterator();
                while (true) {
                    if (!it2.hasNext()) {
                        break;
                    }
                    Object next = it2.next();
                    if ((next instanceof nc.r) || (next instanceof t)) {
                        z12 = false;
                        continue;
                    } else {
                        z12 = true;
                        continue;
                    }
                    if (z12) {
                        z4 = false;
                        break;
                    }
                }
                if (z4) {
                    this.o.clearItems();
                }
                this.n.clearItems();
                DuModuleAdapter duModuleAdapter = this.n;
                Function0<Unit> function0 = this.x;
                Boolean valueOf = Boolean.valueOf(N().m());
                proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295386, new Class[0], Boolean.TYPE);
                if (!proxy.isSupported) {
                    z5 = ((Boolean) proxy.result).booleanValue();
                } else {
                    if (!N().m()) {
                        z13 = this.o.getList().isEmpty();
                    }
                    z5 = z13;
                }
                duModuleAdapter.appendItems(CollectionsKt__CollectionsJVMKt.listOf(new FavoriteEmptyContentModel(function0, Boolean.valueOf(z5), valueOf)));
            }
            z4 = true;
            if (z4) {
            }
            this.n.clearItems();
            DuModuleAdapter duModuleAdapter2 = this.n;
            Function0<Unit> function02 = this.x;
            Boolean valueOf2 = Boolean.valueOf(N().m());
            proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295386, new Class[0], Boolean.TYPE);
            if (!proxy.isSupported) {
            }
            duModuleAdapter2.appendItems(CollectionsKt__CollectionsJVMKt.listOf(new FavoriteEmptyContentModel(function02, Boolean.valueOf(z5), valueOf2)));
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    @org.jetbrains.annotations.Nullable
    public MallModuleExposureHelper getExposureHelper() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295425, new Class[0], MallModuleExposureHelper.class);
        if (proxy.isSupported) {
            return (MallModuleExposureHelper) proxy.result;
        }
        MallModuleExposureHelper mallModuleExposureHelper = this.A;
        if (mallModuleExposureHelper == null) {
            Intrinsics.throwUninitializedPropertyAccessException("listExposureHelper");
        }
        return mallModuleExposureHelper;
    }

    @Override // com.shizhuang.duapp.common.base.list.DuListFragment, com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
    public int getLayout() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295341, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.fragment_favorite_list;
    }

    @Override // com.shizhuang.duapp.common.base.list.DuListFragment
    public void h(@NotNull DuSmartLayout duSmartLayout) {
        boolean z4 = true;
        if (!PatchProxy.proxy(new Object[]{duSmartLayout}, this, changeQuickRedirect, false, 295365, new Class[]{DuSmartLayout.class}, Void.TYPE).isSupported) {
            boolean l12 = N().l();
            if (!this.Q) {
                if (!this.p) {
                    fetchData(false);
                } else if (!l12) {
                    B(false, "");
                } else if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295383, new Class[0], Void.TYPE).isSupported && (!this.E && !(!N().k()))) {
                    if (this.r.length() != 0) {
                        z4 = false;
                    }
                    ProductFacadeV2.f23068a.K(this.r, 20, this.P, new n(this, z4, this));
                }
            }
        }
    }

    public final void h0(BaseFavoriteItemModel baseFavoriteItemModel) {
        if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295371, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            this.F = false;
            this.H.clear();
            if (this.E) {
                if (baseFavoriteItemModel != null) {
                    this.H.add(baseFavoriteItemModel);
                }
                j0();
                v().setEnableRefresh(false);
                ((RelativeLayout) _$_findCachedViewById(R.id.batchRemoveBottom)).setVisibility(0);
                this.J = ((RelativeLayout) _$_findCachedViewById(R.id.bottomFloatLayout)).getVisibility();
                ((RelativeLayout) _$_findCachedViewById(R.id.bottomFloatLayout)).setVisibility(8);
                List<Object> items = this.o.getItems();
                this.I.clear();
                this.I.addAll(items);
                this.o.clearItems();
                if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295372, new Class[0], Void.TYPE).isSupported) {
                    FavModelExtend value = N().g().getValue();
                    if (value == null || !value.getShowCleanEntrance()) {
                        ((TextView) _$_findCachedViewById(R.id.tvQuickClean)).setVisibility(8);
                    } else {
                        ((TextView) _$_findCachedViewById(R.id.tvQuickClean)).setVisibility(0);
                        P().postExposureEvent(true);
                    }
                }
            } else {
                v().setEnableRefresh(true);
                ((RelativeLayout) _$_findCachedViewById(R.id.batchRemoveBottom)).setVisibility(8);
                ((RelativeLayout) _$_findCachedViewById(R.id.bottomFloatLayout)).setVisibility(this.J);
                this.o.setItems(this.I);
            }
            for (Object obj : this.n.getList()) {
                if (obj instanceof BaseFavoriteItemModel) {
                    BaseFavoriteItemModel baseFavoriteItemModel2 = (BaseFavoriteItemModel) obj;
                    baseFavoriteItemModel2.setSimilarLayoutOpen(false);
                    baseFavoriteItemModel2.setBatchRemoveMode(this.E);
                    baseFavoriteItemModel2.setBatchRemoveSelected(Intrinsics.areEqual(obj, baseFavoriteItemModel));
                }
            }
            this.n.notifyDataSetChanged();
        }
    }

    @Override // com.shizhuang.duapp.common.base.list.DuListFragment
    public void i(@NotNull DuSmartLayout duSmartLayout) {
        if (!PatchProxy.proxy(new Object[]{duSmartLayout}, this, changeQuickRedirect, false, 295366, new Class[]{DuSmartLayout.class}, Void.TYPE).isSupported) {
            fetchData(true);
        }
    }

    @Override // com.shizhuang.duapp.common.base.list.DuListFragment, com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
    public void initView(@org.jetbrains.annotations.Nullable Bundle bundle) {
        LiveData<List<Object>> liveData;
        Context context;
        LiveData<Integer> liveData2;
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 295342, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            Bundle arguments = getArguments();
            if (arguments != null && arguments.containsKey("top_product_sku_id")) {
                Bundle arguments2 = getArguments();
                long j12 = arguments2 != null ? arguments2.getLong("top_product_sku_id") : -1;
                if (j12 > 0) {
                    this.M = j12;
                }
            }
            T t4 = null;
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295346, new Class[0], Void.TYPE).isSupported) {
                ViewExtensionKt.j((ConstraintLayout) _$_findCachedViewById(R.id.clSelectAll), 0, new FavoriteListFragment$initBatchRemove$1(this), 1);
                ViewExtensionKt.j((TextView) _$_findCachedViewById(R.id.tvCancelBatchRemove), 0, new FavoriteListFragment$initBatchRemove$2(this), 1);
                ViewExtensionKt.j((TextView) _$_findCachedViewById(R.id.tvRemoveSelected), 0, new FavoriteListFragment$initBatchRemove$3(this), 1);
                ViewExtensionKt.j((TextView) _$_findCachedViewById(R.id.tvQuickClean), 0, new FavoriteListFragment$initBatchRemove$4(this), 1);
                IMallExposureHelper.a.d(P(), false, 1, null);
                LiveEventBus.g().a(p51.b.class).observe(this, new FavoriteListFragment$initBatchRemove$5(this));
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295345, new Class[0], Void.TYPE).isSupported) {
                LiveDataExtensionKt.b(N().b(), this, new FavoriteListFragment$initFilter$1(this));
                LiveDataExtensionKt.b(N().f(), this, new FavoriteListFragment$initFilter$2(this));
                FavoriteViewModel N2 = N();
                PatchProxyResult proxy = PatchProxy.proxy(new Object[0], N2, FavoriteViewModel.changeQuickRedirect, false, 295550, new Class[0], LiveData.class);
                if (proxy.isSupported) {
                    liveData2 = (LiveData) proxy.result;
                } else {
                    liveData2 = N2.o;
                }
                LiveDataExtensionKt.b(liveData2, this, new FavoriteListFragment$initFilter$3(this));
                mk1.d.m(new FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1(N().e().of(FavRequestEvent.class), new FavoriteListFragment$initFilter$4(this, null)), LifecycleOwnerKt.getLifecycleScope(this));
            }
            FavoriteViewModel N3 = N();
            PatchProxyResult proxy2 = PatchProxy.proxy(new Object[0], N3, FavoriteViewModel.changeQuickRedirect, false, 295546, new Class[0], LiveData.class);
            if (proxy2.isSupported) {
                liveData = (LiveData) proxy2.result;
            } else {
                liveData = N3.f;
            }
            liveData.observe(this, new FavoriteListFragment$initView$1(this));
            super.initView(bundle);
            FragmentActivity activity = getActivity();
            if (activity != null) {
                PageEventBus.h(activity).a(p51.a.class).observe(this, new FavoriteListFragment$initView$$inlined$let$lambda$1(this));
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295343, new Class[0], Void.TYPE).isSupported && this.i && (context = getContext()) != null) {
                this.j = new FeedItemQuickFavHelper(context, this, this.o, 2, 41);
            }
            if (!PatchProxy.proxy(new Object[0], n51.c.f35918a, n51.c.changeQuickRedirect, false, 295738, new Class[0], Void.TYPE).isSupported) {
                List<String> listOf = CollectionsKt__CollectionsKt.listOf((Object[]) new String[]{"https://cdn.poizon.com/node-common/9d2ba9ee-ac15-013b-310b-9551e832ebac-642-860.png", "https://cdn.poizon.com/node-common/8e46e56d-fc7b-4f81-1584-96031e352593-963-1290.png"});
                a.C0563a aVar = mn.a.f35714a;
                ((DuRequestOptions) a0.a.b(1080, 1080, aVar.h(listOf))).y();
                pi.e eVar = pi.e.f37087a;
                if (eVar.i()) {
                    String e6 = eVar.e();
                    if (StringsKt__StringsJVMKt.endsWith$default("https://videocdn.poizon.com/node-common/f4c944d8-4db2-6686-40ac-a49e50d98729.mp4", ".webp", false, 2, null) || StringsKt__StringsJVMKt.endsWith$default("https://videocdn.poizon.com/node-common/f4c944d8-4db2-6686-40ac-a49e50d98729.mp4", ".gif", false, 2, null) || StringsKt__StringsJVMKt.endsWith$default("https://videocdn.poizon.com/node-common/f4c944d8-4db2-6686-40ac-a49e50d98729.mp4", ".png", false, 2, null)) {
                        gg0.n.s(aVar, "https://videocdn.poizon.com/node-common/f4c944d8-4db2-6686-40ac-a49e50d98729.mp4");
                    } else if (eVar.g("https://videocdn.poizon.com/node-common/f4c944d8-4db2-6686-40ac-a49e50d98729.mp4", e6, null) == null) {
                        n51.b bVar = new n51.b("https://videocdn.poizon.com/node-common/f4c944d8-4db2-6686-40ac-a49e50d98729.mp4");
                        if (pi.e.k("https://videocdn.poizon.com/node-common/f4c944d8-4db2-6686-40ac-a49e50d98729.mp4")) {
                            Iterator<T> it2 = eVar.f().iterator();
                            while (true) {
                                if (!it2.hasNext()) {
                                    break;
                                }
                                T next = it2.next();
                                if (Intrinsics.areEqual(next.d, "https://videocdn.poizon.com/node-common/f4c944d8-4db2-6686-40ac-a49e50d98729.mp4")) {
                                    t4 = next;
                                    break;
                                }
                            }
                            T t12 = t4;
                            if (t12 != null) {
                                t12.r = bVar;
                                return;
                            }
                            return;
                        }
                        eVar.f().add(tl.a.r("https://videocdn.poizon.com/node-common/f4c944d8-4db2-6686-40ac-a49e50d98729.mp4", e6, null, bVar));
                    }
                } else {
                    throw new IllegalStateException("You should call DuAnimation.initialize at first!!");
                }
            }
        }
    }

    public final void j0() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295373, new Class[0], Void.TYPE).isSupported) {
            StringBuilder h12 = a.f.h("删除已选(");
            h12.append(this.H.size());
            h12.append((char) 65289);
            ((TextView) _$_findCachedViewById(R.id.tvRemoveSelected)).setText(h12.toString());
            ((TextView) _$_findCachedViewById(R.id.tvRemoveSelected)).setEnabled(!this.H.isEmpty());
            String string = getResources().getString(R.string.iconfont_check_filled);
            String string2 = getResources().getString(R.string.iconfont_unchecked);
            IconFontTextView iconFontTextView = (IconFontTextView) _$_findCachedViewById(R.id.icSelectAll);
            if (!this.F) {
                string = string2;
            }
            iconFontTextView.setText(string);
            int color = ContextCompat.getColor(requireContext(), R.color.color_01C2C3);
            int color2 = ContextCompat.getColor(requireContext(), R.color.color_gray_c7c7d7);
            IconFontTextView iconFontTextView2 = (IconFontTextView) _$_findCachedViewById(R.id.icSelectAll);
            if (!this.F) {
                color = color2;
            }
            iconFontTextView2.setTextColor(color);
        }
    }

    @Override // com.shizhuang.duapp.common.base.list.DuListFragment
    public boolean l() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295364, new Class[0], Boolean.TYPE);
        if (proxy.isSupported) {
            return ((Boolean) proxy.result).booleanValue();
        }
        return true;
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    public void onAdjustPriceListener(@NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295392, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            f0(baseFavoriteItemModel);
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    public void onArrivalReminderListener(@NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        FragmentActivity activity;
        if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295394, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295401, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported && (activity = getActivity()) != null) {
                CommonProductFacade.f13329a.p(baseFavoriteItemModel.getSpuId(), baseFavoriteItemModel.getSkuId(), new u(activity, activity, false, this, baseFavoriteItemModel));
            }
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    public void onAskPriceListener(@NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        FragmentActivity activity;
        if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295395, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported && (activity = getActivity()) != null) {
            e60.b.w(e60.b.f31725a, activity, baseFavoriteItemModel.getSkuId(), null, null, 1, "46", 12);
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    public void onBatchRemoveListener(int i3, @NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        if (!PatchProxy.proxy(new Object[]{new Integer(i3), baseFavoriteItemModel}, this, changeQuickRedirect, false, 295396, new Class[]{Integer.TYPE, BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            i60.a aVar = i60.a.f33292a;
            Integer valueOf = Integer.valueOf(i3 + 1);
            Long valueOf2 = Long.valueOf(baseFavoriteItemModel.getSkuId());
            Long valueOf3 = Long.valueOf(baseFavoriteItemModel.getSpuId());
            Integer valueOf4 = Integer.valueOf(baseFavoriteItemModel.getBlockPosition());
            if (!PatchProxy.proxy(new Object[]{valueOf, valueOf2, valueOf3, "批量删除", valueOf4}, aVar, i60.a.changeQuickRedirect, false, 124897, new Class[]{Object.class, Object.class, Object.class, Object.class, Object.class}, Void.TYPE).isSupported) {
                i60.b bVar = i60.b.f33293a;
                ArrayMap b2 = g.a.b(8, "block_content_position", valueOf, "sku_id", valueOf2);
                b2.put("spu_id", valueOf3);
                b2.put("button_title", "批量删除");
                b2.put("block_position", valueOf4);
                bVar.b("trade_collect_block_content_click", "46", "2243", b2);
            }
            b0(true);
            h0(baseFavoriteItemModel);
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    public void onCancelRemindListener(@NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        FragmentActivity activity;
        Remind remind;
        if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295393, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295406, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported && (activity = getActivity()) != null && (remind = baseFavoriteItemModel.getRemind()) != null) {
                ProductFacadeV2.f23068a.b0(remind.getId(), new l51.s(activity, activity, false, this, baseFavoriteItemModel));
                i60.b bVar = i60.b.f33293a;
                ArrayMap arrayMap = new ArrayMap(8);
                FavoriteProperties favoriteProperties = baseFavoriteItemModel.getFavoriteProperties();
                String name = favoriteProperties != null ? favoriteProperties.getName() : null;
                if (name == null) {
                    name = "";
                }
                arrayMap.put("product_name", name);
                arrayMap.put("sku_id", Long.valueOf(baseFavoriteItemModel.getSkuId()));
                arrayMap.put("sku_price", x.f(x.f34215a, Long.valueOf(baseFavoriteItemModel.getShowPrice()), false, null, 6));
                arrayMap.put("spu_id", Long.valueOf(baseFavoriteItemModel.getSpuId()));
                arrayMap.put("price_variance", String.valueOf(baseFavoriteItemModel.getShowPrice() - baseFavoriteItemModel.getPrice()));
                bVar.b("common_collect_product_price_remind_cancel", "46", "", arrayMap);
            }
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    public void onChangeReminder(@NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295399, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            J(baseFavoriteItemModel);
        }
    }

    @Override // com.shizhuang.duapp.common.base.list.DuListFragment, com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onCreate(Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 295339, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onCreate(this, bundle);
        }
    }

    @Override // com.shizhuang.duapp.common.base.list.DuListFragment, com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public View onCreateView(LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle) {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[]{layoutInflater, viewGroup, bundle}, this, changeQuickRedirect, false, 295430, 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.common.base.list.DuListFragment, com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onDestroyView() {
        CoroutineContext coroutineContext;
        Job job;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295423, new Class[0], Void.TYPE).isSupported) {
            CoroutineScope coroutineScope = this.B;
            if (!(coroutineScope == null || (coroutineContext = coroutineScope.getCoroutineContext()) == null || (job = (Job) coroutineContext.get(Job.Key)) == null)) {
                job.cancel((Job) ((CancellationException) null));
            }
            this.B = null;
            ScreenShotUtils.g(this.K);
            this.L = null;
            super.onDestroyView();
            _$_clearFindViewByIdCache();
        }
    }

    @Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
    public void onEmptyButtonClick() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295387, new Class[0], Void.TYPE).isSupported) {
            super.onEmptyButtonClick();
            u91.e.i0(getContext(), "mall");
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public final void onEventChange(@NotNull h50.j jVar) {
        if (!PatchProxy.proxy(new Object[]{jVar}, this, changeQuickRedirect, false, 295415, new Class[]{h50.j.class}, Void.TYPE).isSupported && jVar.a() != 1) {
            this.T = true;
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public final void onEventChanged(@NotNull FavoriteChangeEvent favoriteChangeEvent) {
        boolean z4 = true;
        if (PatchProxy.proxy(new Object[]{favoriteChangeEvent}, this, changeQuickRedirect, false, 295412, new Class[]{FavoriteChangeEvent.class}, Void.TYPE).isSupported || favoriteChangeEvent.getSendType() == 41) {
            return;
        }
        if (MallABTest.f13351a.v()) {
            if (!PatchProxy.proxy(new Object[]{favoriteChangeEvent}, this, changeQuickRedirect, false, 295413, new Class[]{FavoriteChangeEvent.class}, Void.TYPE).isSupported) {
                if (!favoriteChangeEvent.isAdd()) {
                    List<Long> removedSkus = favoriteChangeEvent.getRemovedSkus();
                    if (removedSkus != null && !removedSkus.isEmpty()) {
                        z4 = false;
                    }
                    if (!z4) {
                        LinkedHashSet<Long> linkedHashSet = this.S;
                        List<Long> removedSkus2 = favoriteChangeEvent.getRemovedSkus();
                        if (removedSkus2 == null) {
                            removedSkus2 = CollectionsKt__CollectionsKt.emptyList();
                        }
                        linkedHashSet.addAll(removedSkus2);
                        return;
                    }
                    this.S.add(Long.valueOf(favoriteChangeEvent.getSkuId()));
                } else if (this.S.contains(Long.valueOf(favoriteChangeEvent.getSkuId()))) {
                    this.S.remove(Long.valueOf(favoriteChangeEvent.getSkuId()));
                }
            }
        } else {
            this.T = true;
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onHiddenChanged(boolean z4) {
        if (!PatchProxy.proxy(new Object[]{new Byte(z4 ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 295422, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
            super.onHiddenChanged(z4);
            if ((z4 ? 1 : 0) != false && (this.E ? 1 : 0) != false) {
                b0(false);
                h0(null);
            }
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    public void onImageLongClickListener(@NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295390, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            S(new FavoriteListFragment$onImageLongClickListener$1(baseFavoriteItemModel));
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    public void onItemClickListener(int i3, @NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        String str;
        PmPreviewModel pmPreviewModel;
        boolean z4 = false;
        if (!PatchProxy.proxy(new Object[]{new Integer(i3), baseFavoriteItemModel}, this, changeQuickRedirect, false, 295388, new Class[]{Integer.TYPE, BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            if (this.E) {
                if (baseFavoriteItemModel.isBatchRemoveSelected()) {
                    if (this.H.contains(baseFavoriteItemModel)) {
                        this.H.remove(baseFavoriteItemModel);
                        baseFavoriteItemModel.setBatchRemoveSelected(false);
                    }
                } else if (this.H.size() < 2000) {
                    this.H.add(baseFavoriteItemModel);
                    baseFavoriteItemModel.setBatchRemoveSelected(true);
                } else {
                    q.v("数量已达上限,请先删除", 0);
                }
                int size = this.H.size();
                ArrayList list = this.n.getList();
                ArrayList arrayList = new ArrayList();
                for (Object obj : list) {
                    if (obj instanceof BaseFavoriteItemModel) {
                        arrayList.add(obj);
                    }
                }
                if (size == arrayList.size()) {
                    z4 = true;
                }
                this.F = z4;
                j0();
                DuModuleAdapter duModuleAdapter = this.n;
                duModuleAdapter.notifyItemChanged(duModuleAdapter.indexOf(baseFavoriteItemModel));
                return;
            }
            T(this, null, 1);
            if (baseFavoriteItemModel.skuDelete()) {
                showToast("商品已删除");
            } else {
                Context context = getContext();
                if (context != null) {
                    e60.a aVar = e60.a.f31724a;
                    int itemType = baseFavoriteItemModel.getItemType();
                    long spuId = baseFavoriteItemModel.getSpuId();
                    long skuId = baseFavoriteItemModel.skuOff() ? 0 : baseFavoriteItemModel.getSkuId();
                    if (Intrinsics.areEqual(baseFavoriteItemModel.getHasMultiMedia(), Boolean.FALSE)) {
                        FavoriteProperties favoriteProperties = baseFavoriteItemModel.getFavoriteProperties();
                        pmPreviewModel = new PmPreviewModel(favoriteProperties != null ? favoriteProperties.getLogoUrl() : null);
                    } else {
                        pmPreviewModel = null;
                    }
                    aVar.c(context, itemType, new MallProductJumpModel(spuId, skuId, null, 0, 0, null, 0, false, null, null, pmPreviewModel, 1020, null));
                }
            }
            i60.a aVar2 = i60.a.f33292a;
            Integer valueOf = Integer.valueOf(i3 + 1);
            FavoriteProperties favoriteProperties2 = baseFavoriteItemModel.getFavoriteProperties();
            String name = favoriteProperties2 != null ? favoriteProperties2.getName() : null;
            String str2 = name != null ? name : "";
            Long valueOf2 = Long.valueOf(baseFavoriteItemModel.getSkuId());
            Long valueOf3 = Long.valueOf(baseFavoriteItemModel.getSpuId());
            String f12 = x.f(x.f34215a, Long.valueOf(baseFavoriteItemModel.getShowPrice()), false, null, 6);
            String valueOf4 = String.valueOf(baseFavoriteItemModel.getShowPrice() - baseFavoriteItemModel.getPrice());
            String sensorLabelInfoList = baseFavoriteItemModel.getSensorLabelInfoList();
            Integer valueOf5 = Integer.valueOf(baseFavoriteItemModel.getBlockPosition());
            String sourceName = N().getSourceName();
            if (sourceName != null) {
                str = sourceName;
            } else {
                str = "";
            }
            List<String> sensorLabels = baseFavoriteItemModel.getSensorLabels();
            Long discountPrice = baseFavoriteItemModel.getDiscountPrice();
            aVar2.e(valueOf, str2, valueOf2, valueOf3, f12, valueOf4, sensorLabelInfoList, 1, valueOf5, str, sensorLabels, Long.valueOf(discountPrice != null ? discountPrice.longValue() : 0), N().h(), "列表视图");
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    public void onItemLongClickListener(int i3, @NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        if (!PatchProxy.proxy(new Object[]{new Integer(i3), baseFavoriteItemModel}, this, changeQuickRedirect, false, 295389, new Class[]{Integer.TYPE, BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            T(this, null, 1);
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onPause() {
        Dialog dialog;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295420, new Class[0], Void.TYPE).isSupported) {
            super.onPause();
            FavoriteCouponEntranceDialog favoriteCouponEntranceDialog = this.L;
            if (favoriteCouponEntranceDialog != null && (dialog = favoriteCouponEntranceDialog.getDialog()) != null) {
                dialog.hide();
            }
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    public void onPriceReducedListener(@NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295391, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            J(baseFavoriteItemModel);
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.favorite.ReducePriceNoticeDialogV2.OnModifyReminderListener
    public void onRemiderClose() {
        boolean z4 = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295410, new Class[0], Void.TYPE).isSupported;
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    public void onRemoveListener(int i3, @NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        int i12;
        FragmentActivity activity;
        if (!PatchProxy.proxy(new Object[]{new Integer(i3), baseFavoriteItemModel}, this, changeQuickRedirect, false, 295397, new Class[]{Integer.TYPE, BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel}, this, changeQuickRedirect, false, 295403, new Class[]{BaseFavoriteItemModel.class}, Void.TYPE).isSupported && (activity = getActivity()) != null) {
                i12 = 1;
                ProductFacadeV2.f23068a.a0(baseFavoriteItemModel.getId(), new l51.r(activity, activity, false, this, baseFavoriteItemModel));
            } else {
                i12 = 1;
            }
            i60.a aVar = i60.a.f33292a;
            Integer valueOf = Integer.valueOf(i3 + i12);
            FavoriteProperties favoriteProperties = baseFavoriteItemModel.getFavoriteProperties();
            String name = favoriteProperties != null ? favoriteProperties.getName() : null;
            String str = name != null ? name : "";
            Long valueOf2 = Long.valueOf(baseFavoriteItemModel.getSkuId());
            Long valueOf3 = Long.valueOf(baseFavoriteItemModel.getSpuId());
            String f12 = x.f(x.f34215a, Long.valueOf(baseFavoriteItemModel.getShowPrice()), false, null, 6);
            String valueOf4 = String.valueOf(baseFavoriteItemModel.getShowPrice() - baseFavoriteItemModel.getPrice());
            Integer valueOf5 = Integer.valueOf(baseFavoriteItemModel.getBlockPosition());
            Object[] objArr = new Object[7];
            objArr[0] = valueOf;
            objArr[i12] = str;
            objArr[2] = valueOf2;
            objArr[3] = valueOf3;
            objArr[4] = f12;
            objArr[5] = valueOf4;
            objArr[6] = valueOf5;
            ChangeQuickRedirect changeQuickRedirect2 = i60.a.changeQuickRedirect;
            Class[] clsArr = new Class[7];
            clsArr[0] = Object.class;
            clsArr[i12] = Object.class;
            clsArr[2] = Object.class;
            clsArr[3] = Object.class;
            clsArr[4] = Object.class;
            clsArr[5] = Object.class;
            clsArr[6] = Object.class;
            if (!PatchProxy.proxy(objArr, aVar, changeQuickRedirect2, false, 124899, clsArr, Void.TYPE).isSupported) {
                i60.b bVar = i60.b.f33293a;
                ArrayMap c5 = gg0.n.c(8, "block_content_position", valueOf, "product_name", str);
                c5.put("sku_id", valueOf2);
                c5.put("spu_id", valueOf3);
                c5.put("sku_price", f12);
                c5.put("price_variance", valueOf4);
                c5.put("block_position", valueOf5);
                bVar.b("common_collect_product_delete", "46", "", c5);
            }
        }
    }

    @Override // com.shizhuang.duapp.common.base.list.DuListFragment, com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onResume() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295417, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onResume(this);
        }
    }

    @Override // com.shizhuang.duapp.common.base.list.DuListFragment, com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onStart() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295428, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onStart(this);
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onStop() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295421, new Class[0], Void.TYPE).isSupported) {
            super.onStop();
            if (this.E) {
                b0(false);
                h0(null);
            }
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.favorite.ReducePriceNoticeDialogV2.OnModifyReminderListener
    public void onSubmit(@NotNull BaseFavoriteItemModel baseFavoriteItemModel, long j12) {
        FragmentActivity activity;
        Object[] objArr = {baseFavoriteItemModel, new Long(j12)};
        ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
        Class cls = Long.TYPE;
        if (!PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 295409, new Class[]{BaseFavoriteItemModel.class, cls}, Void.TYPE).isSupported) {
            if (!PatchProxy.proxy(new Object[]{baseFavoriteItemModel, new Long(j12)}, this, changeQuickRedirect, false, 295407, new Class[]{BaseFavoriteItemModel.class, cls}, Void.TYPE).isSupported && (activity = getActivity()) != null) {
                ProductFacadeV2.f23068a.c0(baseFavoriteItemModel.getId(), baseFavoriteItemModel.getShowPrice(), j12, new l51.t(activity, activity, false, this, baseFavoriteItemModel, j12));
            }
        }
    }

    @Override // com.shizhuang.duapp.modules.productv2.views.OnFavoriteItemEventListener
    public void onSwipeMenuOpenListener(int i3, @NotNull BaseFavoriteItemModel baseFavoriteItemModel) {
        if (!PatchProxy.proxy(new Object[]{new Integer(i3), baseFavoriteItemModel}, this, changeQuickRedirect, false, 295398, new Class[]{Integer.TYPE, BaseFavoriteItemModel.class}, Void.TYPE).isSupported) {
            df.b0.l("has_visit_swipe_menu", Boolean.TRUE);
        }
    }

    @Override // com.shizhuang.duapp.common.base.list.DuListFragment, com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onViewCreated(View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, this, changeQuickRedirect, false, 295432, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onViewCreated(this, view, bundle);
        }
    }

    @Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
    public void showErrorView() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295367, new Class[0], Void.TYPE).isSupported) {
            if (!V() || !this.o.isEmpty()) {
                fo.a.u(this.TAG).e("showErrorView...favorite or recommend is not empty, not show error", new Object[0]);
            } else {
                super.showErrorView();
            }
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:25:0x0177, code lost:
        if (r6 != false) goto L_0x017b;
     */
    @Override // com.shizhuang.duapp.common.base.list.DuListFragment
    public void w(@NotNull DelegateAdapter delegateAdapter) {
        boolean z4;
        boolean z5 = true;
        if (!PatchProxy.proxy(new Object[]{delegateAdapter}, this, changeQuickRedirect, false, 295351, new Class[]{DelegateAdapter.class}, Void.TYPE).isSupported) {
            DuModuleAdapter duModuleAdapter = this.k;
            duModuleAdapter.getDelegate().C(FavModelNotice.class, 1, null, -1, true, null, null, FavoriteListFragment$initAdapter$1.INSTANCE);
            DuModuleAdapter duModuleAdapter2 = this.k;
            duModuleAdapter2.getDelegate().C(FavModelPushNotice.class, 1, null, -1, true, null, null, new FavoriteListFragment$initAdapter$2(this));
            DuModuleAdapter duModuleAdapter3 = this.k;
            duModuleAdapter3.getDelegate().C(FavSloganModel.class, 1, null, -1, true, null, null, FavoriteListFragment$initAdapter$3.INSTANCE);
            this.l = new MallModuleExposureHelper(this, u(), this.k, false);
            DuModuleAdapter duModuleAdapter4 = this.n;
            duModuleAdapter4.getDelegate().C(FavoriteItemModel.class, 1, "list", -1, true, null, null, new FavoriteListFragment$initAdapter$4(this));
            this.D = 2;
            DuModuleAdapter duModuleAdapter5 = this.n;
            duModuleAdapter5.getDelegate().C(FavoriteEmptyContentModel.class, 1, null, -1, true, null, null, FavoriteListFragment$initAdapter$5.INSTANCE);
            this.o.g(true);
            DuModuleAdapter duModuleAdapter6 = this.o;
            duModuleAdapter6.getDelegate().C(RecommendTitleModel.class, 1, null, -1, true, null, null, FavoriteListFragment$initAdapter$6.INSTANCE);
            DuModuleAdapter duModuleAdapter7 = this.o;
            duModuleAdapter7.getDelegate().C(ProductListItemModel.class, 2, "recommend", 10, true, null, null, new FavoriteListFragment$initAdapter$7(this));
            delegateAdapter.addAdapter(this.k);
            delegateAdapter.addAdapter(this.n);
            delegateAdapter.addAdapter(this.o);
            Context context = getContext();
            if (context != null) {
                u().addItemDecoration(new ProductItemDecoration(context, this.o, "recommend", 0, 0, false, 56));
            }
            MallModuleExposureHelper mallModuleExposureHelper = new MallModuleExposureHelper(this, u(), this.n, false);
            this.A = mallModuleExposureHelper;
            mallModuleExposureHelper.m("favoriteList");
            MallModuleExposureHelper mallModuleExposureHelper2 = this.A;
            if (mallModuleExposureHelper2 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("listExposureHelper");
            }
            mallModuleExposureHelper2.setExposureDelay(300);
            MallModuleExposureHelper mallModuleExposureHelper3 = this.A;
            if (mallModuleExposureHelper3 == null) {
                Intrinsics.throwUninitializedPropertyAccessException("listExposureHelper");
            }
            mallModuleExposureHelper3.f(false);
            u().addOnScrollListener(new FavoriteListFragment$initAdapter$9(this));
            MallModuleExposureHelper mallModuleExposureHelper4 = new MallModuleExposureHelper(this, u(), this.o, true);
            mallModuleExposureHelper4.m("recommendList");
            FavoriteListFragment$initAdapter$10 favoriteListFragment$initAdapter$10 = new FavoriteListFragment$initAdapter$10(this);
            List<Class<?>> groupTypes = mallModuleExposureHelper4.k().getGroupTypes("recommend");
            if (!groupTypes.isEmpty()) {
                if (!(groupTypes instanceof Collection) || !groupTypes.isEmpty()) {
                    Iterator<T> it2 = groupTypes.iterator();
                    while (true) {
                        if (it2.hasNext()) {
                            if (!ProductListItemModel.class.isAssignableFrom(it2.next())) {
                                z4 = false;
                                break;
                            }
                        } else {
                            break;
                        }
                    }
                }
                z4 = true;
            }
            z5 = false;
            if (z5) {
                mallModuleExposureHelper4.i().put("recommend", (Function2) TypeIntrinsics.beforeCheckcastToFunctionOfArity(favoriteListFragment$initAdapter$10, 2));
                if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 295380, new Class[0], Void.TYPE).isSupported) {
                    ScreenShotUtils.f(this.K, new l51.q());
                    return;
                }
                return;
            }
            StringBuilder h12 = a.f.h("MallModuleExposureHelper addExposure ");
            h.a.t(ProductListItemModel.class, h12, " must be supper class for all groupType: ", "recommend", ", types:");
            h12.append(groupTypes);
            throw new IllegalStateException(h12.toString().toString());
        }
    }
}