四虎影院 v4.1.6版本的 MD5 值为:3c86dc44d368396917a29935d39af88b

以下内容为反编译后的 VideoDetailFragment.java 源代码,内容仅作参考


package cn.luckxy.vod.ui.play;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.NotificationCompatJellybean;
import androidx.fragment.app.FragmentActivity;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import cn.luckxy.vod.App;
import cn.luckxy.vod.ad.AdWebView;
import cn.luckxy.vod.bean.CollectionBean;
import cn.luckxy.vod.bean.CommentBean;
import cn.luckxy.vod.bean.GetScoreBean;
import cn.luckxy.vod.bean.Page;
import cn.luckxy.vod.bean.PlayFromBean;
import cn.luckxy.vod.bean.PlayerInfoBean;
import cn.luckxy.vod.bean.StartBean;
import cn.luckxy.vod.bean.UrlBean;
import cn.luckxy.vod.bean.VodBean;
import cn.luckxy.vod.ui.down.AllDownloadActivity;
import cn.luckxy.vod.ui.feedback.FeedbackActivity;
import cn.luckxy.vod.ui.login.LoginActivity;
import cn.luckxy.vod.ui.play.CommentDialog;
import cn.luckxy.vod.ui.play.ScoreDialog;
import cn.luckxy.vod.ui.share.ShareActivity;
import com.blankj.utilcode.util.ActivityUtils;
import com.blankj.utilcode.util.ColorUtils;
import com.blankj.utilcode.util.ConvertUtils;
import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.StringUtils;
import com.blankj.utilcode.util.TimeUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.github.StormWyrm.wanandroid.base.fragment.BaseFragment;
import com.google.android.material.bottomsheet.BottomSheetDialog;
import com.google.android.material.tabs.TabLayout;
import com.luck.picture.lib.tools.PictureFileUtils;
import com.movie.all.R;
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
import com.umeng.commonsdk.statistics.common.HelperUtils;
import g.a.b.netservice.VodService;
import g.a.b.utils.UserUtils;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
import kotlin.Metadata;
import kotlin.n0;
import kotlin.reflect.KProperty;
import kotlin.text.Regex;
import kotlin.v1.internal.c1;
import kotlin.v1.internal.h1;
import kotlin.v1.internal.j0;
import me.drakeet.multitype.MultiTypeAdapter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.litepal.LitePalApplication;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000t\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u001b\u0018\u0000 I2\u00020\u0001:\u0004HIJKB\u0005¢\u0006\u0002\u0010\u0002J\b\u00100\u001a\u000201H\u0002J\u000e\u00102\u001a\u0002012\u0006\u0010,\u001a\u00020\nJ\u000e\u00103\u001a\u0002012\u0006\u0010\u001d\u001a\u00020\nJ\b\u00104\u001a\u000201H\u0002J\u0010\u00105\u001a\u0002012\u0006\u00106\u001a\u00020\u000fH\u0002J\b\u00107\u001a\u000201H\u0002J\u0012\u00108\u001a\u0002012\b\b\u0002\u00109\u001a\u00020\u0016H\u0002J\b\u0010:\u001a\u00020\nH\u0016J\b\u0010;\u001a\u000201H\u0002J\b\u0010<\u001a\u000201H\u0002J\b\u0010=\u001a\u000201H\u0003J\b\u0010>\u001a\u000201H\u0014J\b\u0010?\u001a\u000201H\u0014J\b\u0010@\u001a\u000201H\u0016J \u0010A\u001a\u0002012\u0006\u00106\u001a\u00020\u000f2\u0006\u0010B\u001a\u00020\u000f2\u0006\u0010C\u001a\u00020\u000fH\u0002J\b\u0010D\u001a\u000201H\u0002J\u0010\u0010E\u001a\u0002012\u0006\u0010#\u001a\u00020$H\u0002J\b\u0010F\u001a\u000201H\u0002J\b\u0010G\u001a\u000201H\u0002R\u001b\u0010\u0003\u001a\u00020\u00048BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0007\u0010\b\u001a\u0004\b\u0005\u0010\u0006R\u000e\u0010\t\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010\u0010\u001a\u00020\u00118BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\u0014\u0010\b\u001a\u0004\b\u0012\u0010\u0013R\u000e\u0010\u0015\u001a\u00020\u0016X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0017\u001a\u00020\u0018X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u0019\u001a\u00020\u001aX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u001b\u001a\u00020\u001cX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u001d\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u001b\u0010\u001e\u001a\u00020\u001f8BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b\"\u0010\b\u001a\u0004\b \u0010!R\u000e\u0010#\u001a\u00020$X\u0082.¢\u0006\u0002\n\u0000R\u001f\u0010%\u001a\u00060&R\u00020\u00008BX\u0082\u0084\u0002¢\u0006\f\n\u0004\b)\u0010\b\u001a\u0004\b'\u0010(R\u000e\u0010*\u001a\u00020+X\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010,\u001a\u00020\nX\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010-\u001a\b\u0012\u0004\u0012\u00020/0.X\u0082.¢\u0006\u0002\n\u0000¨\u0006L"}, d2 = {"Lcn/luckxy/vod/ui/play/VideoDetailFragment;", "Lcom/github/StormWyrm/wanandroid/base/fragment/BaseFragment;", "()V", "commentAdapter", "Lcn/luckxy/vod/ui/play/VideoDetailFragment$CommentAdapter;", "getCommentAdapter", "()Lcn/luckxy/vod/ui/play/VideoDetailFragment$CommentAdapter;", "commentAdapter$delegate", "Lkotlin/Lazy;", "curCommentPage", "", "curSameActorPage", "curSameTypePage", "curType", "down_url", "", "headerView", "Landroid/view/View;", "getHeaderView", "()Landroid/view/View;", "headerView$delegate", "isCollected", "", "mBannerLayout", "Landroid/widget/FrameLayout;", "mVodBean", "Lcn/luckxy/vod/bean/VodBean;", "playActivity", "Lcn/luckxy/vod/ui/play/NewPlayActivity;", "playSourceIndex", "recommendAdapter", "Lcn/luckxy/vod/ui/play/VideoDetailFragment$RecommendAdapter;", "getRecommendAdapter", "()Lcn/luckxy/vod/ui/play/VideoDetailFragment$RecommendAdapter;", "recommendAdapter$delegate", "rvLastest", "Landroidx/recyclerview/widget/RecyclerView;", "selectionAdapter", "Lcn/luckxy/vod/ui/play/VideoDetailFragment$SelectionAdapter;", "getSelectionAdapter", "()Lcn/luckxy/vod/ui/play/VideoDetailFragment$SelectionAdapter;", "selectionAdapter$delegate", "tlPlaySource", "Lcom/google/android/material/tabs/TabLayout;", VideoDetailFragment.G, "vod_play_list", "", "Lcn/luckxy/vod/bean/PlayFromBean;", "banner", "", "changeCurIndex", "changePlaysource", "collection", "commitComment", "commentContent", "getCollectionState", "getCommentList", "isFresh", "getLayoutId", "getSameActorData", "getSameTypeData", "initHeaderMsg", "initListener", "initView", "onResume", "replayComment", "commentId", "commentPid", "score", "scrollCurIndex", "startCache", "uncollection", "CommentAdapter", "Companion", "RecommendAdapter", "SelectionAdapter", "app_release"}, k = 1, mv = {1, 1, 15})
public final class VideoDetailFragment extends BaseFragment {

    @NotNull
    public static final String F = "vodBean";

    @NotNull
    public static final String G = "urlIndex";

    @NotNull
    public static final String H = "playInfoIndex";
    public RecyclerView A;
    public TabLayout B;
    public NewPlayActivity C;
    public HashMap D;

    public VodBean f3449l;

    public boolean f3450m;

    public int f3451n;

    public int f3453p;

    public List<? extends PlayFromBean> f3455r;

    public int f3456s;
    public FrameLayout v;
    public static final KProperty[] E = {h1.a(new c1(h1.b(VideoDetailFragment.class), "recommendAdapter", "getRecommendAdapter()Lcn/luckxy/vod/ui/play/VideoDetailFragment$RecommendAdapter;")), h1.a(new c1(h1.b(VideoDetailFragment.class), "commentAdapter", "getCommentAdapter()Lcn/luckxy/vod/ui/play/VideoDetailFragment$CommentAdapter;")), h1.a(new c1(h1.b(VideoDetailFragment.class), "selectionAdapter", "getSelectionAdapter()Lcn/luckxy/vod/ui/play/VideoDetailFragment$SelectionAdapter;")), h1.a(new c1(h1.b(VideoDetailFragment.class), "headerView", "getHeaderView()Landroid/view/View;"))};
    public static final b I = new b(null);

    public String f3452o = "";

    public int f3454q = 1;
    public int t = 1;
    public int u = 1;
    public final kotlin.k w = kotlin.n.a(new b0());
    public final kotlin.k x = kotlin.n.a(g.a);
    public final kotlin.k y = kotlin.n.a(new e0());
    public final kotlin.k z = kotlin.n.a(new m());

    public static final class a extends BaseQuickAdapter<CommentBean, BaseViewHolder> {
        public a() {
            super(R.layout.item_hot_comment);
        }

        @Override
        public void convert(@NotNull BaseViewHolder baseViewHolder, @Nullable CommentBean commentBean) {
            kotlin.v1.internal.i0.f(baseViewHolder, HelperUtils.TAG);
            if (commentBean != null) {
                baseViewHolder.setText(R.id.tvUser, commentBean.f());
                baseViewHolder.setText(R.id.tvTime, TimeUtils.millis2String(commentBean.l() * 1000));
                baseViewHolder.setText(R.id.tvComment, commentBean.a());
                ImageView imageView = (ImageView) baseViewHolder.getView(R.id.ivAvatar);
                String q2 = commentBean.q();
                kotlin.v1.internal.i0.a((Object) q2, "user_portrait");
                if (q2.length() > 0) {
                    h.a.a.c.a(baseViewHolder.convertView).load("https://cjt521.com/" + commentBean.q()).a((h.a.a.t.a<?>) h.a.a.t.h.c(new h.a.a.p.q.c.l())).a(imageView);
                    return;
                }
                h.a.a.c.a(baseViewHolder.convertView).a(Integer.valueOf(R.drawable.ic_default_avator)).a((h.a.a.t.a<?>) h.a.a.t.h.c(new h.a.a.p.q.c.l())).a(imageView);
            }
        }
    }

    public static final class a0 implements h.m.a.b.f.b {
        public a0() {
        }

        @Override
        public final void a(@NotNull h.m.a.b.b.j jVar) {
            kotlin.v1.internal.i0.f(jVar, "it");
            VideoDetailFragment.this.f3454q++;
            VideoDetailFragment.a(VideoDetailFragment.this, false, 1, null);
        }
    }

    public static final class b {
        public b() {
        }

        @NotNull
        public final VideoDetailFragment a(@NotNull VodBean vodBean, int i2, int i3) {
            kotlin.v1.internal.i0.f(vodBean, "vodBean");
            VideoDetailFragment videoDetailFragment = new VideoDetailFragment();
            Bundle bundle = new Bundle();
            bundle.putParcelable("vodBean", vodBean);
            bundle.putInt(VideoDetailFragment.G, i2);
            bundle.putInt(VideoDetailFragment.H, i3);
            videoDetailFragment.setArguments(bundle);
            return videoDetailFragment;
        }

        public b(kotlin.v1.internal.v vVar) {
            this();
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\b\n\u0000\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "Lcn/luckxy/vod/ui/play/VideoDetailFragment$RecommendAdapter;", "invoke"}, k = 3, mv = {1, 1, 15})
    public static final class b0 extends j0 implements kotlin.v1.c.a<c> {

        public static final class a implements BaseQuickAdapter.OnItemClickListener {
            public a() {
            }

            @Override
            public final void onItemClick(BaseQuickAdapter<Object, BaseViewHolder> baseQuickAdapter, View view, int i2) {
                Object item = baseQuickAdapter.getItem(i2);
                if (item != null) {
                    VideoDetailFragment.i(VideoDetailFragment.this).a((VodBean) item);
                    return;
                }
                throw new n0("null cannot be cast to non-null type cn.luckxy.vod.bean.VodBean");
            }
        }

        public b0() {
            super(0);
        }

        @Override
        @NotNull
        public final c i() {
            c cVar = new c();
            cVar.setOnItemClickListener(new a());
            return cVar;
        }
    }

    public static final class c extends BaseQuickAdapter<VodBean, BaseViewHolder> {
        public c() {
            super(R.layout.item_card_child);
        }

        @Override
        public void convert(@NotNull BaseViewHolder baseViewHolder, @NotNull VodBean vodBean) {
            kotlin.v1.internal.i0.f(baseViewHolder, HelperUtils.TAG);
            kotlin.v1.internal.i0.f(vodBean, "item");
            baseViewHolder.setVisible(R.id.item_tv_card_child_tip, false);
            baseViewHolder.setText(R.id.item_tv_card_child_title, vodBean.L());
            baseViewHolder.setText(R.id.item_tv_card_child_up_title, vodBean.R());
            String d0 = vodBean.d0();
            ImageView imageView = (ImageView) baseViewHolder.getView(R.id.item_iv_card_child_icon);
            kotlin.v1.internal.i0.a((Object) imageView, "icon");
            ViewGroup.LayoutParams layoutParams = imageView.getLayoutParams();
            g.a.b.utils.f fVar = g.a.b.utils.f.a;
            Context context = LitePalApplication.getContext();
            kotlin.v1.internal.i0.a((Object) context, "LitePalApplication.getContext()");
            int b = fVar.b(context);
            g.a.b.utils.f fVar2 = g.a.b.utils.f.a;
            kotlin.v1.internal.i0.a((Object) LitePalApplication.getContext(), "LitePalApplication.getContext()");
            layoutParams.height = (int) (((b - fVar2.a(r5, 4.0f)) / 3) * 1.4f);
            imageView.setLayoutParams(layoutParams);
            View view = baseViewHolder.itemView;
            kotlin.v1.internal.i0.a((Object) view, "helper.itemView");
            h.a.a.c.f(view.getContext()).load(d0).b(0.1f).a(h.a.a.p.o.j.a).a(imageView);
        }
    }

    public static final class c0 extends h.e.a.a.a.b.d.a<String> {
        public c0() {
            super(false, 1, null);
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            kotlin.v1.internal.i0.f(dVar, "e");
        }

        @Override
        public void a(@NotNull String str) {
            kotlin.v1.internal.i0.f(str, "data");
        }
    }

    public final class d extends BaseQuickAdapter<UrlBean, BaseViewHolder> {
        public d() {
            super(R.layout.item_video_source);
        }

        @Override
        public void convert(@NotNull BaseViewHolder baseViewHolder, @NotNull UrlBean urlBean) {
            kotlin.v1.internal.i0.f(baseViewHolder, HelperUtils.TAG);
            kotlin.v1.internal.i0.f(urlBean, "item");
            if (VideoDetailFragment.h(VideoDetailFragment.this).g() == 3) {
                View view = baseViewHolder.itemView;
                kotlin.v1.internal.i0.a((Object) view, "helper.itemView");
                View view2 = baseViewHolder.itemView;
                kotlin.v1.internal.i0.a((Object) view2, "helper.itemView");
                ViewGroup.LayoutParams layoutParams = view2.getLayoutParams();
                layoutParams.width = ConvertUtils.dp2px(130.0f);
                layoutParams.height = ConvertUtils.dp2px(50.0f);
                view.setLayoutParams(layoutParams);
            } else {
                View view3 = baseViewHolder.itemView;
                kotlin.v1.internal.i0.a((Object) view3, "helper.itemView");
                View view4 = baseViewHolder.itemView;
                kotlin.v1.internal.i0.a((Object) view4, "helper.itemView");
                ViewGroup.LayoutParams layoutParams2 = view4.getLayoutParams();
                layoutParams2.width = ConvertUtils.dp2px(50.0f);
                layoutParams2.height = ConvertUtils.dp2px(50.0f);
                view3.setLayoutParams(layoutParams2);
            }
            if (baseViewHolder.getLayoutPosition() == VideoDetailFragment.this.f3451n) {
                baseViewHolder.setTextColor(R.id.f21249tv, ColorUtils.getColor(R.color.userTopBg));
            } else {
                baseViewHolder.setTextColor(R.id.f21249tv, ColorUtils.getColor(R.color.gray_999));
            }
            String b = urlBean.b();
            kotlin.v1.internal.i0.a((Object) b, "item.name");
            baseViewHolder.setText(R.id.f21249tv, kotlin.text.b0.a(kotlin.text.b0.a(b, "第", "", false, 4, (Object) null), "集", "", false, 4, (Object) null));
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001d\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0007\n\u0000*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0018\u0010\u0002\u001a\u00020\u00032\u0006\u0010\u0004\u001a\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u0007H\u0016¨\u0006\b"}, d2 = {"cn/luckxy/vod/ui/play/VideoDetailFragment$score$1", "Lcn/luckxy/vod/ui/play/ScoreDialog$OnScoreSubmitClickListener;", "onScoreSubmit", "", "scoreDialog", "Lcn/luckxy/vod/ui/play/ScoreDialog;", "score", "", "app_release"}, k = 1, mv = {1, 1, 15})
    public static final class d0 implements ScoreDialog.a {

        public static final class a extends h.e.a.a.a.b.d.a<GetScoreBean> {
            public a() {
                super(false, 1, null);
            }

            @Override
            public void a(@NotNull h.e.a.a.a.exception.d dVar) {
                kotlin.v1.internal.i0.f(dVar, "e");
            }

            @Override
            public void a(@NotNull GetScoreBean getScoreBean) {
                kotlin.v1.internal.i0.f(getScoreBean, "data");
                if (!kotlin.v1.internal.i0.a((Object) getScoreBean.a(), (Object) "0")) {
                    ToastUtils.showShort("评分成功,获得" + getScoreBean.a() + "积分", new Object[0]);
                }
            }
        }

        public d0() {
        }

        @Override
        public void a(@NotNull ScoreDialog scoreDialog, float f2) {
            kotlin.v1.internal.i0.f(scoreDialog, "scoreDialog");
            if (f2 == 0.0f) {
                ToastUtils.showShort("评分不能为空!", new Object[0]);
                return;
            }
            scoreDialog.dismiss();
            VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
            if (g.a.b.utils.a.a(vodService)) {
                return;
            }
            VideoDetailFragment videoDetailFragment = VideoDetailFragment.this;
            h.e.a.a.a.b.a.a(videoDetailFragment, vodService.f(String.valueOf(VideoDetailFragment.h(videoDetailFragment).U()), String.valueOf(f2)), new a());
        }
    }

    public static final class e implements s.a.a.m {
        @Override
        public void a() {
            Log.e("fumiad", "onAdClick");
        }

        @Override
        public void onAdClose() {
            Log.e("fumiad", "onAdClose");
        }

        @Override
        public void onAdShow() {
            Log.e("fumiad", "onAdShow");
        }

        @Override
        public void onError(@NotNull String str) {
            kotlin.v1.internal.i0.f(str, com.umeng.commonsdk.proguard.e.ap);
            Log.e("fumiad", "onError:" + str);
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\f\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\u0010\u0000\u001a\u00060\u0001R\u00020\u0002H\n¢\u0006\u0002\b\u0003"}, d2 = {"<anonymous>", "Lcn/luckxy/vod/ui/play/VideoDetailFragment$SelectionAdapter;", "Lcn/luckxy/vod/ui/play/VideoDetailFragment;", "invoke"}, k = 3, mv = {1, 1, 15})
    public static final class e0 extends j0 implements kotlin.v1.c.a<d> {

        public static final class a implements BaseQuickAdapter.OnItemClickListener {
            public final d a;
            public final e0 b;

            public a(d dVar, e0 e0Var) {
                this.a = dVar;
                this.b = e0Var;
            }

            @Override
            public final void onItemClick(BaseQuickAdapter<Object, BaseViewHolder> baseQuickAdapter, View view, int i2) {
                if (VideoDetailFragment.this.f3451n != i2) {
                    VideoDetailFragment.this.f3451n = i2;
                    VideoDetailFragment.i(VideoDetailFragment.this).b(i2);
                    this.a.notifyDataSetChanged();
                }
            }
        }

        public e0() {
            super(0);
        }

        @Override
        @NotNull
        public final d i() {
            d dVar = new d();
            dVar.setOnItemClickListener(new a(dVar, this));
            return dVar;
        }
    }

    public static final class f extends h.e.a.a.a.b.d.a<String> {
        public f() {
            super(false, 1, null);
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            kotlin.v1.internal.i0.f(dVar, "e");
        }

        @Override
        public void a(@NotNull String str) {
            kotlin.v1.internal.i0.f(str, "data");
            ToastUtils.showShort("已收藏", new Object[0]);
            Drawable drawable = VideoDetailFragment.this.d().getDrawable(R.drawable.ic_collected);
            VideoDetailFragment.this.f3450m = true;
            if (drawable != null) {
                drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
            }
            TextView textView = (TextView) VideoDetailFragment.this.q().findViewById(R.id.item_tv_playinfo_collect);
            textView.setCompoundDrawables(null, drawable, null, null);
            textView.setText("已收藏");
        }
    }

    public static final class f0 implements View.OnClickListener {
        public final BottomSheetDialog b;

        public f0(BottomSheetDialog bottomSheetDialog) {
            this.b = bottomSheetDialog;
        }

        @Override
        public final void onClick(View view) {
            FragmentActivity activity = VideoDetailFragment.this.getActivity();
            if (activity != null) {
                AllDownloadActivity.a aVar = AllDownloadActivity.f3227j;
                kotlin.v1.internal.i0.a((Object) activity, "it1");
                aVar.a(activity);
            }
            BottomSheetDialog bottomSheetDialog = this.b;
            if (bottomSheetDialog != null) {
                bottomSheetDialog.dismiss();
            }
        }
    }

    public static final class g extends j0 implements kotlin.v1.c.a<a> {
        public static final g a = new g();

        public g() {
            super(0);
        }

        @Override
        @NotNull
        public final a i() {
            a aVar = new a();
            aVar.setHeaderAndEmpty(true);
            return aVar;
        }
    }

    public static final class g0 implements View.OnClickListener {
        public final BottomSheetDialog a;

        public g0(BottomSheetDialog bottomSheetDialog) {
            this.a = bottomSheetDialog;
        }

        @Override
        public final void onClick(View view) {
            BottomSheetDialog bottomSheetDialog = this.a;
            if (bottomSheetDialog != null) {
                bottomSheetDialog.dismiss();
            }
        }
    }

    public static final class h extends h.e.a.a.a.b.d.a<GetScoreBean> {
        public h() {
            super(false, 1, null);
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            kotlin.v1.internal.i0.f(dVar, "e");
        }

        @Override
        public void a(@NotNull GetScoreBean getScoreBean) {
            kotlin.v1.internal.i0.f(getScoreBean, "data");
            if (kotlin.v1.internal.i0.a((Object) getScoreBean.a(), (Object) "0")) {
                ToastUtils.showShort("评论成功", new Object[0]);
            } else {
                ToastUtils.showShort("评论成功,获得" + getScoreBean.a() + "积分", new Object[0]);
            }
            VideoDetailFragment.this.f3454q = 1;
            VideoDetailFragment.this.c(true);
        }
    }

    public static final class h0 implements View.OnClickListener {
        public final List b;

        public final int f3459c;

        public h0(List list, int i2) {
            this.b = list;
            this.f3459c = i2;
        }

        @Override
        public final void onClick(View view) {
            StringBuilder sb = new StringBuilder();
            sb.append(VideoDetailFragment.h(VideoDetailFragment.this).L());
            sb.append('\t');
            Object obj = this.b.get(this.f3459c);
            kotlin.v1.internal.i0.a(obj, "urls[downIndex]");
            sb.append(((UrlBean) obj).b());
            String sb2 = sb.toString();
            Object obj2 = this.b.get(this.f3459c);
            kotlin.v1.internal.i0.a(obj2, "urls[downIndex]");
            String d2 = ((UrlBean) obj2).d();
            kotlin.v1.internal.i0.a((Object) d2, "urls[downIndex].url");
            if (!kotlin.text.c0.c((CharSequence) d2, (CharSequence) PictureFileUtils.POST_VIDEO, false, 2, (Object) null)) {
                Object obj3 = this.b.get(this.f3459c);
                kotlin.v1.internal.i0.a(obj3, "urls[downIndex]");
                String d3 = ((UrlBean) obj3).d();
                kotlin.v1.internal.i0.a((Object) d3, "urls[downIndex].url");
                if (!kotlin.text.c0.c((CharSequence) d3, (CharSequence) ".m3u8", false, 2, (Object) null)) {
                    Object obj4 = this.b.get(this.f3459c);
                    kotlin.v1.internal.i0.a(obj4, "urls[downIndex]");
                    String d4 = ((UrlBean) obj4).d();
                    kotlin.v1.internal.i0.a((Object) d4, "urls[downIndex].url");
                    if (!kotlin.text.c0.c((CharSequence) d4, (CharSequence) "/m3u8?", false, 2, (Object) null)) {
                        Object obj5 = this.b.get(this.f3459c);
                        kotlin.v1.internal.i0.a(obj5, "urls[downIndex]");
                        String d5 = ((UrlBean) obj5).d();
                        kotlin.v1.internal.i0.a((Object) d5, "urls[downIndex].url");
                        if (!kotlin.text.c0.c((CharSequence) d5, (CharSequence) ".flv", false, 2, (Object) null)) {
                            Object obj6 = this.b.get(this.f3459c);
                            kotlin.v1.internal.i0.a(obj6, "urls[downIndex]");
                            ((UrlBean) obj6).c(new Regex("\\s").a(VideoDetailFragment.i(VideoDetailFragment.this).getF3398j(), ""));
                        }
                    }
                }
            }
            Object obj7 = this.b.get(this.f3459c);
            kotlin.v1.internal.i0.a(obj7, "urls[downIndex]");
            String d6 = ((UrlBean) obj7).d();
            kotlin.v1.internal.i0.a((Object) d6, "urls[downIndex].url");
            if (!(d6.length() > 0)) {
                Object obj8 = this.b.get(this.f3459c);
                kotlin.v1.internal.i0.a(obj8, "urls[downIndex]");
                String d7 = ((UrlBean) obj8).d();
                kotlin.v1.internal.i0.a((Object) d7, "urls[downIndex].url");
                if (!kotlin.text.c0.c((CharSequence) d7, (CharSequence) PictureFileUtils.POST_VIDEO, false, 2, (Object) null)) {
                    Object obj9 = this.b.get(this.f3459c);
                    kotlin.v1.internal.i0.a(obj9, "urls[downIndex]");
                    String d8 = ((UrlBean) obj9).d();
                    kotlin.v1.internal.i0.a((Object) d8, "urls[downIndex].url");
                    if (!kotlin.text.c0.c((CharSequence) d8, (CharSequence) ".m3u8", false, 2, (Object) null)) {
                        Object obj10 = this.b.get(this.f3459c);
                        kotlin.v1.internal.i0.a(obj10, "urls[downIndex]");
                        String d9 = ((UrlBean) obj10).d();
                        kotlin.v1.internal.i0.a((Object) d9, "urls[downIndex].url");
                        if (!kotlin.text.c0.c((CharSequence) d9, (CharSequence) "/m3u8?", false, 2, (Object) null)) {
                            Object obj11 = this.b.get(this.f3459c);
                            kotlin.v1.internal.i0.a(obj11, "urls[downIndex]");
                            String d10 = ((UrlBean) obj11).d();
                            kotlin.v1.internal.i0.a((Object) d10, "urls[downIndex].url");
                            if (!kotlin.text.c0.c((CharSequence) d10, (CharSequence) ".flv", false, 2, (Object) null)) {
                                Toast.makeText(VideoDetailFragment.this.getActivity(), "请正常播放后再点击下载", 0).show();
                                return;
                            }
                        }
                    }
                }
            }
            Toast.makeText(VideoDetailFragment.this.getActivity(), "开始缓存第" + (this.f3459c + 1) + (char) 38598, 0).show();
            FragmentActivity activity = VideoDetailFragment.this.getActivity();
            Object obj12 = this.b.get(this.f3459c);
            kotlin.v1.internal.i0.a(obj12, "urls[downIndex]");
            k.a.a.v.a.a(activity, ((UrlBean) obj12).d(), sb2, VideoDetailFragment.h(VideoDetailFragment.this).d0());
            StringBuilder sb3 = new StringBuilder();
            sb3.append("");
            Object obj13 = this.b.get(this.f3459c);
            kotlin.v1.internal.i0.a(obj13, "urls[downIndex]");
            sb3.append(((UrlBean) obj13).d());
            Log.d("down11111", sb3.toString());
        }
    }

    public static final class i extends h.e.a.a.a.b.d.a<Page<CollectionBean>> {
        public i() {
            super(false, 1, null);
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            kotlin.v1.internal.i0.f(dVar, "e");
        }

        @Override
        public void a(@NotNull Page<CollectionBean> page) {
            kotlin.v1.internal.i0.f(page, "data");
            Iterator<CollectionBean> it = page.b().iterator();
            while (true) {
                if (!it.hasNext()) {
                    break;
                }
                CollectionBean next = it.next();
                kotlin.v1.internal.i0.a((Object) next, "bean");
                CollectionBean.DataBean a = next.a();
                kotlin.v1.internal.i0.a((Object) a, "bean.data");
                if (a.a() == VideoDetailFragment.h(VideoDetailFragment.this).U()) {
                    VideoDetailFragment.this.f3450m = true;
                    break;
                }
            }
            if (VideoDetailFragment.this.f3450m) {
                Drawable drawable = VideoDetailFragment.this.d().getDrawable(R.drawable.ic_collected);
                if (drawable != null) {
                    drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
                }
                TextView textView = (TextView) VideoDetailFragment.this.q().findViewById(R.id.item_tv_playinfo_collect);
                textView.setCompoundDrawables(null, drawable, null, null);
                textView.setText("已收藏");
                return;
            }
            Drawable drawable2 = VideoDetailFragment.this.d().getDrawable(R.drawable.ic_collection);
            if (drawable2 != null) {
                drawable2.setBounds(0, 0, drawable2.getMinimumWidth(), drawable2.getMinimumHeight());
            }
            TextView textView2 = (TextView) VideoDetailFragment.this.q().findViewById(R.id.item_tv_playinfo_collect);
            textView2.setCompoundDrawables(null, drawable2, null, null);
            textView2.setText("收藏");
        }
    }

    public static final class i0 extends h.e.a.a.a.b.d.a<String> {
        public i0() {
            super(false, 1, null);
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            kotlin.v1.internal.i0.f(dVar, "e");
        }

        @Override
        public void a(@NotNull String str) {
            kotlin.v1.internal.i0.f(str, "data");
            ToastUtils.showShort("取消成功", new Object[0]);
            VideoDetailFragment.this.f3450m = false;
            Drawable drawable = VideoDetailFragment.this.d().getDrawable(R.drawable.ic_collection);
            if (drawable != null) {
                drawable.setBounds(0, 0, drawable.getMinimumWidth(), drawable.getMinimumHeight());
            }
            TextView textView = (TextView) VideoDetailFragment.this.q().findViewById(R.id.item_tv_playinfo_collect);
            textView.setCompoundDrawables(null, drawable, null, null);
            textView.setText("收藏");
        }
    }

    public static final class j extends h.e.a.a.a.b.d.a<Page<CommentBean>> {

        public final boolean f3463d;

        public j(boolean z) {
            super(false, 1, null);
            this.f3463d = z;
        }

        @Override
        public void a(@NotNull Page<CommentBean> page) {
            kotlin.v1.internal.i0.f(page, "data");
            if (VideoDetailFragment.this.f3454q == 1) {
                if (this.f3463d) {
                    VideoDetailFragment.this.p().setNewData(page.b());
                } else {
                    VideoDetailFragment.this.p().addData((Collection) page.b());
                }
            }
            if (VideoDetailFragment.this.f3454q > 1) {
                VideoDetailFragment.this.p().addData((Collection) page.b());
                if (((SmartRefreshLayout) VideoDetailFragment.this.a(cn.luckxy.vod.R.id.refreshLayout)) != null) {
                    if (page.b().isEmpty()) {
                        ((SmartRefreshLayout) VideoDetailFragment.this.a(cn.luckxy.vod.R.id.refreshLayout)).d();
                    } else {
                        ((SmartRefreshLayout) VideoDetailFragment.this.a(cn.luckxy.vod.R.id.refreshLayout)).i(true);
                    }
                }
            }
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            kotlin.v1.internal.i0.f(dVar, "e");
            if (VideoDetailFragment.this.f3454q <= 1 || ((SmartRefreshLayout) VideoDetailFragment.this.a(cn.luckxy.vod.R.id.refreshLayout)) == null) {
                return;
            }
            ((SmartRefreshLayout) VideoDetailFragment.this.a(cn.luckxy.vod.R.id.refreshLayout)).i(false);
        }
    }

    public static final class k extends h.e.a.a.a.b.d.a<Page<VodBean>> {
        public k() {
            super(false, 1, null);
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            kotlin.v1.internal.i0.f(dVar, "e");
        }

        @Override
        public void a(@NotNull Page<VodBean> page) {
            kotlin.v1.internal.i0.f(page, "data");
            kotlin.v1.internal.i0.a((Object) page.b(), "data.list");
            if (!r0.isEmpty()) {
                VideoDetailFragment.this.r().setNewData(page.b());
                VideoDetailFragment.this.u++;
            }
        }
    }

    public static final class l extends h.e.a.a.a.b.d.a<Page<VodBean>> {
        public l() {
            super(false, 1, null);
        }

        @Override
        public void a(@NotNull h.e.a.a.a.exception.d dVar) {
            kotlin.v1.internal.i0.f(dVar, "e");
        }

        @Override
        public void a(@NotNull Page<VodBean> page) {
            kotlin.v1.internal.i0.f(page, "data");
            kotlin.v1.internal.i0.a((Object) page.b(), "data.list");
            if (!r0.isEmpty()) {
                VideoDetailFragment.this.t++;
                VideoDetailFragment.this.r().setNewData(page.b());
            }
        }
    }

    public static final class m extends j0 implements kotlin.v1.c.a<View> {
        public m() {
            super(0);
        }

        @Override
        public final View i() {
            return View.inflate(VideoDetailFragment.this.d(), R.layout.layout_video_detail, null);
        }
    }

    public static final class n extends GridLayoutManager.SpanSizeLookup {
        @Override
        public int getSpanSize(int i2) {
            return 3;
        }
    }

    public static final class o implements View.OnClickListener {
        public o() {
        }

        @Override
        public final void onClick(View view) {
            int i2 = VideoDetailFragment.this.f3456s;
            if (i2 == 0) {
                VideoDetailFragment.this.t();
            } else {
                if (i2 != 1) {
                    return;
                }
                VideoDetailFragment.this.s();
            }
        }
    }

    public static final class p implements View.OnClickListener {
        public final TextView b;

        public final TextView f3466c;

        public p(TextView textView, TextView textView2) {
            this.b = textView;
            this.f3466c = textView2;
        }

        @Override
        public final void onClick(View view) {
            if (VideoDetailFragment.this.f3456s != 0) {
                VideoDetailFragment.this.f3456s = 0;
                this.b.setTextColor(ColorUtils.getColor(R.color.colorPrimary));
                this.f3466c.setTextColor(ColorUtils.getColor(R.color.gray_999));
                VideoDetailFragment.this.t();
            }
        }
    }

    public static final class q implements View.OnClickListener {
        public final TextView b;

        public final TextView f3467c;

        public q(TextView textView, TextView textView2) {
            this.b = textView;
            this.f3467c = textView2;
        }

        @Override
        public final void onClick(View view) {
            if (VideoDetailFragment.this.f3456s != 1) {
                VideoDetailFragment.this.f3456s = 1;
                this.b.setTextColor(ColorUtils.getColor(R.color.gray_999));
                this.f3467c.setTextColor(ColorUtils.getColor(R.color.colorPrimary));
                VideoDetailFragment.this.s();
            }
        }
    }

    @Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0000\u001a\u00020\u00012\u000e\u0010\u0002\u001a\n \u0004*\u0004\u0018\u00010\u00030\u0003H\n¢\u0006\u0002\b\u0005"}, d2 = {"<anonymous>", "", "it", "Landroid/view/View;", "kotlin.jvm.PlatformType", "onClick"}, k = 3, mv = {1, 1, 15})
    public static final class r implements View.OnClickListener {

        public static final class a implements CommentDialog.a {
            public a() {
            }

            @Override
            public void a(@NotNull String str) {
                kotlin.v1.internal.i0.f(str, "comment");
                VideoDetailFragment.this.a(str);
            }
        }

        public r() {
        }

        @Override
        public final void onClick(View view) {
            if (UserUtils.d()) {
                new CommentDialog(VideoDetailFragment.this.d()).a(new a()).show();
            } else {
                LoginActivity.f3338o.a();
            }
        }
    }

    public static final class s implements View.OnClickListener {
        public s() {
        }

        @Override
        public final void onClick(View view) {
            VideoDetailFragment.this.w();
        }
    }

    public static final class t implements View.OnClickListener {
        public t() {
        }

        @Override
        public final void onClick(View view) {
            if (UserUtils.d()) {
                if (VideoDetailFragment.this.f3450m) {
                    VideoDetailFragment.this.y();
                    return;
                } else {
                    VideoDetailFragment.this.n();
                    return;
                }
            }
            ActivityUtils.startActivity((Class<? extends Activity>) LoginActivity.class);
        }
    }

    public static final class u implements View.OnClickListener {
        public u() {
        }

        @Override
        public final void onClick(View view) {
            if (VideoDetailFragment.i(VideoDetailFragment.this).getF3399k()) {
                VideoDetailFragment.this.x();
            } else {
                ToastUtils.showShort("暂无观影次数请邀请好友或升级会员!", new Object[0]);
            }
        }
    }

    public static final class v implements View.OnClickListener {
        public static final v a = new v();

        @Override
        public final void onClick(View view) {
            ActivityUtils.startActivity((Class<? extends Activity>) FeedbackActivity.class);
        }
    }

    public static final class w implements View.OnClickListener {
        public static final w a = new w();

        @Override
        public final void onClick(View view) {
            ShareActivity.f3599i.a();
        }
    }

    public static final class x implements View.OnClickListener {
        public x() {
        }

        @Override
        public final void onClick(View view) {
            VideoDetailFragment.i(VideoDetailFragment.this).n();
        }
    }

    public static final class y implements View.OnClickListener {
        public y() {
        }

        @Override
        public final void onClick(View view) {
            VideoDetailFragment.i(VideoDetailFragment.this).o();
        }
    }

    public static final class z implements TabLayout.d {
        public z() {
        }

        @Override
        public void a(@Nullable TabLayout.g gVar) {
            Log.d("", "");
        }

        @Override
        public void b(@Nullable TabLayout.g gVar) {
            PlayFromBean playFromBean = (PlayFromBean) VideoDetailFragment.p(VideoDetailFragment.this).get(VideoDetailFragment.n(VideoDetailFragment.this).getSelectedTabPosition());
            VideoDetailFragment.this.u().setNewData(playFromBean.i());
            VideoDetailFragment.i(VideoDetailFragment.this).a(playFromBean, VideoDetailFragment.n(VideoDetailFragment.this).getSelectedTabPosition());
        }

        @Override
        public void c(@Nullable TabLayout.g gVar) {
            Log.d("", "");
        }
    }

    public static final VodBean h(VideoDetailFragment videoDetailFragment) {
        VodBean vodBean = videoDetailFragment.f3449l;
        if (vodBean == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        return vodBean;
    }

    public static final NewPlayActivity i(VideoDetailFragment videoDetailFragment) {
        NewPlayActivity newPlayActivity = videoDetailFragment.C;
        if (newPlayActivity == null) {
            kotlin.v1.internal.i0.k("playActivity");
        }
        return newPlayActivity;
    }

    public static final TabLayout n(VideoDetailFragment videoDetailFragment) {
        TabLayout tabLayout = videoDetailFragment.B;
        if (tabLayout == null) {
            kotlin.v1.internal.i0.k("tlPlaySource");
        }
        return tabLayout;
    }

    public final a p() {
        kotlin.k kVar = this.x;
        KProperty kProperty = E[1];
        return (a) kVar.getValue();
    }

    public static final List p(VideoDetailFragment videoDetailFragment) {
        List<? extends PlayFromBean> list = videoDetailFragment.f3455r;
        if (list == null) {
            kotlin.v1.internal.i0.k("vod_play_list");
        }
        return list;
    }

    public final View q() {
        kotlin.k kVar = this.z;
        KProperty kProperty = E[3];
        return (View) kVar.getValue();
    }

    public final c r() {
        kotlin.k kVar = this.w;
        KProperty kProperty = E[0];
        return (c) kVar.getValue();
    }

    public final d u() {
        kotlin.k kVar = this.y;
        KProperty kProperty = E[2];
        return (d) kVar.getValue();
    }

    @SuppressLint({"SetTextI18n"})
    private final void v() {
        StartBean.Ads a2;
        TextView textView = (TextView) q().findViewById(R.id.item_tv_playinfo_title);
        TextView textView2 = (TextView) q().findViewById(R.id.item_tv_playinfo_intro);
        TextView textView3 = (TextView) q().findViewById(R.id.item_tv_playinfo_hits);
        TextView textView4 = (TextView) q().findViewById(R.id.item_tv_playinfo_score);
        TextView textView5 = (TextView) q().findViewById(R.id.tvLastest);
        ImageView imageView = (ImageView) q().findViewById(R.id.iv_lastest);
        TextView textView6 = (TextView) q().findViewById(R.id.item_svv_playinfo);
        View findViewById = q().findViewById(R.id.tlPlaySource);
        kotlin.v1.internal.i0.a((Object) findViewById, "headerView.findViewById(R.id.tlPlaySource)");
        this.B = (TabLayout) findViewById;
        View findViewById2 = q().findViewById(R.id.rvLastest);
        kotlin.v1.internal.i0.a((Object) findViewById2, "headerView.findViewById(R.id.rvLastest)");
        this.A = (RecyclerView) findViewById2;
        TextView textView7 = (TextView) q().findViewById(R.id.item_tv_playinfo_comment);
        AdWebView adWebView = (AdWebView) q().findViewById(R.id.awvPlayerDown);
        StartBean startBean = App.f3140f;
        StartBean.Ad c2 = (startBean == null || (a2 = startBean.a()) == null) ? null : a2.c();
        if (c2 != null && c2.d() != 0) {
            String a3 = c2.a();
            if (!(a3 == null || a3.length() == 0)) {
                kotlin.v1.internal.i0.a((Object) adWebView, "awvPlayerDown");
                adWebView.setVisibility(0);
                adWebView.a(c2.a());
            }
        } else {
            kotlin.v1.internal.i0.a((Object) adWebView, "awvPlayerDown");
            adWebView.setVisibility(8);
        }
        ((TextView) q().findViewById(R.id.item_tv_playinfo_grade)).setOnClickListener(new s());
        ((TextView) q().findViewById(R.id.item_tv_playinfo_collect)).setOnClickListener(new t());
        ((TextView) q().findViewById(R.id.item_tv_playinfo_download)).setOnClickListener(new u());
        ((TextView) q().findViewById(R.id.item_tv_playinfo_feedback)).setOnClickListener(v.a);
        ((TextView) q().findViewById(R.id.item_tv_playinfo_share)).setOnClickListener(w.a);
        textView5.setOnClickListener(new x());
        kotlin.v1.internal.i0.a((Object) textView7, "itemTvPlayinfoComment");
        StringBuilder sb = new StringBuilder();
        VodBean vodBean = this.f3449l;
        if (vodBean == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        sb.append(vodBean.c());
        sb.append(" 评论");
        textView7.setText(sb.toString());
        kotlin.v1.internal.i0.a((Object) textView, NotificationCompatJellybean.f1840d);
        VodBean vodBean2 = this.f3449l;
        if (vodBean2 == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        textView.setText(vodBean2.c0());
        kotlin.v1.internal.i0.a((Object) textView3, "hits");
        StringBuilder sb2 = new StringBuilder();
        sb2.append("播放 ");
        VodBean vodBean3 = this.f3449l;
        if (vodBean3 == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        sb2.append(vodBean3.N());
        sb2.append("次");
        textView3.setText(sb2.toString());
        kotlin.v1.internal.i0.a((Object) textView4, "score");
        StringBuilder sb3 = new StringBuilder();
        VodBean vodBean4 = this.f3449l;
        if (vodBean4 == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        sb3.append(vodBean4.v0());
        sb3.append("分");
        textView4.setText(sb3.toString());
        kotlin.v1.internal.i0.a((Object) textView6, "sortVodView");
        VodBean vodBean5 = this.f3449l;
        if (vodBean5 == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        String n2 = vodBean5.n();
        kotlin.v1.internal.i0.a((Object) n2, "mVodBean.vod_class");
        textView6.setText(kotlin.text.b0.a(n2, h.k.b.c.f13093g, LogUtils.PLACEHOLDER, false, 4, (Object) null));
        textView2.setOnClickListener(new y());
        VodBean vodBean6 = this.f3449l;
        if (vodBean6 == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        String R = vodBean6.R();
        kotlin.v1.internal.i0.a((Object) R, "mVodBean.vodRemarks");
        if (R.length() > 0) {
            kotlin.v1.internal.i0.a((Object) textView5, "tvLastest");
            VodBean vodBean7 = this.f3449l;
            if (vodBean7 == null) {
                kotlin.v1.internal.i0.k("mVodBean");
            }
            textView5.setText(vodBean7.R());
            kotlin.v1.internal.i0.a((Object) imageView, "ivLastest");
            imageView.setVisibility(0);
        } else {
            kotlin.v1.internal.i0.a((Object) imageView, "ivLastest");
            imageView.setVisibility(8);
        }
        VodBean vodBean8 = this.f3449l;
        if (vodBean8 == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        List<PlayFromBean> h02 = vodBean8.h0();
        kotlin.v1.internal.i0.a((Object) h02, "mVodBean.vod_play_list");
        this.f3455r = h02;
        RecyclerView recyclerView = this.A;
        if (recyclerView == null) {
            kotlin.v1.internal.i0.k("rvLastest");
        }
        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(d());
        linearLayoutManager.setOrientation(0);
        kotlin.h1 h1Var = kotlin.h1.a;
        recyclerView.setLayoutManager(linearLayoutManager);
        RecyclerView recyclerView2 = this.A;
        if (recyclerView2 == null) {
            kotlin.v1.internal.i0.k("rvLastest");
        }
        recyclerView2.setAdapter(u());
        if (this.f3455r == null) {
            kotlin.v1.internal.i0.k("vod_play_list");
        }
        if (!r1.isEmpty()) {
            List<? extends PlayFromBean> list = this.f3455r;
            if (list == null) {
                kotlin.v1.internal.i0.k("vod_play_list");
            }
            int size = list.size();
            for (int i2 = 0; i2 < size; i2++) {
                List<? extends PlayFromBean> list2 = this.f3455r;
                if (list2 == null) {
                    kotlin.v1.internal.i0.k("vod_play_list");
                }
                PlayFromBean playFromBean = list2.get(i2);
                PlayerInfoBean c3 = playFromBean.c();
                List<UrlBean> i3 = playFromBean.i();
                kotlin.v1.internal.i0.a((Object) c3, "playerInfo");
                String g2 = c3.g();
                if (StringUtils.isEmpty(g2)) {
                    g2 = "默认";
                }
                if (i2 == this.f3453p) {
                    u().addData((Collection) i3);
                }
                TabLayout tabLayout = this.B;
                if (tabLayout == null) {
                    kotlin.v1.internal.i0.k("tlPlaySource");
                }
                TabLayout.g b2 = tabLayout.f().b(g2);
                kotlin.v1.internal.i0.a((Object) b2, "tlPlaySource.newTab().setText(playSource)");
                TabLayout tabLayout2 = this.B;
                if (tabLayout2 == null) {
                    kotlin.v1.internal.i0.k("tlPlaySource");
                }
                tabLayout2.a(b2);
            }
        }
        TabLayout tabLayout3 = this.B;
        if (tabLayout3 == null) {
            kotlin.v1.internal.i0.k("tlPlaySource");
        }
        tabLayout3.a(new z());
        TabLayout tabLayout4 = this.B;
        if (tabLayout4 == null) {
            kotlin.v1.internal.i0.k("tlPlaySource");
        }
        TabLayout.g b3 = tabLayout4.b(this.f3453p);
        if (b3 != null) {
            b3.i();
            kotlin.h1 h1Var2 = kotlin.h1.a;
        }
        RecyclerView recyclerView3 = this.A;
        if (recyclerView3 == null) {
            kotlin.v1.internal.i0.k("rvLastest");
        }
        a(recyclerView3);
        RecyclerView recyclerView4 = (RecyclerView) q().findViewById(R.id.rvRecommand);
        TextView textView8 = (TextView) q().findViewById(R.id.tvChange);
        TextView textView9 = (TextView) q().findViewById(R.id.tvSameType);
        TextView textView10 = (TextView) q().findViewById(R.id.tvSameActor);
        g.a.b.l.f.e eVar = new g.a.b.l.f.e(d(), 0, false);
        eVar.setDrawable(d().getResources().getDrawable(R.drawable.divider_image));
        recyclerView4.addItemDecoration(eVar);
        kotlin.v1.internal.i0.a((Object) recyclerView4, "rvRecommand");
        GridLayoutManager gridLayoutManager = new GridLayoutManager((Context) d(), 3, 1, false);
        gridLayoutManager.setSpanSizeLookup(new n());
        kotlin.h1 h1Var3 = kotlin.h1.a;
        recyclerView4.setLayoutManager(gridLayoutManager);
        recyclerView4.setAdapter(r());
        textView8.setOnClickListener(new o());
        textView9.setOnClickListener(new p(textView9, textView10));
        textView10.setOnClickListener(new q(textView9, textView10));
        ((LinearLayout) a(cn.luckxy.vod.R.id.rlComment)).setOnClickListener(new r());
        Log.d("hhhh1", "嘿嘿" + u().getData().size());
    }

    public final void w() {
        if (g.a.b.utils.a.a((VodService) g.a.b.utils.j.INSTANCE.a(VodService.class))) {
            return;
        }
        new ScoreDialog(d()).a(new d0()).show();
    }

    public final void x() {
        Window window;
        View findViewById;
        FragmentActivity activity = getActivity();
        BottomSheetDialog bottomSheetDialog = activity != null ? new BottomSheetDialog(activity) : null;
        View inflate = LayoutInflater.from(getActivity()).inflate(R.layout.cache_all_list_layout, (ViewGroup) null);
        kotlin.v1.internal.i0.a((Object) inflate, "LayoutInflater.from(acti…he_all_list_layout, null)");
        if (bottomSheetDialog != null) {
            bottomSheetDialog.setContentView(inflate);
        }
        if (bottomSheetDialog != null && (window = bottomSheetDialog.getWindow()) != null && (findViewById = window.findViewById(R.id.design_bottom_sheet)) != null) {
            findViewById.setBackgroundDrawable(new ColorDrawable(0));
        }
        List<? extends PlayFromBean> list = this.f3455r;
        if (list == null) {
            kotlin.v1.internal.i0.k("vod_play_list");
        }
        if (list.isEmpty()) {
            Toast.makeText(getActivity(), "正在请求数据,请稍后", 0).show();
            return;
        }
        ArrayList arrayList = new ArrayList();
        int i2 = this.f3451n;
        if (this.f3455r == null) {
            kotlin.v1.internal.i0.k("vod_play_list");
        }
        if (!r6.isEmpty()) {
            List<? extends PlayFromBean> list2 = this.f3455r;
            if (list2 == null) {
                kotlin.v1.internal.i0.k("vod_play_list");
            }
            PlayFromBean playFromBean = list2.get(this.f3453p);
            PlayerInfoBean c2 = playFromBean.c();
            kotlin.v1.internal.i0.a((Object) c2, "playerInfo");
            c2.e();
            List<UrlBean> i3 = playFromBean.i();
            i3.size();
            g.a.b.l.b.b.a aVar = new g.a.b.l.b.b.a(i2 + 1, new h0(i3, i2));
            aVar.b = false;
            aVar.f9828c = false;
            UrlBean urlBean = i3.get(i2);
            kotlin.v1.internal.i0.a((Object) urlBean, "urls[downIndex]");
            kotlin.v1.internal.i0.a((Object) k.a.a.v.a.f(urlBean.d()), "DownloadPresenter.getM3u…ding(urls[downIndex].url)");
            if (!r8.isEmpty()) {
                aVar.b = true;
            }
            UrlBean urlBean2 = i3.get(i2);
            kotlin.v1.internal.i0.a((Object) urlBean2, "urls[downIndex]");
            kotlin.v1.internal.i0.a((Object) k.a.a.v.a.e(urlBean2.d()), "DownloadPresenter.getM3u8Done(urls[downIndex].url)");
            if (!r4.isEmpty()) {
                aVar.b = false;
                aVar.f9828c = true;
            }
            arrayList.add(aVar);
        }
        TreeSet treeSet = new TreeSet();
        MultiTypeAdapter multiTypeAdapter = new MultiTypeAdapter();
        multiTypeAdapter.register(g.a.b.l.b.b.a.class, new g.a.b.l.b.b.b(treeSet));
        ArrayList arrayList2 = new ArrayList();
        arrayList2.addAll(arrayList);
        multiTypeAdapter.setItems(arrayList2);
        View findViewById2 = inflate.findViewById(R.id.all_list);
        kotlin.v1.internal.i0.a((Object) findViewById2, "view.findViewById(R.id.all_list)");
        RecyclerView recyclerView = (RecyclerView) findViewById2;
        TextView textView = (TextView) inflate.findViewById(R.id.title);
        ((TextView) inflate.findViewById(R.id.down_center)).setOnClickListener(new f0(bottomSheetDialog));
        kotlin.v1.internal.i0.a((Object) textView, NotificationCompatJellybean.f1840d);
        textView.setText("缓存剧集");
        ImageView imageView = (ImageView) inflate.findViewById(R.id.close);
        GridLayoutManager gridLayoutManager = new GridLayoutManager(getActivity(), 5);
        gridLayoutManager.setOrientation(1);
        recyclerView.addItemDecoration(new g.a.b.utils.p.a(getActivity(), R.drawable.grid_item_decor));
        recyclerView.setLayoutManager(gridLayoutManager);
        recyclerView.setAdapter(multiTypeAdapter);
        if (bottomSheetDialog != null) {
            bottomSheetDialog.show();
        }
        imageView.setOnClickListener(new g0(bottomSheetDialog));
    }

    public final void y() {
        VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
        if (g.a.b.utils.a.a(vodService)) {
            return;
        }
        VodBean vodBean = this.f3449l;
        if (vodBean == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        h.e.a.a.a.b.a.a(this, vodService.b(String.valueOf(vodBean.U()), String.valueOf(2)), new i0());
    }

    @Override
    public View a(int i2) {
        if (this.D == null) {
            this.D = new HashMap();
        }
        View view = (View) this.D.get(Integer.valueOf(i2));
        if (view != null) {
            return view;
        }
        View view2 = getView();
        if (view2 == null) {
            return null;
        }
        View findViewById = view2.findViewById(i2);
        this.D.put(Integer.valueOf(i2), findViewById);
        return findViewById;
    }

    @Override
    public void a() {
        HashMap hashMap = this.D;
        if (hashMap != null) {
            hashMap.clear();
        }
    }

    @Override
    public int c() {
        return R.layout.fragment_play_detail;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        a();
    }

    @Override
    public void onResume() {
        super.onResume();
        o();
    }

    private final void m() {
        Log.e("fumiad", "进入");
        NewPlayActivity newPlayActivity = this.C;
        if (newPlayActivity == null) {
            kotlin.v1.internal.i0.k("playActivity");
        }
        s.a.a.a.a((Activity) newPlayActivity, (ViewGroup) q().findViewById(R.id.rl_native_horizontal), true, (s.a.a.m) new e());
    }

    public final void n() {
        VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
        if (g.a.b.utils.a.a(vodService)) {
            return;
        }
        String valueOf = String.valueOf(1);
        VodBean vodBean = this.f3449l;
        if (vodBean == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        h.e.a.a.a.b.a.a(this, vodService.e(valueOf, String.valueOf(vodBean.U()), String.valueOf(2)), new f());
    }

    private final void o() {
        if (UserUtils.d()) {
            VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
            if (g.a.b.utils.a.a(vodService)) {
                return;
            }
            h.e.a.a.a.b.a.a(this, vodService.a(String.valueOf(1), String.valueOf(100), String.valueOf(2)), new i());
        }
    }

    public final void s() {
        VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
        if (g.a.b.utils.a.a(vodService)) {
            return;
        }
        VodBean vodBean = this.f3449l;
        if (vodBean == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        int g2 = vodBean.g();
        VodBean vodBean2 = this.f3449l;
        if (vodBean2 == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        String i2 = vodBean2.i();
        kotlin.v1.internal.i0.a((Object) i2, "mVodBean.vod_actor");
        h.e.a.a.a.b.a.a(this, vodService.b(g2, i2, this.u, 3), new k());
    }

    public final void t() {
        VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
        if (g.a.b.utils.a.a(vodService)) {
            return;
        }
        VodBean vodBean = this.f3449l;
        if (vodBean == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        int g2 = vodBean.g();
        VodBean vodBean2 = this.f3449l;
        if (vodBean2 == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        String n2 = vodBean2.n();
        kotlin.v1.internal.i0.a((Object) n2, "mVodBean.vod_class");
        h.e.a.a.a.b.a.a(this, vodService.a(g2, n2, this.t, 3), new l());
    }

    @Override
    public void f() {
        super.f();
        ((SmartRefreshLayout) a(cn.luckxy.vod.R.id.refreshLayout)).a(new a0());
    }

    @Override
    public void h() {
        super.h();
        AppCompatActivity d2 = d();
        if (d2 != null) {
            this.C = (NewPlayActivity) d2;
            Bundle arguments = getArguments();
            if (arguments != null) {
                VodBean vodBean = (VodBean) arguments.getParcelable("vodBean");
                if (vodBean != null) {
                    this.f3449l = vodBean;
                    this.f3451n = arguments.getInt(G);
                    this.f3453p = arguments.getInt(H);
                } else {
                    throw new n0("null cannot be cast to non-null type cn.luckxy.vod.bean.VodBean");
                }
            }
            ((SmartRefreshLayout) a(cn.luckxy.vod.R.id.refreshLayout)).h(false);
            ((SmartRefreshLayout) a(cn.luckxy.vod.R.id.refreshLayout)).a((h.m.a.b.b.f) new ClassicsFooter(d()));
            RecyclerView recyclerView = (RecyclerView) a(cn.luckxy.vod.R.id.rvPlayDetail);
            kotlin.v1.internal.i0.a((Object) recyclerView, "rvPlayDetail");
            recyclerView.setLayoutManager(new LinearLayoutManager(d()));
            RecyclerView recyclerView2 = (RecyclerView) a(cn.luckxy.vod.R.id.rvPlayDetail);
            kotlin.v1.internal.i0.a((Object) recyclerView2, "rvPlayDetail");
            recyclerView2.setAdapter(p());
            v();
            p().addHeaderView(q());
            View findViewById = q().findViewById(R.id.bannerLayout);
            kotlin.v1.internal.i0.a((Object) findViewById, "headerView.findViewById(R.id.bannerLayout)");
            this.v = (FrameLayout) findViewById;
            a(this, false, 1, null);
            t();
            return;
        }
        throw new n0("null cannot be cast to non-null type cn.luckxy.vod.ui.play.NewPlayActivity");
    }

    public final void c(boolean z2) {
        VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
        if (g.a.b.utils.a.a(vodService)) {
            return;
        }
        VodBean vodBean = this.f3449l;
        if (vodBean == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        h.e.a.a.a.b.a.a(this, vodService.c(vodBean.U(), String.valueOf(1), this.f3454q, 10), new j(z2));
    }

    public final void b(int i2) {
        this.f3451n = i2;
        u().notifyDataSetChanged();
        RecyclerView recyclerView = this.A;
        if (recyclerView == null) {
            kotlin.v1.internal.i0.k("rvLastest");
        }
        a(recyclerView);
    }

    public final void c(int i2) {
        TabLayout tabLayout = this.B;
        if (tabLayout == null) {
            kotlin.v1.internal.i0.k("tlPlaySource");
        }
        TabLayout.g b2 = tabLayout.b(i2);
        if (b2 != null) {
            b2.i();
        }
    }

    private final void a(RecyclerView recyclerView) {
        recyclerView.scrollToPosition(this.f3451n);
        RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
        if (layoutManager != null) {
            ((LinearLayoutManager) layoutManager).scrollToPositionWithOffset(this.f3451n, 0);
            return;
        }
        throw new n0("null cannot be cast to non-null type androidx.recyclerview.widget.LinearLayoutManager");
    }

    public final void a(String str) {
        VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
        if (g.a.b.utils.a.a(vodService)) {
            return;
        }
        String valueOf = String.valueOf(1);
        VodBean vodBean = this.f3449l;
        if (vodBean == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        h.e.a.a.a.b.a.a(this, vodService.g(str, valueOf, String.valueOf(vodBean.U())), new h());
    }

    private final void a(String str, String str2, String str3) {
        VodService vodService = (VodService) g.a.b.utils.j.INSTANCE.a(VodService.class);
        if (g.a.b.utils.a.a(vodService)) {
            return;
        }
        String valueOf = String.valueOf(1);
        VodBean vodBean = this.f3449l;
        if (vodBean == null) {
            kotlin.v1.internal.i0.k("mVodBean");
        }
        h.e.a.a.a.b.a.a(this, vodService.a(str, valueOf, String.valueOf(vodBean.U()), str2, str3), new c0());
    }

    public static void a(VideoDetailFragment videoDetailFragment, boolean z2, int i2, Object obj) {
        if ((i2 & 1) != 0) {
            z2 = false;
        }
        videoDetailFragment.c(z2);
    }
}