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


package com.shizhuang.duapp.modules.publish.fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.FragmentViewModelLazyKt;
import androidx.recyclerview.widget.RecyclerView;
import co.c;
import co.d;
import com.knightboost.weaver.api.Scope;
import com.knightboost.weaver.api.annotations.Insert;
import com.knightboost.weaver.api.annotations.TargetClass;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.component.recyclerview.LinearItemDecoration;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.recyclerview.adapter.DuDelegateInnerAdapter;
import com.shizhuang.duapp.common.recyclerview.holder.DuViewHolder;
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.modules.publish.model.brand.BrandSearchItemModel;
import com.shizhuang.duapp.modules.publish.viewmodel.PublishBusinessCooperationViewModel;
import fi.b;
import java.util.HashMap;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Reflection;
import o5.i;
import org.jetbrains.annotations.NotNull;

@Metadata(bv = {}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\u0018\u00002\u00020\u0001:\u0002\u0004\u0005B\u0007¢\u0006\u0004\b\u0002\u0010\u0003¨\u0006\u0006"}, d2 = {"Lcom/shizhuang/duapp/modules/publish/fragment/PublishBusinessSearchBrandFragment;", "Lcom/shizhuang/duapp/common/ui/BaseFragment;", "<init>", "()V", "a", "PublishBusinessSearchBrandAdapter", "du_media_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: PublishBusinessSearchBrandFragment.kt */
public final class PublishBusinessSearchBrandFragment extends BaseFragment {
    public static ChangeQuickRedirect changeQuickRedirect;
    @NotNull
    public static final a e = new a(null);
    public PublishBusinessSearchBrandAdapter b;

    /* renamed from: c  reason: collision with root package name */
    public final Lazy f24397c = FragmentViewModelLazyKt.createViewModelLazy(this, Reflection.getOrCreateKotlinClass(PublishBusinessCooperationViewModel.class), new PublishBusinessSearchBrandFragment$$special$$inlined$activityViewModels$1(this), new PublishBusinessSearchBrandFragment$$special$$inlined$activityViewModels$2(this));
    public HashMap d;

    @Metadata(bv = {}, d1 = {"\u0000\u0010\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001:\u0001\u0005B\u0007¢\u0006\u0004\b\u0003\u0010\u0004¨\u0006\u0006"}, d2 = {"Lcom/shizhuang/duapp/modules/publish/fragment/PublishBusinessSearchBrandFragment$PublishBusinessSearchBrandAdapter;", "Lcom/shizhuang/duapp/common/recyclerview/adapter/DuDelegateInnerAdapter;", "Lcom/shizhuang/duapp/modules/publish/model/brand/BrandSearchItemModel;", "<init>", "()V", "SearchBrandViewHolder", "du_media_release"}, k = 1, mv = {1, 4, 2})
    /* compiled from: PublishBusinessSearchBrandFragment.kt */
    public static final class PublishBusinessSearchBrandAdapter extends DuDelegateInnerAdapter<BrandSearchItemModel> {
        public static ChangeQuickRedirect changeQuickRedirect;

        @Metadata(bv = {}, d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001¨\u0006\u0003"}, d2 = {"Lcom/shizhuang/duapp/modules/publish/fragment/PublishBusinessSearchBrandFragment$PublishBusinessSearchBrandAdapter$SearchBrandViewHolder;", "Lcom/shizhuang/duapp/common/recyclerview/holder/DuViewHolder;", "Lcom/shizhuang/duapp/modules/publish/model/brand/BrandSearchItemModel;", "du_media_release"}, k = 1, mv = {1, 4, 2})
        /* compiled from: PublishBusinessSearchBrandFragment.kt */
        public static final class SearchBrandViewHolder extends DuViewHolder<BrandSearchItemModel> {
            public static ChangeQuickRedirect changeQuickRedirect;
            public int b;

            /* renamed from: c  reason: collision with root package name */
            public int f24398c;
            public float d = ((float) b.b((float) 1));
            public HashMap e;

            public SearchBrandViewHolder(@NotNull View view) {
                super(view);
                int b2 = b.b(34.0f);
                this.b = b2;
                this.f24398c = b2;
            }

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

            /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object, int] */
            @Override // com.shizhuang.duapp.common.recyclerview.holder.DuViewHolder
            public void onBind(BrandSearchItemModel brandSearchItemModel, int i) {
                c cVar;
                BrandSearchItemModel brandSearchItemModel2 = brandSearchItemModel;
                boolean z = false;
                if (!PatchProxy.proxy(new Object[]{brandSearchItemModel2, new Integer(i)}, this, changeQuickRedirect, false, 306092, new Class[]{BrandSearchItemModel.class, Integer.TYPE}, Void.TYPE).isSupported) {
                    ((TextView) _$_findCachedViewById(R.id.tvName)).setText(brandSearchItemModel2.getTagName());
                    String icon = brandSearchItemModel2.getIcon();
                    if (icon == null || icon.length() == 0) {
                        z = true;
                    }
                    if (z) {
                        cVar = ((DuImageLoaderView) _$_findCachedViewById(R.id.ivBrand)).i("https://cdn.poizon.com/node-common/48cb35a450822bae2df5643b99ba8442.png");
                    } else {
                        cVar = ((DuImageLoaderView) _$_findCachedViewById(R.id.ivBrand)).i(brandSearchItemModel2.getIcon());
                    }
                    ((c) c.a0(cVar, this.d, i.f36333a, i.f36333a, i.f36333a, 14, null).p0(DuScaleType.CENTER_INSIDE).v(new d(this.b, this.f24398c))).x();
                }
            }
        }

        @Override // com.shizhuang.duapp.common.recyclerview.adapter.AdapterLoader, com.shizhuang.duapp.common.recyclerview.adapter.DuDelegateInnerAdapter
        @NotNull
        public DuViewHolder<BrandSearchItemModel> onViewHolderCreate(@NotNull ViewGroup viewGroup, int i) {
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{viewGroup, new Integer(i)}, this, changeQuickRedirect, false, 306091, new Class[]{ViewGroup.class, Integer.TYPE}, DuViewHolder.class);
            if (proxy.isSupported) {
                return (DuViewHolder) proxy.result;
            }
            return new SearchBrandViewHolder(ViewExtensionKt.w(viewGroup, R.layout.du_trend_item_publish_business_search_brand, false, 2));
        }
    }

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

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

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

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

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

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

        public a(DefaultConstructorMarker defaultConstructorMarker) {
        }
    }

    public static void c(PublishBusinessSearchBrandFragment publishBusinessSearchBrandFragment, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, publishBusinessSearchBrandFragment, changeQuickRedirect, false, 306079, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
        }
    }

    public static void d(PublishBusinessSearchBrandFragment publishBusinessSearchBrandFragment) {
        if (!PatchProxy.proxy(new Object[0], publishBusinessSearchBrandFragment, changeQuickRedirect, false, 306081, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
        }
    }

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

    public static void f(PublishBusinessSearchBrandFragment publishBusinessSearchBrandFragment) {
        if (!PatchProxy.proxy(new Object[0], publishBusinessSearchBrandFragment, changeQuickRedirect, false, 306085, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
        }
    }

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

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

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

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

    @Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
    public void initData() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 306073, new Class[0], Void.TYPE).isSupported && !PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 306074, new Class[0], Void.TYPE).isSupported) {
            h().getBrandSearchResult().observe(this, new PublishBusinessSearchBrandFragment$initLiveData$1(this));
            h().getKeywordChange().observe(this, new PublishBusinessSearchBrandFragment$initLiveData$2(this));
        }
    }

    @Override // com.shizhuang.duapp.common.base.inter.IViewController, com.shizhuang.duapp.common.ui.BaseFragment
    public void initView(@org.jetbrains.annotations.Nullable Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 306070, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 306071, new Class[0], Void.TYPE).isSupported) {
                ((PlaceholderLayout) _$_findCachedViewById(R.id.placeholderLayout)).setEmptyView(R.layout.du_trend_publish_brand_empty);
                ((PlaceholderLayout) _$_findCachedViewById(R.id.placeholderLayout)).setLoadingView(R.layout.du_trend_publish_brand_load);
                int color = getResources().getColor(R.color.du_community_float_content_bg);
                ((PlaceholderLayout) _$_findCachedViewById(R.id.placeholderLayout)).setNetworkBackgroundColor(color);
                ((PlaceholderLayout) _$_findCachedViewById(R.id.placeholderLayout)).setEmptyBackgroundColor(color);
                ((PlaceholderLayout) _$_findCachedViewById(R.id.placeholderLayout)).setLoadingBackgroundColor(color);
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 306072, new Class[0], Void.TYPE).isSupported) {
                PublishBusinessSearchBrandAdapter publishBusinessSearchBrandAdapter = new PublishBusinessSearchBrandAdapter();
                publishBusinessSearchBrandAdapter.setOnItemClickListener(new PublishBusinessSearchBrandFragment$initRecyclerView$$inlined$apply$lambda$1(this));
                Unit unit = Unit.INSTANCE;
                this.b = publishBusinessSearchBrandAdapter;
                RecyclerView recyclerView = (RecyclerView) _$_findCachedViewById(R.id.rvSearch);
                recyclerView.addItemDecoration(new LinearItemDecoration(0, b.b((float) 10), 0, false, false, 24));
                PublishBusinessSearchBrandAdapter publishBusinessSearchBrandAdapter2 = this.b;
                if (publishBusinessSearchBrandAdapter2 == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("searchBrandAdapter");
                }
                recyclerView.setAdapter(publishBusinessSearchBrandAdapter2);
            }
        }
    }

    @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, 306078, 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, 306082, 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, 306077, new Class[0], Void.TYPE).isSupported && (hashMap = this.d) != null) {
            hashMap.clear();
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseFragment, androidx.fragment.app.Fragment
    public void onResume() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 306084, 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, 306080, 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, 306086, new Class[]{View.class, Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.FragmentMethodWeaver_onViewCreated(this, view, bundle);
        }
    }
}