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


package com.shizhuang.duapp.modules.product_detail.own.ui;

import a.f;
import android.annotation.SuppressLint;
import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.os.BundleKt;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentViewModelLazyKt;
import androidx.lifecycle.Lifecycle;
import androidx.lifecycle.LiveData;
import androidx.recyclerview.widget.DiffUtil;
import androidx.recyclerview.widget.RecyclerView;
import cd.i;
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.scwang.smartrefresh.layout.api.RefreshLayout;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.component.module.DuModuleAdapter;
import com.shizhuang.duapp.common.helper.loadmore.LoadMoreHelper;
import com.shizhuang.duapp.common.ui.BaseFragment;
import com.shizhuang.duapp.common.widget.PlaceholderLayout;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.duimageloaderview.options.DuScaleType;
import com.shizhuang.duapp.libs.smartlayout.DuSmartLayout;
import com.shizhuang.duapp.libs.smartlayout.listener.OnDuRefreshListener;
import com.shizhuang.duapp.modules.du_mall_common.api.LoadResultKt;
import com.shizhuang.duapp.modules.du_mall_common.constant.MallABTest;
import com.shizhuang.duapp.modules.du_mall_common.utils.exposure.MallModuleExposureHelper;
import com.shizhuang.duapp.modules.product_detail.own.model.MyOwnSkuCardItemModel;
import com.shizhuang.duapp.modules.product_detail.own.model.MyOwnSkuListItemModel;
import com.shizhuang.duapp.modules.product_detail.own.model.MyOwnSpuItemModel;
import com.shizhuang.duapp.modules.product_detail.own.model.MyOwnTopModel;
import com.shizhuang.duapp.modules.product_detail.own.vm.MyOwnViewModel;
import com.shizhuang.duapp.modules.product_detail.own.widget.OwnSpuShadowItemDecoration;
import com.shizhuang.duapp.modules.router.ServiceManager;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import kotlin.Lazy;
import kotlin.LazyKt__LazyJVMKt;
import kotlin.Metadata;
import kotlin.TuplesKt;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.collections.CollectionsKt___CollectionsKt;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import kotlin.properties.ReadWriteProperty;
import kotlin.reflect.KProperty;
import kotlinx.coroutines.Job;
import org.jetbrains.annotations.NotNull;

@Metadata(bv = {}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0006\b\u0007\u0018\u00002\u00020\u0001:\u0002\u0006\u0007B\u0007¢\u0006\u0004\b\u0004\u0010\u0005J\b\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006\b"}, d2 = {"Lcom/shizhuang/duapp/modules/product_detail/own/ui/MyOwnSpuListFragmentV2;", "Lcom/shizhuang/duapp/common/ui/BaseFragment;", "", "onResume", "<init>", "()V", "a", "RvDiffCallback", "du_product_detail_release"}, k = 1, mv = {1, 4, 2})
@SuppressLint({"MallShouldTryCatchCheck"})
/* compiled from: MyOwnSpuListFragmentV2.kt */
public final class MyOwnSpuListFragmentV2 extends BaseFragment {
    public static ChangeQuickRedirect changeQuickRedirect;
    public static final /* synthetic */ KProperty[] n = {g.a.o(MyOwnSpuListFragmentV2.class, "hasShowDeleteGuide", "getHasShowDeleteGuide()Z", 0)};
    public static final int o = fi.b.b((float) 68);
    @NotNull
    public static final a p = new a(null);
    public final Lazy b = LazyKt__LazyJVMKt.lazy(new MyOwnSpuListFragmentV2$exposureHelper$2(this));

    /* renamed from: c  reason: collision with root package name */
    public final Lazy f22838c = LazyKt__LazyJVMKt.lazy(MyOwnSpuListFragmentV2$ownListGiftHasShowAnim$2.INSTANCE);
    public Job d;
    public final ReadWriteProperty e;
    public final Lazy f;

    /* renamed from: g  reason: collision with root package name */
    public LoadMoreHelper f22839g;

    /* renamed from: h  reason: collision with root package name */
    public final boolean f22840h;
    public float i;
    public float j;
    public final DuModuleAdapter k;
    public final OwnSpuShadowItemDecoration l;
    public HashMap m;

    @Metadata(bv = {}, d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\b\u0002\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Lcom/shizhuang/duapp/modules/product_detail/own/ui/MyOwnSpuListFragmentV2$RvDiffCallback;", "Landroidx/recyclerview/widget/DiffUtil$Callback;", "du_product_detail_release"}, k = 1, mv = {1, 4, 2})
    /* compiled from: MyOwnSpuListFragmentV2.kt */
    public static final class RvDiffCallback extends DiffUtil.Callback {
        public static ChangeQuickRedirect changeQuickRedirect;

        /* renamed from: a  reason: collision with root package name */
        public final List<Object> f22844a;
        public final List<Object> b;

        public RvDiffCallback(@NotNull List<? extends Object> list, @NotNull List<? extends Object> list2) {
            this.f22844a = list;
            this.b = list2;
        }

        @Override // androidx.recyclerview.widget.DiffUtil.Callback
        public boolean areContentsTheSame(int i, int i3) {
            Object[] objArr = {new Integer(i), new Integer(i3)};
            ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
            Class cls = Integer.TYPE;
            PatchProxyResult proxy = PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 280677, new Class[]{cls, cls}, Boolean.TYPE);
            return proxy.isSupported ? ((Boolean) proxy.result).booleanValue() : Intrinsics.areEqual(CollectionsKt___CollectionsKt.getOrNull(this.f22844a, i), CollectionsKt___CollectionsKt.getOrNull(this.b, i3));
        }

        @Override // androidx.recyclerview.widget.DiffUtil.Callback
        public boolean areItemsTheSame(int i, int i3) {
            Object[] objArr = {new Integer(i), new Integer(i3)};
            ChangeQuickRedirect changeQuickRedirect2 = changeQuickRedirect;
            Class cls = Integer.TYPE;
            PatchProxyResult proxy = PatchProxy.proxy(objArr, this, changeQuickRedirect2, false, 280676, new Class[]{cls, cls}, Boolean.TYPE);
            if (proxy.isSupported) {
                return ((Boolean) proxy.result).booleanValue();
            }
            Object orNull = CollectionsKt___CollectionsKt.getOrNull(this.f22844a, i);
            Object orNull2 = CollectionsKt___CollectionsKt.getOrNull(this.b, i3);
            if (i != i3 || !(orNull2 instanceof MyOwnTopModel) || !(orNull instanceof MyOwnTopModel)) {
                return Intrinsics.areEqual(orNull, orNull2);
            }
            return true;
        }

        @Override // androidx.recyclerview.widget.DiffUtil.Callback
        public int getNewListSize() {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280675, new Class[0], Integer.TYPE);
            return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.b.size();
        }

        @Override // androidx.recyclerview.widget.DiffUtil.Callback
        public int getOldListSize() {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280674, new Class[0], Integer.TYPE);
            return proxy.isSupported ? ((Integer) proxy.result).intValue() : this.f22844a.size();
        }
    }

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

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

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

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

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

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

        public a(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

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

        public b(MyOwnSpuListFragmentV2 myOwnSpuListFragmentV2) {
            this.b = myOwnSpuListFragmentV2;
        }

        @Override // com.scwang.smartrefresh.layout.listener.OnRefreshListener
        public final void onRefresh(@NotNull RefreshLayout refreshLayout) {
            if (!PatchProxy.proxy(new Object[]{refreshLayout}, this, changeQuickRedirect, false, 280705, new Class[]{RefreshLayout.class}, Void.TYPE).isSupported) {
                this.b.i().fetchData(true);
            }
        }
    }

    /* compiled from: MyOwnSpuListFragmentV2.kt */
    public static final class c implements View.OnTouchListener {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ MyOwnSpuListFragmentV2 b;

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

        public c(MyOwnSpuListFragmentV2 myOwnSpuListFragmentV2, int i) {
            this.b = myOwnSpuListFragmentV2;
            this.f22845c = i;
        }

        public final boolean onTouch(View view, MotionEvent motionEvent) {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{view, motionEvent}, this, changeQuickRedirect, false, 280706, new Class[]{View.class, MotionEvent.class}, Boolean.TYPE);
            if (proxy.isSupported) {
                return ((Boolean) proxy.result).booleanValue();
            }
            int action = motionEvent.getAction();
            if (action == 0) {
                this.b.i = motionEvent.getY();
            } else if (action == 1) {
                this.b.j = motionEvent.getY();
            }
            MyOwnSpuListFragmentV2 myOwnSpuListFragmentV2 = this.b;
            if (Math.abs(myOwnSpuListFragmentV2.i - myOwnSpuListFragmentV2.j) > ((float) this.f22845c)) {
                this.b.k();
            }
            return false;
        }
    }

    /* compiled from: MyOwnSpuListFragmentV2.kt */
    public static final class d implements LoadMoreHelper.LoadMoreListener {
        public static ChangeQuickRedirect changeQuickRedirect;

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

        public d(MyOwnSpuListFragmentV2 myOwnSpuListFragmentV2) {
            this.f22846a = myOwnSpuListFragmentV2;
        }

        @Override // com.shizhuang.duapp.common.helper.loadmore.LoadMoreHelper.LoadMoreListener
        public final void loadData(boolean z) {
            if (!PatchProxy.proxy(new Object[]{new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 280707, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
                this.f22846a.i().fetchData(false);
            }
        }
    }

    public MyOwnSpuListFragmentV2() {
        StringBuilder h12 = f.h("KEY_OWN_DELETE_TIPS_");
        String loginUserId = ServiceManager.d().getLoginUserId();
        h12.append(loginUserId == null ? "" : loginUserId);
        this.e = i.a(h12.toString(), Boolean.FALSE, null);
        this.f = FragmentViewModelLazyKt.createViewModelLazy(this, Reflection.getOrCreateKotlinClass(MyOwnViewModel.class), new MyOwnSpuListFragmentV2$$special$$inlined$activityViewModels$1(this), new MyOwnSpuListFragmentV2$$special$$inlined$activityViewModels$2(this));
        this.f22840h = MallABTest.f13351a.I();
        DuModuleAdapter duModuleAdapter = new DuModuleAdapter(false, 0, null, 7);
        duModuleAdapter.getDelegate().C(MyOwnTopModel.class, 1, null, -1, true, null, null, MyOwnSpuListFragmentV2$adapter$1$1.INSTANCE);
        duModuleAdapter.getDelegate().C(MyOwnSpuItemModel.class, 2, "spu_list", -1, true, null, null, new MyOwnSpuListFragmentV2$$special$$inlined$also$lambda$1(this));
        Unit unit = Unit.INSTANCE;
        this.k = duModuleAdapter;
        this.l = new OwnSpuShadowItemDecoration(duModuleAdapter, "spu_list", 0, 0, 0, 0, 0, o5.i.f36333a, o5.i.f36333a, o5.i.f36333a, o5.i.f36333a, o5.i.f36333a, 0, 8188);
    }

    public static void c(MyOwnSpuListFragmentV2 myOwnSpuListFragmentV2) {
        if (!PatchProxy.proxy(new Object[0], myOwnSpuListFragmentV2, changeQuickRedirect, false, 280646, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
            if (!PatchProxy.proxy(new Object[0], u21.a.f38776a, u21.a.changeQuickRedirect, false, 282587, new Class[0], Void.TYPE).isSupported) {
                a1.a.j(8, i60.b.f33293a, "trade_common_pageview", "1016", "");
            }
            myOwnSpuListFragmentV2.j();
            if (!PatchProxy.proxy(new Object[0], myOwnSpuListFragmentV2, changeQuickRedirect, false, 280648, new Class[0], Void.TYPE).isSupported) {
                myOwnSpuListFragmentV2.i().l(true);
            }
            if (!PatchProxy.proxy(new Object[0], myOwnSpuListFragmentV2, changeQuickRedirect, false, 280649, new Class[0], Void.TYPE).isSupported) {
                myOwnSpuListFragmentV2.i().o(true);
            }
        }
    }

    public static void d(MyOwnSpuListFragmentV2 myOwnSpuListFragmentV2, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, myOwnSpuListFragmentV2, changeQuickRedirect, false, 280653, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
        }
    }

    public static void e(MyOwnSpuListFragmentV2 myOwnSpuListFragmentV2) {
        if (!PatchProxy.proxy(new Object[0], myOwnSpuListFragmentV2, changeQuickRedirect, false, 280655, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
        }
    }

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

    public static void g(MyOwnSpuListFragmentV2 myOwnSpuListFragmentV2, View view, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{view, bundle}, myOwnSpuListFragmentV2, changeQuickRedirect, false, 280659, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            super.onViewCreated(view, bundle);
        }
    }

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

    public final MallModuleExposureHelper getExposureHelper() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280626, new Class[0], MallModuleExposureHelper.class);
        return (MallModuleExposureHelper) (proxy.isSupported ? proxy.result : this.b.getValue());
    }

    @Override // 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, 280632, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : R.layout.fragment_my_own_spu_list_v2;
    }

    public final String h() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280627, new Class[0], String.class);
        return (String) (proxy.isSupported ? proxy.result : this.f22838c.getValue());
    }

    public final MyOwnViewModel i() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280630, new Class[0], MyOwnViewModel.class);
        return (MyOwnViewModel) (proxy.isSupported ? proxy.result : this.f.getValue());
    }

    @Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
    public void initData() {
        LiveData<List<Object>> liveData;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280634, new Class[0], Void.TYPE).isSupported) {
            ((DuImageLoaderView) _$_findCachedViewById(R.id.toolbarHolder)).i("https://apk.poizon.com/duApp/Android_Config/resource/mall/app/product/bg_my_own_top_toolbar.png").p0(DuScaleType.CENTER_CROP).x();
            i().g().observe(this, new MyOwnSpuListFragmentV2$initData$1(this));
            i().i().observe(this, new MyOwnSpuListFragmentV2$initData$2(this));
            i().h().observe(this, new MyOwnSpuListFragmentV2$initData$3(this));
            LoadResultKt.i(i().getPageResult(), this, new MyOwnSpuListFragmentV2$initData$4(this), new MyOwnSpuListFragmentV2$initData$5(this), new MyOwnSpuListFragmentV2$initData$6(this));
            LoadResultKt.h(i().getLoadStatus(), this, new MyOwnSpuListFragmentV2$initData$7(this), new MyOwnSpuListFragmentV2$initData$8(this));
            MyOwnViewModel i3 = i();
            PatchProxyResult proxy = PatchProxy.proxy(new Object[0], i3, MyOwnViewModel.changeQuickRedirect, false, 280896, new Class[0], LiveData.class);
            if (proxy.isSupported) {
                liveData = (LiveData) proxy.result;
            } else {
                liveData = i3.n;
            }
            liveData.observe(this, new MyOwnSpuListFragmentV2$initData$9(this));
        }
    }

    @Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
    @SuppressLint({"ClickableViewAccessibility"})
    public void initView(@org.jetbrains.annotations.Nullable Bundle bundle) {
        Context context;
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 280633, new Class[]{Bundle.class}, Void.TYPE).isSupported && (context = getContext()) != null) {
            ((RecyclerView) _$_findCachedViewById(R.id.recyclerView)).setLayoutManager(this.k.getGridLayoutManager(context));
            ((RecyclerView) _$_findCachedViewById(R.id.recyclerView)).setAdapter(this.k);
            ((RecyclerView) _$_findCachedViewById(R.id.recyclerView)).setItemAnimator(null);
            ((RecyclerView) _$_findCachedViewById(R.id.recyclerView)).addItemDecoration(this.l);
            ((PlaceholderLayout) _$_findCachedViewById(R.id.placeholderLayout)).setEmptyBackgroundColor(-1);
            ((PlaceholderLayout) _$_findCachedViewById(R.id.placeholderLayout)).setExtraTopPadding(fi.b.b((float) 100));
            ((PlaceholderLayout) _$_findCachedViewById(R.id.placeholderLayout)).setEmptyContent("暂无拥有\n快去找到你的好物, 点击“拥有”吧");
            ((DuSmartLayout) _$_findCachedViewById(R.id.smartLayout)).setDuRefreshListener(new b(this));
            ((RecyclerView) _$_findCachedViewById(R.id.recyclerView)).addOnScrollListener(new MyOwnSpuListFragmentV2$initView$$inlined$doOnScrolled$1(this));
            ((RecyclerView) _$_findCachedViewById(R.id.recyclerView)).setOnTouchListener(new c(this, ViewConfiguration.get(context).getScaledTouchSlop() * 2));
            LoadMoreHelper g3 = LoadMoreHelper.g(new d(this), 0);
            g3.d((RecyclerView) _$_findCachedViewById(R.id.recyclerView));
            this.f22839g = g3;
            Unit unit = Unit.INSTANCE;
            this.f22839g = g3;
        }
    }

    public final void j() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280647, new Class[0], Void.TYPE).isSupported) {
            i().n(true);
        }
    }

    public final void k() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280641, new Class[0], Void.TYPE).isSupported) {
            int i3 = 0;
            for (T t : this.k.getItems()) {
                int i12 = i3 + 1;
                if (i3 < 0) {
                    CollectionsKt__CollectionsKt.throwIndexOverflow();
                }
                if (t instanceof MyOwnSpuItemModel) {
                    T t4 = t;
                    if (t4.isLongSelected()) {
                        t4.setLongSelected(false);
                        this.k.notifyItemChanged(i3);
                    }
                }
                i3 = i12;
            }
        }
    }

    /* JADX DEBUG: Multi-variable search result rejected for r20v0, resolved type: boolean */
    /* JADX WARN: Multi-variable type inference failed */
    public final void l(MyOwnSpuItemModel myOwnSpuItemModel, boolean z) {
        int i3;
        if (!PatchProxy.proxy(new Object[]{myOwnSpuItemModel, new Byte(z ? (byte) 1 : 0)}, this, changeQuickRedirect, false, 280631, new Class[]{MyOwnSpuItemModel.class, Boolean.TYPE}, Void.TYPE).isSupported) {
            List<MyOwnSkuListItemModel> skuInfos = myOwnSpuItemModel.getSkuInfos();
            MyOwnSkuListItemModel myOwnSkuListItemModel = skuInfos != null ? (MyOwnSkuListItemModel) CollectionsKt___CollectionsKt.firstOrNull((List) skuInfos) : null;
            List<MyOwnSkuCardItemModel> value = i().f().getValue();
            if (value != null) {
                Iterator<MyOwnSkuCardItemModel> it2 = value.iterator();
                i3 = 0;
                while (true) {
                    if (!it2.hasNext()) {
                        i3 = -1;
                        break;
                    } else if (Intrinsics.areEqual(myOwnSkuListItemModel, it2.next().getSku())) {
                        break;
                    } else {
                        i3++;
                    }
                }
            } else {
                i3 = 0;
            }
            i().j(i3);
            i().k(i3);
            FragmentActivity activity = getActivity();
            if (activity != null && (activity instanceof MyOwnActivity)) {
                MyOwnActivity myOwnActivity = (MyOwnActivity) activity;
                if (!PatchProxy.proxy(new Object[]{new Byte((byte) z)}, myOwnActivity, MyOwnActivity.changeQuickRedirect, false, 280417, new Class[]{Boolean.TYPE}, Void.TYPE).isSupported) {
                    Fragment findFragmentByTag = myOwnActivity.getSupportFragmentManager().findFragmentByTag("MyOwnSpuListFragment");
                    MyOwnSkuCardFragment myOwnSkuCardFragment = new MyOwnSkuCardFragment();
                    myOwnSkuCardFragment.setArguments(BundleKt.bundleOf(TuplesKt.to("isFromEditor", Boolean.valueOf(z))));
                    if (findFragmentByTag != null) {
                        myOwnActivity.getSupportFragmentManager().beginTransaction().add(R.id.container, myOwnSkuCardFragment, "MyOwnSkuCardFragment").addToBackStack(null).setMaxLifecycle(findFragmentByTag, Lifecycle.State.STARTED).commitAllowingStateLoss();
                    }
                }
            }
        }
    }

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

    @Override // 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, 280656, 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.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onDestroyView() {
        HashMap hashMap;
        super.onDestroyView();
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280651, new Class[0], Void.TYPE).isSupported && (hashMap = this.m) != null) {
            hashMap.clear();
        }
    }

    @Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
    public void onNetErrorRetryClick() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280643, new Class[0], Void.TYPE).isSupported) {
            i().fetchData(true);
        }
    }

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

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

    @Override // 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, 280658, 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 showEmptyView() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 280636, new Class[0], Void.TYPE).isSupported) {
            super.showEmptyView();
            ((DuImageLoaderView) _$_findCachedViewById(R.id.toolbarHolder)).setAlpha(o5.i.f36333a);
        }
    }
}