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


package com.shizhuang.duapp.modules.live.anchor.livecenter;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.Keep;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.RecyclerView;
import com.alibaba.android.arouter.facade.annotation.Autowired;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.vlayout.DelegateAdapter;
import com.google.android.material.appbar.AppBarLayout;
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.meizu.cloud.pushsdk.constants.PushConstants;
import com.meizu.cloud.pushsdk.notification.model.NotifyType;
import com.sensorsdata.analytics.android.sdk.SensorsDataAutoTrackHelper;
import com.sensorsdata.analytics.android.sdk.SensorsDataInstrumented;
import com.shizhuang.duapp.R;
import com.shizhuang.duapp.common.base.inter.IViewController;
import com.shizhuang.duapp.common.extension.ViewExtensionKt;
import com.shizhuang.duapp.common.extension.ViewModelLifecycleAwareLazy;
import com.shizhuang.duapp.common.helper.net.ParamsBuilder;
import com.shizhuang.duapp.common.recyclerview.adapter.DuDelegateAdapter;
import com.shizhuang.duapp.common.recyclerview.adapter.DuDelegateInnerAdapter;
import com.shizhuang.duapp.common.recyclerview.manager.DuVirtualLayoutManager;
import com.shizhuang.duapp.common.ui.BaseLeftBackActivity;
import com.shizhuang.duapp.common.widget.font.FontText;
import com.shizhuang.duapp.libs.duimageloaderview.DuImageLoaderView;
import com.shizhuang.duapp.libs.network.request.DuHttpRequest;
import com.shizhuang.duapp.modules.live.anchor.livecenter.vm.LiveDataCenterViewModel;
import com.shizhuang.duapp.modules.live.anchor.livecenter.widgets.LiveDataCenterAnchorInfoView;
import com.shizhuang.duapp.modules.live.anchor.livecenter.widgets.LiveDataCenterAnchorInfoView$renderAnchorInfoUI$2;
import com.shizhuang.duapp.modules.live.anchor.livequality.fans.LiveFansData;
import com.shizhuang.duapp.modules.live.common.api.LiveApi;
import com.shizhuang.duapp.modules.live.common.helper.ChatMessageSpannableHelper;
import com.shizhuang.duapp.modules.live.common.model.AnchorSurveyDataModel;
import com.shizhuang.duapp.modules.live.common.model.AnchorSurveyViewModel;
import com.shizhuang.duapp.modules.live.common.model.LiveCenterListModel;
import com.shizhuang.duapp.modules.live.common.model.LiveDataCenterItem;
import com.shizhuang.duapp.modules.live.common.model.LiveGrassInfoModel;
import com.shizhuang.duapp.modules.live.common.model.LiveLevelUserInfo;
import com.shizhuang.duapp.modules.live.common.model.LiveWillOpenItemModel;
import com.shizhuang.duapp.modules.live.common.model.RefreshEvent;
import com.shizhuang.duapp.modules.live.common.model.live.LiveLevelItem;
import com.shizhuang.duapp.modules.live.common.widget.LiveAvatarLayout;
import com.shizhuang.duapp.modules.live.common.widget.dialog.LiveApplyDialog;
import com.shizhuang.duapp.modules.live.mid_service.router.LiveRouterManager;
import df.n0;
import df.r0;
import ip.c;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import kotlin.Lazy;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.MapsKt__MapsKt;
import kotlin.jvm.JvmField;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Ref;
import ln0.d;
import mn0.e;
import o5.i;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import td.j;
import td.r;
import td.s;

@Route(path = "/trend/LiveDataCenterListPage")
@Metadata(bv = {}, d1 = {"\u0000 \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\u0005\b\u0007\u0018\u00002\u00020\u00012\u00020\u0002B\u0007¢\u0006\u0004\b\n\u0010\u000bJ\u0010\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0004\u001a\u00020\u0003H\u0007J\u0012\u0010\t\u001a\u00020\u00052\b\u0010\b\u001a\u0004\u0018\u00010\u0007H\u0016¨\u0006\f"}, d2 = {"Lcom/shizhuang/duapp/modules/live/anchor/livecenter/LiveDataCenterLiveListActivity;", "Lcom/shizhuang/duapp/common/ui/BaseLeftBackActivity;", "Landroid/view/View$OnClickListener;", "Lcom/shizhuang/duapp/modules/live/common/model/RefreshEvent;", "event", "", "onEvent", "Landroid/view/View;", NotifyType.VIBRATE, "onClick", "<init>", "()V", "du_live_release"}, k = 1, mv = {1, 4, 2})
/* compiled from: LiveDataCenterLiveListActivity.kt */
public final class LiveDataCenterLiveListActivity extends BaseLeftBackActivity implements View.OnClickListener {
    public static ChangeQuickRedirect changeQuickRedirect;
    @Autowired
    @JvmField
    @Nullable

    /* renamed from: c  reason: collision with root package name */
    public String f17453c;
    public DelegateAdapter d;
    public LiveDataCenterEmptyAdapter e;
    public LiveDataCenterAnchorRankAdapter f;

    /* renamed from: g  reason: collision with root package name */
    public LiveDataCenterWillOpenAdapter f17454g;

    /* renamed from: h  reason: collision with root package name */
    public LiveDataCenterLiveIncomeAdapter f17455h;
    public LiveDataCenterFansAdapter i;
    public LiveDataCenterLiveQualityAdapter j;
    public LiveDataCenterActionAdapter k;
    public LiveDataCenterEduAdapter l;
    public final List<DuDelegateInnerAdapter<? extends Object>> m = new ArrayList();
    public int n;
    public LiveCenterListModel o;
    public final Lazy p = new ViewModelLifecycleAwareLazy(this, new LiveDataCenterLiveListActivity$$special$$inlined$duViewModel$1(this));

    /* renamed from: q  reason: collision with root package name */
    public final Lazy f17456q = new ViewModelLifecycleAwareLazy(this, new LiveDataCenterLiveListActivity$$special$$inlined$duViewModel$2(this));
    public RefreshEvent r;
    public HashMap s;

    public class _boostWeave {
        public static ChangeQuickRedirect changeQuickRedirect;

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
        @Insert(mayCreateSuper = true, value = "onCreate")
        @Keep
        public static void ActivityMethodWeaver_onCreate(@androidx.annotation.Nullable LiveDataCenterLiveListActivity liveDataCenterLiveListActivity, Bundle bundle) {
            if (!PatchProxy.proxy(new Object[]{liveDataCenterLiveListActivity, bundle}, null, changeQuickRedirect, true, 179557, new Class[]{LiveDataCenterLiveListActivity.class, Bundle.class}, Void.TYPE).isSupported) {
                jn.b bVar = jn.b.f34396a;
                if (!bVar.b()) {
                    bVar.d(true);
                }
                long currentTimeMillis = System.currentTimeMillis();
                LiveDataCenterLiveListActivity.e(liveDataCenterLiveListActivity, bundle);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (liveDataCenterLiveListActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.live.anchor.livecenter.LiveDataCenterLiveListActivity")) {
                    bVar.activityOnCreateMethod(liveDataCenterLiveListActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
        @Insert(mayCreateSuper = true, value = "onResume")
        @Keep
        public static void ActivityMethodWeaver_onResume(LiveDataCenterLiveListActivity liveDataCenterLiveListActivity) {
            if (!PatchProxy.proxy(new Object[]{liveDataCenterLiveListActivity}, null, changeQuickRedirect, true, 179556, new Class[]{LiveDataCenterLiveListActivity.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                LiveDataCenterLiveListActivity.d(liveDataCenterLiveListActivity);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (liveDataCenterLiveListActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.live.anchor.livecenter.LiveDataCenterLiveListActivity")) {
                    jn.b.f34396a.activityOnResumeMethod(liveDataCenterLiveListActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }

        @TargetClass(scope = Scope.ALL_CHILDREN, value = "androidx.appcompat.app.AppCompatActivity")
        @Insert(mayCreateSuper = true, value = "onStart")
        @Keep
        public static void ActivityMethodWeaver_onStart(LiveDataCenterLiveListActivity liveDataCenterLiveListActivity) {
            if (!PatchProxy.proxy(new Object[]{liveDataCenterLiveListActivity}, null, changeQuickRedirect, true, 179558, new Class[]{LiveDataCenterLiveListActivity.class}, Void.TYPE).isSupported) {
                long currentTimeMillis = System.currentTimeMillis();
                LiveDataCenterLiveListActivity.f(liveDataCenterLiveListActivity);
                long currentTimeMillis2 = System.currentTimeMillis();
                if (liveDataCenterLiveListActivity.getClass().getCanonicalName().equals("com.shizhuang.duapp.modules.live.anchor.livecenter.LiveDataCenterLiveListActivity")) {
                    jn.b.f34396a.activityOnStartMethod(liveDataCenterLiveListActivity, currentTimeMillis, currentTimeMillis2);
                }
            }
        }
    }

    /* compiled from: LiveDataCenterLiveListActivity.kt */
    public static final class a extends r<LiveCenterListModel> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ LiveDataCenterLiveListActivity b;

        /* JADX INFO: super call moved to the top of the method (can break code semantics) */
        public a(LiveDataCenterLiveListActivity liveDataCenterLiveListActivity, IViewController iViewController, boolean z) {
            super(iViewController, z);
            this.b = liveDataCenterLiveListActivity;
        }

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // td.r, com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(LiveCenterListModel liveCenterListModel) {
            boolean z;
            LiveLevelUserInfo userInfo;
            String str;
            LiveCenterListModel liveCenterListModel2 = liveCenterListModel;
            boolean z4 = true;
            int i = 0;
            if (!PatchProxy.proxy(new Object[]{liveCenterListModel2}, this, changeQuickRedirect, false, 179560, new Class[]{LiveCenterListModel.class}, Void.TYPE).isSupported) {
                super.onSuccess(liveCenterListModel2);
                if (liveCenterListModel2 != null) {
                    Ref.BooleanRef booleanRef = new Ref.BooleanRef();
                    booleanRef.element = false;
                    LiveDataCenterLiveListActivity liveDataCenterLiveListActivity = this.b;
                    PatchProxyResult proxy = PatchProxy.proxy(new Object[]{liveCenterListModel2}, liveDataCenterLiveListActivity, LiveDataCenterLiveListActivity.changeQuickRedirect, false, 179542, new Class[]{LiveCenterListModel.class}, Boolean.TYPE);
                    if (proxy.isSupported) {
                        z = ((Boolean) proxy.result).booleanValue();
                    } else {
                        if (liveCenterListModel2.isInValidData()) {
                            PatchProxyResult proxy2 = PatchProxy.proxy(new Object[0], liveDataCenterLiveListActivity, LiveDataCenterLiveListActivity.changeQuickRedirect, false, 179538, new Class[0], String.class);
                            if (proxy2.isSupported) {
                                str = (String) proxy2.result;
                            } else {
                                LiveCenterListModel liveCenterListModel3 = liveDataCenterLiveListActivity.o;
                                if (liveCenterListModel3 == null || (str = liveCenterListModel3.getLastId()) == null) {
                                    str = "0";
                                }
                            }
                            if (Intrinsics.areEqual(str, "0")) {
                                liveDataCenterLiveListActivity.showEmptyView();
                                z = true;
                            }
                        }
                        z = false;
                    }
                    if (!z) {
                        LiveDataCenterLiveListActivity liveDataCenterLiveListActivity2 = this.b;
                        liveDataCenterLiveListActivity2.o = liveCenterListModel2;
                        if (!PatchProxy.proxy(new Object[0], liveDataCenterLiveListActivity2, LiveDataCenterLiveListActivity.changeQuickRedirect, false, 179541, new Class[0], Void.TYPE).isSupported && liveDataCenterLiveListActivity2.g() != -1) {
                            ((LinearLayout) liveDataCenterLiveListActivity2._$_findCachedViewById(R.id.llGoLive)).setVisibility((liveDataCenterLiveListActivity2.g() == 2 || liveDataCenterLiveListActivity2.g() == 4) ? 0 : 8);
                        }
                        LiveDataCenterAnchorInfoView liveDataCenterAnchorInfoView = (LiveDataCenterAnchorInfoView) this.b._$_findCachedViewById(R.id.clAnchorInfo);
                        if (!PatchProxy.proxy(new Object[]{liveCenterListModel2}, liveDataCenterAnchorInfoView, LiveDataCenterAnchorInfoView.changeQuickRedirect, false, 180727, new Class[]{LiveCenterListModel.class}, Void.TYPE).isSupported && (userInfo = liveCenterListModel2.getUserInfo()) != null) {
                            ((LiveAvatarLayout) liveDataCenterAnchorInfoView.a(R.id.ivAvatar)).h(userInfo.getIcon(), userInfo.getVIcon(), userInfo.getAvatarFrame(), userInfo.getNIcon());
                            ((FontText) liveDataCenterAnchorInfoView.a(R.id.tvName)).setText(userInfo.getUserName());
                            List<LiveLevelItem> extraLevels = userInfo.getExtraLevels();
                            if (extraLevels != null) {
                                ChatMessageSpannableHelper.Companion.c(ChatMessageSpannableHelper.f18302a, "", (TextView) liveDataCenterAnchorInfoView.a(R.id.tvAnchorRankTag), extraLevels, false, false, 24);
                            }
                            ((LinearLayout) liveDataCenterAnchorInfoView.a(R.id.llCreditScore)).setVisibility(0);
                            ViewExtensionKt.j((LinearLayout) liveDataCenterAnchorInfoView.a(R.id.llCreditScore), 0, new LiveDataCenterAnchorInfoView$renderAnchorInfoUI$2(liveCenterListModel2), 1);
                        }
                        LiveDataCenterWillOpenAdapter liveDataCenterWillOpenAdapter = this.b.f17454g;
                        if (liveDataCenterWillOpenAdapter == null) {
                            Intrinsics.throwUninitializedPropertyAccessException("willOpenAdapter");
                        }
                        List listOf = CollectionsKt__CollectionsJVMKt.listOf(liveCenterListModel2);
                        LiveDataCenterLiveListActivity$fetchData$1$onSuccess$1$1 liveDataCenterLiveListActivity$fetchData$1$onSuccess$1$1 = new LiveDataCenterLiveListActivity$fetchData$1$onSuccess$1$1(booleanRef);
                        if (!PatchProxy.proxy(new Object[]{listOf, liveDataCenterLiveListActivity$fetchData$1$onSuccess$1$1}, liveDataCenterWillOpenAdapter, LiveDataCenterWillOpenAdapter.changeQuickRedirect, false, 179582, new Class[]{List.class, Function0.class}, Void.TYPE).isSupported) {
                            ArrayList arrayList = new ArrayList();
                            for (Object obj : listOf) {
                                ArrayList<LiveWillOpenItemModel> scheduleList = ((LiveCenterListModel) obj).getScheduleList();
                                if (!(scheduleList == null || scheduleList.isEmpty())) {
                                    arrayList.add(obj);
                                }
                            }
                            if (arrayList.isEmpty()) {
                                liveDataCenterWillOpenAdapter.clearItems();
                                liveDataCenterLiveListActivity$fetchData$1$onSuccess$1$1.invoke();
                            } else {
                                liveDataCenterWillOpenAdapter.setItems(arrayList);
                            }
                        }
                        LiveDataCenterAnchorRankAdapter liveDataCenterAnchorRankAdapter = this.b.f;
                        if (liveDataCenterAnchorRankAdapter == null) {
                            Intrinsics.throwUninitializedPropertyAccessException("anchorRankAdapter");
                        }
                        liveDataCenterAnchorRankAdapter.setItems(CollectionsKt__CollectionsJVMKt.listOf(liveCenterListModel2));
                        LiveDataCenterLiveQualityAdapter liveDataCenterLiveQualityAdapter = this.b.j;
                        if (liveDataCenterLiveQualityAdapter == null) {
                            Intrinsics.throwUninitializedPropertyAccessException("qualityAdapter");
                        }
                        liveDataCenterLiveQualityAdapter.setItems(CollectionsKt__CollectionsJVMKt.listOf(liveCenterListModel2));
                        LiveDataCenterActionAdapter liveDataCenterActionAdapter = this.b.k;
                        if (liveDataCenterActionAdapter == null) {
                            Intrinsics.throwUninitializedPropertyAccessException("actionAdapter");
                        }
                        liveDataCenterActionAdapter.setItems(CollectionsKt__CollectionsJVMKt.listOf(liveCenterListModel2));
                        ImageView imageView = (ImageView) this.b._$_findCachedViewById(R.id.ivRelaseNotice);
                        if (this.b.g() != 4) {
                            z4 = false;
                        }
                        if (!z4) {
                            i = 8;
                        }
                        imageView.setVisibility(i);
                        if (booleanRef.element) {
                            DelegateAdapter delegateAdapter = this.b.d;
                            if (delegateAdapter == null) {
                                Intrinsics.throwUninitializedPropertyAccessException("rootAdapter");
                            }
                            delegateAdapter.notifyDataSetChanged();
                        }
                    }
                }
            }
        }
    }

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

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

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(Object obj) {
            LiveGrassInfoModel liveGrassInfoModel = (LiveGrassInfoModel) obj;
            if (!PatchProxy.proxy(new Object[]{liveGrassInfoModel}, this, changeQuickRedirect, false, 179562, new Class[]{LiveGrassInfoModel.class}, Void.TYPE).isSupported) {
                super.onSuccess(liveGrassInfoModel);
                if (liveGrassInfoModel != null && this.b.k()) {
                    LiveDataCenterLiveIncomeAdapter liveDataCenterLiveIncomeAdapter = this.b.f17455h;
                    if (liveDataCenterLiveIncomeAdapter == null) {
                        Intrinsics.throwUninitializedPropertyAccessException("incomeAdapter");
                    }
                    liveDataCenterLiveIncomeAdapter.setItems(CollectionsKt__CollectionsJVMKt.listOf(liveGrassInfoModel));
                }
            }
        }
    }

    /* compiled from: LiveDataCenterLiveListActivity.kt */
    public static final class c extends s<LiveFansData> {
        public static ChangeQuickRedirect changeQuickRedirect;
        public final /* synthetic */ LiveDataCenterLiveListActivity b;

        /* JADX WARN: Incorrect args count in method signature: ()V */
        public c(LiveDataCenterLiveListActivity liveDataCenterLiveListActivity) {
            this.b = liveDataCenterLiveListActivity;
        }

        @Override // com.shizhuang.duapp.common.helper.net.facade.IViewHandler, td.a
        public void onSuccess(Object obj) {
            LiveFansData liveFansData = (LiveFansData) obj;
            if (!PatchProxy.proxy(new Object[]{liveFansData}, this, changeQuickRedirect, false, 179563, new Class[]{LiveFansData.class}, Void.TYPE).isSupported) {
                super.onSuccess(liveFansData);
                if (liveFansData != null && this.b.k()) {
                    LiveDataCenterFansAdapter liveDataCenterFansAdapter = this.b.i;
                    if (liveDataCenterFansAdapter == null) {
                        Intrinsics.throwUninitializedPropertyAccessException("fansAdapter");
                    }
                    liveDataCenterFansAdapter.setItems(CollectionsKt__CollectionsJVMKt.listOf(liveFansData));
                }
            }
        }
    }

    public static void d(LiveDataCenterLiveListActivity liveDataCenterLiveListActivity) {
        if (!PatchProxy.proxy(new Object[0], liveDataCenterLiveListActivity, changeQuickRedirect, false, 179534, new Class[0], Void.TYPE).isSupported) {
            super.onResume();
            RefreshEvent refreshEvent = liveDataCenterLiveListActivity.r;
            if (refreshEvent != null) {
                if (refreshEvent.isResumeRefresh) {
                    liveDataCenterLiveListActivity.fetchData();
                }
                if (refreshEvent.isNeedGoDetail) {
                    liveDataCenterLiveListActivity.j(String.valueOf(refreshEvent.scheduleId));
                }
                liveDataCenterLiveListActivity.r = null;
            }
            n0.f31459a.f("community_live_center_pageview", "226", new LiveDataCenterLiveListActivity$onResume$2(liveDataCenterLiveListActivity));
        }
    }

    public static void e(LiveDataCenterLiveListActivity liveDataCenterLiveListActivity, Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, liveDataCenterLiveListActivity, changeQuickRedirect, false, 179550, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.onCreate(bundle);
        }
    }

    public static void f(LiveDataCenterLiveListActivity liveDataCenterLiveListActivity) {
        if (!PatchProxy.proxy(new Object[0], liveDataCenterLiveListActivity, changeQuickRedirect, false, 179552, new Class[0], Void.TYPE).isSupported) {
            super.onStart();
        }
    }

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

    public final void fetchData() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179539, new Class[0], Void.TYPE).isSupported) {
            LiveDataCenterEmptyAdapter liveDataCenterEmptyAdapter = this.e;
            if (liveDataCenterEmptyAdapter == null) {
                Intrinsics.throwUninitializedPropertyAccessException("emptyAdapter");
            }
            liveDataCenterEmptyAdapter.clearItems();
            e.a aVar = e.f35721a;
            a aVar2 = new a(this, this, false);
            if (!PatchProxy.proxy(new Object[]{"0", aVar2}, aVar, e.a.changeQuickRedirect, false, 193248, new Class[]{String.class, s.class}, Void.TYPE).isSupported) {
                j.doRequest(((LiveApi) j.getJavaGoApi(LiveApi.class)).fetchLiveCenterList("0"), aVar2);
            }
            b bVar = new b(this);
            if (!PatchProxy.proxy(new Object[]{bVar}, aVar, e.a.changeQuickRedirect, false, 193251, new Class[]{s.class}, Void.TYPE).isSupported) {
                j.doRequest(((LiveApi) j.getJavaGoApi(LiveApi.class)).fetchLiveGrassInfo(), bVar);
            }
            c cVar = new c(this);
            if (!PatchProxy.proxy(new Object[]{cVar}, aVar, e.a.changeQuickRedirect, false, 193252, new Class[]{s.class}, Void.TYPE).isSupported) {
                j.doRequest(((LiveApi) j.getJavaGoApi(LiveApi.class)).requestFansData(), cVar);
            }
            DuHttpRequest<AnchorSurveyDataModel> getAnchorSurveyRequest = h().getGetAnchorSurveyRequest();
            Ref.BooleanRef booleanRef = new Ref.BooleanRef();
            booleanRef.element = getAnchorSurveyRequest.getMutableAllStateLiveData().getValue() instanceof c.a;
            getAnchorSurveyRequest.getMutableAllStateLiveData().observe(ip.j.a(this), new LiveDataCenterLiveListActivity$fetchData$$inlined$observe$1(getAnchorSurveyRequest, booleanRef, this));
            h().getAnchorSurvey();
            i().a().observe(this, new LiveDataCenterLiveListActivity$fetchData$5(this));
            LiveDataCenterViewModel i3 = i();
            if (!PatchProxy.proxy(new Object[0], i3, LiveDataCenterViewModel.changeQuickRedirect, false, 180723, new Class[0], Void.TYPE).isSupported && !i3.b) {
                i3.b = true;
                aVar.j(MapsKt__MapsKt.toMap(ParamsBuilder.newParams().addParams("page", String.valueOf(i3.f17531c)).addParams("pageSize", String.valueOf(i3.d))), new cj0.a(i3, i3));
            }
        }
    }

    public final int g() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179537, new Class[0], Integer.TYPE);
        if (proxy.isSupported) {
            return ((Integer) proxy.result).intValue();
        }
        LiveCenterListModel liveCenterListModel = this.o;
        if (liveCenterListModel != null) {
            return liveCenterListModel.getKolAuthType();
        }
        return -1;
    }

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

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

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

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

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public void initStatusBar() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179531, new Class[0], Void.TYPE).isSupported) {
            r0.s(this, true);
            r0.z(this, null);
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseLeftBackActivity, com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public void initView(@Nullable Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 179522, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            super.initView(bundle);
            this.n = r0.i(this);
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179523, new Class[0], Void.TYPE).isSupported) {
                ViewGroup.MarginLayoutParams marginLayoutParams = (ViewGroup.MarginLayoutParams) this.toolbar.getLayoutParams();
                int i3 = r0.i(getContext());
                marginLayoutParams.topMargin = i3;
                this.toolbar.setLayoutParams(marginLayoutParams);
                ViewGroup.LayoutParams layoutParams = _$_findCachedViewById(R.id.customStatusBar).getLayoutParams();
                layoutParams.height = i3;
                _$_findCachedViewById(R.id.customStatusBar).setLayoutParams(layoutParams);
                _$_findCachedViewById(R.id.customStatusBar).setAlpha(i.f36333a);
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179524, new Class[0], Void.TYPE).isSupported) {
                ((LinearLayout) _$_findCachedViewById(R.id.llGoLive)).setOnClickListener(new LiveDataCenterLiveListActivity$initOpenLiveAction$1(this));
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179525, new Class[0], Void.TYPE).isSupported) {
                DuVirtualLayoutManager duVirtualLayoutManager = new DuVirtualLayoutManager(getContext(), 0, false, 6);
                ((RecyclerView) _$_findCachedViewById(R.id.recyclerView)).setLayoutManager(duVirtualLayoutManager);
                DuDelegateAdapter duDelegateAdapter = new DuDelegateAdapter(duVirtualLayoutManager);
                this.d = duDelegateAdapter;
                if (!PatchProxy.proxy(new Object[]{duDelegateAdapter}, this, changeQuickRedirect, false, 179535, new Class[]{DelegateAdapter.class}, Void.TYPE).isSupported) {
                    ArrayList arrayList = new ArrayList();
                    LiveDataCenterEmptyAdapter liveDataCenterEmptyAdapter = new LiveDataCenterEmptyAdapter(getSupportFragmentManager());
                    this.e = liveDataCenterEmptyAdapter;
                    arrayList.add(liveDataCenterEmptyAdapter);
                    LiveDataCenterAnchorRankAdapter liveDataCenterAnchorRankAdapter = new LiveDataCenterAnchorRankAdapter(getSupportFragmentManager());
                    this.f = liveDataCenterAnchorRankAdapter;
                    arrayList.add(liveDataCenterAnchorRankAdapter);
                    LiveDataCenterWillOpenAdapter liveDataCenterWillOpenAdapter = new LiveDataCenterWillOpenAdapter();
                    this.f17454g = liveDataCenterWillOpenAdapter;
                    arrayList.add(liveDataCenterWillOpenAdapter);
                    LiveDataCenterLiveIncomeAdapter liveDataCenterLiveIncomeAdapter = new LiveDataCenterLiveIncomeAdapter();
                    this.f17455h = liveDataCenterLiveIncomeAdapter;
                    arrayList.add(liveDataCenterLiveIncomeAdapter);
                    LiveDataCenterFansAdapter liveDataCenterFansAdapter = new LiveDataCenterFansAdapter();
                    this.i = liveDataCenterFansAdapter;
                    arrayList.add(liveDataCenterFansAdapter);
                    LiveDataCenterLiveQualityAdapter liveDataCenterLiveQualityAdapter = new LiveDataCenterLiveQualityAdapter();
                    this.j = liveDataCenterLiveQualityAdapter;
                    arrayList.add(liveDataCenterLiveQualityAdapter);
                    LiveDataCenterActionAdapter liveDataCenterActionAdapter = new LiveDataCenterActionAdapter();
                    this.k = liveDataCenterActionAdapter;
                    arrayList.add(liveDataCenterActionAdapter);
                    LiveDataCenterEduAdapter liveDataCenterEduAdapter = new LiveDataCenterEduAdapter();
                    this.l = liveDataCenterEduAdapter;
                    arrayList.add(liveDataCenterEduAdapter);
                    this.m.addAll(arrayList);
                    duDelegateAdapter.addAdapters(arrayList);
                }
                ((RecyclerView) _$_findCachedViewById(R.id.recyclerView)).addItemDecoration(new LiveDataCenterLiveListActivity$initAdapter$1(this));
                RecyclerView recyclerView = (RecyclerView) _$_findCachedViewById(R.id.recyclerView);
                DelegateAdapter delegateAdapter = this.d;
                if (delegateAdapter == null) {
                    Intrinsics.throwUninitializedPropertyAccessException("rootAdapter");
                }
                recyclerView.setAdapter(delegateAdapter);
            }
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179526, new Class[0], Void.TYPE).isSupported) {
                ((AppBarLayout) _$_findCachedViewById(R.id.appBar)).addOnOffsetChangedListener((AppBarLayout.OnOffsetChangedListener) new qi0.c(this));
            }
            ((ImageView) _$_findCachedViewById(R.id.ivRelaseNotice)).setOnClickListener(this);
            ((DuImageLoaderView) _$_findCachedViewById(R.id.ivDataCenter)).g("https://apk.poizon.com/duApp/Android_Config/live/img/bg_live_data_center.png");
        }
    }

    public final void j(String str) {
        boolean z = true;
        if (!PatchProxy.proxy(new Object[]{str}, this, changeQuickRedirect, false, 179536, new Class[]{String.class}, Void.TYPE).isSupported) {
            LiveRouterManager liveRouterManager = LiveRouterManager.f18909a;
            Context context = getContext();
            if (g() != 4) {
                z = false;
            }
            liveRouterManager.i(context, str, z);
        }
    }

    public final boolean k() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179540, new Class[0], Boolean.TYPE);
        if (proxy.isSupported) {
            return ((Boolean) proxy.result).booleanValue();
        }
        LiveDataCenterEmptyAdapter liveDataCenterEmptyAdapter = this.e;
        if (liveDataCenterEmptyAdapter == null) {
            Intrinsics.throwUninitializedPropertyAccessException("emptyAdapter");
        }
        return liveDataCenterEmptyAdapter.getItemCount() == 0;
    }

    public final void l() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179529, new Class[0], Void.TYPE).isSupported) {
            r0.s(this, true);
            Drawable navigationIcon = this.toolbar.getNavigationIcon();
            if (navigationIcon != null) {
                navigationIcon.setTint(d.a(this, R.color.black));
            }
            ((TextView) _$_findCachedViewById(R.id.toolbar_title)).setTextColor(d.a(this, R.color.black));
            if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179530, new Class[0], Void.TYPE).isSupported) {
                ((ImageView) _$_findCachedViewById(R.id.ivGoLive)).setImageResource(R.mipmap.du_trend_ic_live_open_black);
                ((TextView) _$_findCachedViewById(R.id.tvGoLive)).setTextColor(ViewCompat.MEASURED_STATE_MASK);
            }
        }
    }

    @SensorsDataInstrumented
    public void onClick(@Nullable View view) {
        if (!PatchProxy.proxy(new Object[]{view}, this, changeQuickRedirect, false, 179546, new Class[]{View.class}, Void.TYPE).isSupported) {
            if (Intrinsics.areEqual(view, (ImageView) _$_findCachedViewById(R.id.ivRelaseNotice))) {
                LiveApplyDialog.f18743h.a(true).show(getSupportFragmentManager(), "LiveApplyDialog");
                qf1.a.A("211100", PushConstants.PUSH_TYPE_UPLOAD_LOG, PushConstants.PUSH_FLYME_3_CHANGE_VERSION_START, null);
                n0.e(n0.f31459a, "community_live_trailer_post_entrance_click", "226", "270", null, 8);
            }
            SensorsDataAutoTrackHelper.trackViewOnClick(view);
        }
    }

    @Override // androidx.activity.ComponentActivity, androidx.core.app.ComponentActivity, androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseLeftBackActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onCreate(Bundle bundle) {
        if (!PatchProxy.proxy(new Object[]{bundle}, this, changeQuickRedirect, false, 179549, new Class[]{Bundle.class}, Void.TYPE).isSupported) {
            _boostWeave.ActivityMethodWeaver_onCreate(this, bundle);
        }
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public final void onEvent(@NotNull RefreshEvent refreshEvent) {
        if (!PatchProxy.proxy(new Object[]{refreshEvent}, this, changeQuickRedirect, false, 179543, new Class[]{RefreshEvent.class}, Void.TYPE).isSupported) {
            if (!refreshEvent.isResumeRefresh) {
                fetchData();
                if (refreshEvent.isNeedGoDetail) {
                    j(String.valueOf(refreshEvent.scheduleId));
                    return;
                }
                return;
            }
            this.r = refreshEvent;
        }
    }

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

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseLeftBackActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onStart() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179551, new Class[0], Void.TYPE).isSupported) {
            _boostWeave.ActivityMethodWeaver_onStart(this);
        }
    }

    @Override // androidx.appcompat.app.AppCompatActivity, androidx.fragment.app.FragmentActivity, com.shizhuang.duapp.common.ui.BaseActivity
    public void onStop() {
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179545, new Class[0], Void.TYPE).isSupported) {
            super.onStop();
            qf1.a.u("211100", getRemainTime());
        }
    }

    @Override // com.shizhuang.duapp.common.ui.BaseActivity, com.shizhuang.duapp.common.base.inter.IViewController
    public void showEmptyView() {
        boolean z = false;
        if (!PatchProxy.proxy(new Object[0], this, changeQuickRedirect, false, 179544, new Class[0], Void.TYPE).isSupported) {
            Iterator<T> it2 = this.m.iterator();
            while (it2.hasNext()) {
                it2.next().clearItems();
            }
            LiveDataCenterEmptyAdapter liveDataCenterEmptyAdapter = this.e;
            if (liveDataCenterEmptyAdapter == null) {
                Intrinsics.throwUninitializedPropertyAccessException("emptyAdapter");
            }
            int g3 = g();
            LiveCenterListModel liveCenterListModel = this.o;
            if (liveCenterListModel != null) {
                z = liveCenterListModel.getHasLottery();
            }
            liveDataCenterEmptyAdapter.setItems(CollectionsKt__CollectionsJVMKt.listOf(new LiveDataCenterItem(g3, z)));
            DelegateAdapter delegateAdapter = this.d;
            if (delegateAdapter == null) {
                Intrinsics.throwUninitializedPropertyAccessException("rootAdapter");
            }
            delegateAdapter.notifyDataSetChanged();
        }
    }
}