OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046

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


package com.excelliance.kxqp.community.ui;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.bytedance.sdk.open.aweme.CommonConstants;
import com.excean.bytedancebi.bean.BiEventClick;
import com.excean.bytedancebi.bean.PageDes;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.bean.GamerVideoBean;
import com.excelliance.kxqp.bean.WXconfig;
import com.excelliance.kxqp.bitmap.model.GiftPackBean;
import com.excelliance.kxqp.community.adapter.ScreenshotAdapter;
import com.excelliance.kxqp.community.adapter.SimpleAppCommentAdapter;
import com.excelliance.kxqp.community.helper.c;
import com.excelliance.kxqp.community.helper.f;
import com.excelliance.kxqp.community.helper.m;
import com.excelliance.kxqp.community.model.entity.AppComment;
import com.excelliance.kxqp.community.model.entity.AppScreenshot;
import com.excelliance.kxqp.community.vm.AppCommentViewModel;
import com.excelliance.kxqp.community.vm.AppDetailViewModel;
import com.excelliance.kxqp.community.widgets.AppCommentView;
import com.excelliance.kxqp.community.widgets.ExContentTextView;
import com.excelliance.kxqp.community.widgets.RatingWrapperView;
import com.excelliance.kxqp.community.widgets.dialog.GiftPacksDialog;
import com.excelliance.kxqp.gs.adapter.RecommendAppAdapter;
import com.excelliance.kxqp.gs.base.BaseLazyFragment;
import com.excelliance.kxqp.gs.base.e;
import com.excelliance.kxqp.gs.discover.circle.UserCircleCenterActivity;
import com.excelliance.kxqp.gs.newappstore.adapter.GamerVideoHorizontalAdapter;
import com.excelliance.kxqp.gs.newappstore.c.b;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.medal.a.d;
import com.excelliance.kxqp.gs.ui.medal.a.l;
import com.excelliance.kxqp.gs.ui.question.WebNoVideoActivity;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.by;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.w;
import com.excelliance.kxqp.platforms.ExcellianceAppInfo;
import com.excelliance.kxqp.repository.a;
import com.excelliance.kxqp.ui.detail.HorizontalTagBox;
import com.excelliance.kxqp.ui.detail.RankingDetailInfo;
import com.excelliance.kxqp.ui.detail.WarpLinearLayout;
import com.excelliance.kxqp.ui.detail.category.CC1Tag;
import com.excelliance.kxqp.ui.detail.category.HorizontalTagBoxBean;
import com.excelliance.kxqp.ui.detail.gamervideo.GamerVideoActivity;
import com.excelliance.kxqp.util.af;
import com.excelliance.staticslio.StatisticsManager;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class AppDetailFragment extends BaseLazyFragment {
    private int A;
    private GiftPacksDialog B;
    private TextView C;
    private TextView D;
    private View E;
    private HorizontalTagBox F;
    private TextView G;
    private View H;
    private View I;
    private TextView J;
    private RatingWrapperView K;
    private View L;
    private View M;
    private View N;
    private RecyclerView O;
    private SimpleAppCommentAdapter P;
    private TextView Q;
    private WarpLinearLayout R;
    private TextView S;
    private TextView T;
    private TextView U;
    private RecyclerView V;
    private RankingDetailInfo W;
    private RecyclerView X;
    private View Y;
    private List<GamerVideoBean> Z;

    RecommendAppAdapter f3283a;
    private String aa;
    private String ab;
    private int ac;
    private AppDetailViewModel ad;
    private AppCommentViewModel ae;
    private f af;
    private final b ag = new b() {
        @Override
        public void a(int i, int i2) {
            FragmentActivity activity = AppDetailFragment.this.getActivity();
            if (d.a((Activity) activity)) {
                return;
            }
            ExcellianceAppInfo c = com.excelliance.kxqp.community.helper.d.c(activity);
            if (c != null) {
                Iterator it = AppDetailFragment.this.Z.iterator();
                while (it.hasNext()) {
                    ((GamerVideoBean) it.next()).excellianceAppInfo = (ExcellianceAppInfo) a.a(c);
                }
            }
            GamerVideoActivity.a(AppDetailFragment.this.c, (ArrayList) AppDetailFragment.this.Z, i, AppDetailFragment.this.W != null ? AppDetailFragment.this.W.getPkgname() : "");
        }
    };
    private TextView m;
    private LinearLayout n;
    private TextView o;
    private LinearLayout p;
    private TextView q;
    private LinearLayout r;
    private TextView s;
    private LinearLayout t;
    private TextView u;
    private LinearLayout v;
    private ExContentTextView w;
    private RecyclerView x;
    private View y;
    private TextView z;

    @Override
    public e e() {
        return null;
    }

    public static AppDetailFragment a(int i, String str, String str2) {
        Bundle bundle = new Bundle();
        bundle.putString("key_type", str2);
        bundle.putString("key_pkg_name", str);
        bundle.putInt("key_app_id", i);
        AppDetailFragment appDetailFragment = new AppDetailFragment();
        appDetailFragment.setArguments(bundle);
        return appDetailFragment;
    }

    public f a() {
        if (this.af == null) {
            this.af = new f(getActivity(), new f.d() {
                @Override
                public void a(int i) {
                }

                @Override
                public void a(AppComment.AppCommentReply appCommentReply) {
                }

                @Override
                public void a(AppComment appComment) {
                }

                @Override
                public void b(int i) {
                }

                @Override
                public void b(AppComment appComment) {
                    AppDetailFragment.this.a(appComment, AppDetailFragment.this.W);
                }

                @Override
                public void c(AppComment appComment) {
                    AppDetailFragment.this.a(appComment);
                    c.a.b(appComment);
                }
            });
        }
        return this.af;
    }

    @Override
    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        this.ad = (AppDetailViewModel) ViewModelProviders.of(requireActivity()).get(AppDetailViewModel.class);
        this.ae = (AppCommentViewModel) ViewModelProviders.of(requireActivity()).get(AppCommentViewModel.class);
        if (getArguments() != null) {
            this.aa = getArguments().getString("key_type");
            this.ab = getArguments().getString("key_pkg_name");
            this.ac = getArguments().getInt("key_app_id");
        }
        if (com.excean.ab_builder.c.a.L(this.d)) {
            com.excelliance.kxqp.repository.b.a(this.d).a(this.ab);
        }
        c();
    }

    private void c() {
        if (by.a(this.d, "last_app_and_count").b("sp_key_has_Launched_game", false).booleanValue()) {
            this.ad.e(this.ab);
        }
    }

    @Override
    protected void b() {
        this.m = (TextView) b("tv_developer");
        this.n = (LinearLayout) b("ll_developer_group");
        this.o = (TextView) b("tv_publisher");
        this.p = (LinearLayout) b("ll_publisher_group");
        this.q = (TextView) b("tv_obb_size");
        this.r = (LinearLayout) b("ll_obb_size_group");
        this.s = (TextView) b("tv_apk_size");
        this.t = (LinearLayout) b("ll_apk_size_group");
        this.u = (TextView) b("tv_download_count");
        this.v = (LinearLayout) b("ll_download_count_group");
        this.E = b("v_app_introduction");
        TextView textView = (TextView) b("tv_app_introduction_label");
        if (TextUtils.equals(w.e(this.d, "app_game_type1"), this.aa) || TextUtils.equals(w.e(this.d, "app_game_type2"), this.aa)) {
            textView.setText(w.e(this.d, "game_label"));
        }
        this.F = (HorizontalTagBox) b("tag_app_type");
        this.G = (TextView) b("tv_game_summary_desc");
        this.H = b("tv_game_summary_desc_more");
        this.H.setOnClickListener(this);
        this.x = (RecyclerView) b("rv_screenshot");
        this.y = b("v_gift");
        this.z = (TextView) b("tv_num_gift");
        this.z.setOnClickListener(this);
        this.Q = (TextView) b("tv_compatibility_label");
        this.R = (WarpLinearLayout) b("ll_compatibility_label");
        if (com.excelliance.kxqp.gs.newappstore.b.c.a(this.d)) {
            this.u.setTextColor(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
            this.o.setTextColor(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
            this.m.setTextColor(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
            this.q.setTextColor(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
            this.s.setTextColor(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
        }
        this.Y = b("gamer_video_cl");
        this.X = (RecyclerView) b("gamer_video_rv");
        this.w = (ExContentTextView) a(R.id.tv_recommend);
        this.w.setMaxLines(3);
        this.C = (TextView) a(R.id.tv_qq_group);
        this.D = (TextView) a(R.id.tv_wechat_group);
        this.I = a(R.id.v_update);
        this.J = (TextView) a(R.id.tv_update_version);
        this.K = (RatingWrapperView) a(R.id.v_ranting_wrapper);
        this.K.setOnClickCallback(new RatingWrapperView.a() {
            @Override
            public void a() {
                AppDetailFragment.this.ad.o();
            }

            @Override
            public void b() {
                AppDetailFragment.this.ad.o();
                c.b.e(AppDetailFragment.this, AppDetailFragment.this.ab);
            }
        });
        this.L = a(R.id.v_evaluation_player);
        this.M = a(R.id.v_more_evaluation);
        this.O = (RecyclerView) a(R.id.rv_evaluation_player);
        this.N = a(R.id.tv_more_evaluation);
        this.M.setOnClickListener(this);
        this.N.setOnClickListener(this);
        this.S = (TextView) a(R.id.permissions_info_tv);
        this.T = (TextView) a(R.id.privacy_policy_tv);
        this.U = (TextView) a(R.id.tv_recommend_label);
        this.V = (RecyclerView) a(R.id.rv_recommend);
    }

    @Override
    public void onViewCreated(View view, Bundle bundle) {
        super.onViewCreated(view, bundle);
        this.ad.c().observe(getViewLifecycleOwner(), new Observer<RankingDetailInfo>() {
            @Override
            public void onChanged(RankingDetailInfo rankingDetailInfo) {
                AppDetailFragment.this.a(rankingDetailInfo);
            }
        });
        if (com.excelliance.kxqp.gs.util.b.cA(this.d)) {
            this.ad.h().observe(getViewLifecycleOwner(), new Observer<List<GamerVideoBean>>() {
                @Override
                public void onChanged(List<GamerVideoBean> list) {
                    if (list == null || list.size() <= 0) {
                        return;
                    }
                    AppDetailFragment.this.b(list);
                }
            });
        }
        this.ae.a().observe(getViewLifecycleOwner(), new Observer<Integer>() {
            @Override
            public void onChanged(Integer num) {
                AppDetailFragment.this.ae.c(AppDetailFragment.this.ac);
            }
        });
        this.ae.f().observe(getViewLifecycleOwner(), new Observer<List<AppComment>>() {
            @Override
            public void onChanged(List<AppComment> list) {
                AppDetailFragment.this.d(list);
            }
        });
        this.ad.i().observe(getViewLifecycleOwner(), new Observer<List<ExcellianceAppInfo>>() {
            @Override
            public void onChanged(List<ExcellianceAppInfo> list) {
                AppDetailFragment.this.a(list);
            }
        });
        this.ad.f().observe(getViewLifecycleOwner(), new Observer<List<GiftPackBean>>() {
            @Override
            public void onChanged(List<GiftPackBean> list) {
                if (AppDetailFragment.this.W != null) {
                    AppDetailFragment.this.W.mGiftPackBeanList = list;
                }
                AppDetailFragment.this.c(list);
            }
        });
        this.ad.g().observe(getViewLifecycleOwner(), new Observer<GiftPackBean>() {
            @Override
            public void onChanged(GiftPackBean giftPackBean) {
                AppDetailFragment.this.a(giftPackBean);
            }
        });
        l.a(getActivity()).c().observe(getViewLifecycleOwner(), new Observer<Boolean>() {
            @Override
            public void onChanged(Boolean bool) {
                if (bool != null && !TextUtils.isEmpty(AppDetailFragment.this.ab) && AppDetailFragment.this.W != null && AppDetailFragment.this.W.mGiftPackBeanList != null && !AppDetailFragment.this.W.mGiftPackBeanList.isEmpty()) {
                    AppDetailFragment.this.ad.c(AppDetailFragment.this.ab);
                }
                if (AppDetailFragment.this.ac == 0) {
                    return;
                }
                AppDetailFragment.this.ae.b(AppDetailFragment.this.ac);
                AppDetailFragment.this.ae.c(AppDetailFragment.this.ac);
            }
        });
    }

    public void a(List<ExcellianceAppInfo> list) {
        if (list == null || list.isEmpty()) {
            this.V.setVisibility(8);
            this.U.setVisibility(8);
            return;
        }
        this.U.setVisibility(0);
        this.V.setVisibility(0);
        if (this.f3283a == null) {
            this.f3283a = new RecommendAppAdapter(this.d, list);
            this.f3283a.b(false);
            this.f3283a.a(1);
            PageDes pageDes = new PageDes();
            pageDes.firstPage = "详情页";
            pageDes.secondArea = "为您推荐";
            this.f3283a.a(pageDes);
            this.f3283a.a(this.l);
            this.f3283a.a(this.mCompositeDisposable);
            this.f3283a.a(this.g);
            this.V.setAdapter(this.f3283a);
            this.V.setLayoutManager(new LinearLayoutManager(this.d, 0, false));
            return;
        }
        this.f3283a.d(list);
        int size = list.size();
        for (int i = 0; i < size; i++) {
            ExcellianceAppInfo excellianceAppInfo = list.get(i);
            if (excellianceAppInfo.downloadProress > 0 && excellianceAppInfo.downloadProress < 100) {
                this.f3283a.notifyItemChanged(i);
            }
        }
    }

    @Override
    protected int d() {
        return R.layout.fragment_app_detail;
    }

    public void b(List<GamerVideoBean> list) {
        this.Z = list;
        if (list == null || list.isEmpty()) {
            this.Y.setVisibility(8);
            return;
        }
        this.Y.setVisibility(0);
        this.Y.findViewById(R.id.tv_more).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                AppDetailFragment.this.ag.a(0, 0);
            }
        });
        this.X.setLayoutManager(new LinearLayoutManager(this.d, 0, false));
        GamerVideoHorizontalAdapter gamerVideoHorizontalAdapter = new GamerVideoHorizontalAdapter(this.Z, this.d);
        gamerVideoHorizontalAdapter.a(this.ag);
        this.X.setAdapter(gamerVideoHorizontalAdapter);
    }

    public void a(RankingDetailInfo rankingDetailInfo) {
        if (rankingDetailInfo == null) {
            return;
        }
        this.W = rankingDetailInfo;
        c(rankingDetailInfo.getDesc());
        b(rankingDetailInfo);
        c(rankingDetailInfo.mGiftPackBeanList);
        g();
        l();
        c(rankingDetailInfo);
        e(rankingDetailInfo);
        d(rankingDetailInfo);
        d(rankingDetailInfo.getCompatibility());
        f(rankingDetailInfo);
        String str = rankingDetailInfo.privacy;
        if (!TextUtils.isEmpty(str)) {
            this.T.setTag(str);
            this.T.setVisibility(0);
            this.T.setOnClickListener(this);
        } else {
            this.T.setVisibility(8);
        }
        String str2 = rankingDetailInfo.permission;
        if (!TextUtils.isEmpty(str2)) {
            this.S.setTag(str2);
            this.S.setVisibility(0);
            this.S.setOnClickListener(this);
            return;
        }
        this.S.setVisibility(8);
    }

    @Override
    public void singleClick(View view) {
        if (view == this.S || view == this.T) {
            WebNoVideoActivity.startActivity(this.d, (String) view.getTag());
            return;
        }
        if (view == this.M || view == this.N) {
            this.ad.o();
            if (view == this.M) {
                c.b.d(this, this.ab);
                return;
            } else {
                c.b.c(this, this.ab);
                return;
            }
        }
        if (view == this.H) {
            this.ad.q();
            c.b.b(this, this.ab);
        } else if (view == this.z) {
            f();
        }
    }

    private void f() {
        if (d.a((Activity) getActivity()) || this.W == null || this.ab == null || this.W.mGiftPackBeanList == null || this.W.mGiftPackBeanList.isEmpty()) {
            return;
        }
        if (this.B == null) {
            this.B = new GiftPacksDialog(getString(R.string.gift_activation_code), this.W.mGiftPackBeanList, this.ab);
        }
        this.B.a(getChildFragmentManager());
    }

    private void c(String str) {
        if (cd.a(str)) {
            this.w.setVisibility(8);
            return;
        }
        com.excelliance.kxqp.ui.util.b.a(this.w, str, this.d, this.W);
        com.excelliance.kxqp.gs.g.c.a().a((View) this.w, true, this.j, this.l, this.mCompositeDisposable, this.W.getAppInfo(), 0, "文章");
        this.w.c();
        this.w.setVisibility(0);
    }

    private void b(final RankingDetailInfo rankingDetailInfo) {
        String imglist = rankingDetailInfo.getImglist();
        if (TextUtils.isEmpty(imglist)) {
            this.x.setVisibility(8);
            return;
        }
        final String[] split = imglist.split(StatisticsManager.COMMA);
        if (split.length == 0) {
            this.x.setVisibility(8);
        } else {
            tp.g(new Runnable() {
                @Override
                public void run() {
                    final List<com.excelliance.kxqp.ui.detail.e> a2 = m.a(rankingDetailInfo.getImageSize());
                    int length = split.length;
                    int i = 0;
                    int size = a2 == null ? 0 : a2.size();
                    final ArrayList arrayList = new ArrayList(length);
                    while (i < length) {
                        String str = split[i];
                        if (!TextUtils.isEmpty(str)) {
                            AppScreenshot appScreenshot = new AppScreenshot();
                            appScreenshot.url = str;
                            m.a(AppDetailFragment.this.d, appScreenshot, i < size ? a2.get(i) : null);
                            arrayList.add(appScreenshot);
                        }
                        i++;
                    }
                    tp.i(new Runnable() {
                        @Override
                        public void run() {
                            if (d.a((Activity) AppDetailFragment.this.getActivity()) || AppDetailFragment.this.x == null) {
                                return;
                            }
                            ScreenshotAdapter screenshotAdapter = new ScreenshotAdapter();
                            AppDetailFragment.this.x.setLayoutManager(new LinearLayoutManager(AppDetailFragment.this.d, 0, false));
                            AppDetailFragment.this.x.setAdapter(screenshotAdapter);
                            screenshotAdapter.a(arrayList, a2, split);
                        }
                    });
                }
            });
        }
    }

    public void a(GiftPackBean giftPackBean) {
        if (this.A > 0) {
            TextView textView = this.z;
            String string = getString(R.string.waiting_receive);
            int i = this.A - 1;
            this.A = i;
            textView.setText(String.format(string, Integer.valueOf(i)));
        }
        if (this.B != null) {
            this.B.a(giftPackBean);
        }
    }

    public void c(List<GiftPackBean> list) {
        if (list == null || list.isEmpty()) {
            this.y.setVisibility(8);
            if (this.B != null) {
                this.B.dismissAllowingStateLoss();
                return;
            }
            return;
        }
        Iterator<GiftPackBean> it = list.iterator();
        int i = 0;
        while (it.hasNext()) {
            if (!it.next().isGot()) {
                i++;
            }
        }
        this.A = i;
        this.z.setText(String.format(getString(R.string.waiting_receive), Integer.valueOf(i)));
        this.y.setVisibility(0);
        if (this.B != null) {
            this.B.a(list);
        }
    }

    private void g() {
        String e;
        View.OnClickListener onClickListener;
        String qq = this.W.getQq();
        final String qqKey = this.W.getQqKey();
        if (!cd.a(qq) && !this.W.getQq().equals("0")) {
            if (!cd.a(qqKey)) {
                e = w.e(this.d, "join");
                onClickListener = new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        com.excelliance.kxqp.d.d.a(AppDetailFragment.this.d, qqKey);
                        AppDetailFragment.e("详情页点击加入QQ群按钮");
                    }
                };
            } else {
                e = w.e(this.d, "copy");
                onClickListener = new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        ((ClipboardManager) AppDetailFragment.this.d.getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("gplayspace", AppDetailFragment.this.W.getQq()));
                        Toast.makeText(AppDetailFragment.this.d, "已复制QQ群号到剪切板~", 0).show();
                        AppDetailFragment.e("详情页点击加入QQ群按钮");
                    }
                };
            }
        } else {
            e = w.e(this.d, "create");
            onClickListener = new View.OnClickListener() {
                @Override
                public void onClick(View view) {
                    if (AppDetailFragment.this.W == null) {
                        return;
                    }
                    StringBuilder sb = new StringBuilder("https://h5.ourplay.com.cn/applyForQq");
                    try {
                        sb.append("?icon=");
                        sb.append(URLEncoder.encode(AppDetailFragment.this.W.getIcon(), "UTF-8"));
                        sb.append("&gamename=");
                        sb.append(URLEncoder.encode(AppDetailFragment.this.W.getName(), "UTF-8"));
                        sb.append("&rid=");
                        sb.append(URLEncoder.encode(bx.a().a(AppDetailFragment.this.d), "UTF-8"));
                        sb.append("&pkg=");
                        sb.append(URLEncoder.encode(AppDetailFragment.this.W.getPkgname(), "UTF-8"));
                        sb.append("&aid=");
                        sb.append(URLEncoder.encode(com.excelliance.kxqp.util.a.b.e(AppDetailFragment.this.d), "UTF-8"));
                    } catch (UnsupportedEncodingException e2) {
                        e2.printStackTrace();
                    }
                    AppDetailFragment.e("详情页点击创建QQ群按钮");
                    WebNoVideoActivity.startActivityForResult(AppDetailFragment.this.c, CommonConstants.AuthErrorCode.ERROR_PARAM, sb.toString(), (Bundle) null);
                }
            };
        }
        this.C.setText(String.format(this.d.getString(R.string.qq_group_operate), e));
        this.C.setOnClickListener(onClickListener);
    }

    private void l() {
        final String str = this.W.mWxminiappid;
        final String str2 = this.W.mWxminilink;
        if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
            return;
        }
        this.D.setVisibility(0);
        this.D.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                af.a aVar = new af.a();
                aVar.f14919a = c.a(AppDetailFragment.this.d);
                aVar.c = "保存图片";
                aVar.e = "展示二维码";
                aVar.d = "详情页私域弹窗";
                WXconfig wXconfig = new WXconfig();
                wXconfig.appid = str;
                wXconfig.deeplink = str2;
                wXconfig.qrcode = AppDetailFragment.this.W.qrcode;
                wXconfig.title = AppDetailFragment.this.W.wxminititle;
                wXconfig.desc = AppDetailFragment.this.W.wxminidesc;
                com.excelliance.kxqp.d.f.a(AppDetailFragment.this.d, str, af.a(AppDetailFragment.this.d, str2), wXconfig, aVar);
                BiEventClick biEventClick = new BiEventClick();
                biEventClick.current_page = c.a(AppDetailFragment.this.d);
                biEventClick.page_type = "主页";
                biEventClick.button_name = "详情页点击加入企微群按钮";
                biEventClick.button_function = "跳转小程序";
                com.excelliance.kxqp.gs.g.c.a().a(biEventClick);
            }
        });
    }

    private void c(RankingDetailInfo rankingDetailInfo) {
        boolean a2 = cd.a(rankingDetailInfo.getContent());
        boolean isEmpty = TextUtils.isEmpty(rankingDetailInfo.getTag());
        if (a2 && isEmpty) {
            this.E.setVisibility(8);
            return;
        }
        if (a2) {
            this.G.setVisibility(8);
            this.H.setVisibility(8);
        } else {
            this.G.setText(rankingDetailInfo.getContent());
            this.G.setVisibility(0);
            this.H.setVisibility(0);
        }
        if (isEmpty) {
            this.F.setVisibility(8);
        } else {
            this.F.setTags(g(rankingDetailInfo));
            this.F.setVisibility(0);
        }
        this.E.setVisibility(0);
    }

    private void d(RankingDetailInfo rankingDetailInfo) {
        this.K.setData(rankingDetailInfo);
    }

    public void d(List<AppComment> list) {
        if (list == null || list.isEmpty()) {
            this.L.setVisibility(8);
            return;
        }
        if (this.P == null) {
            this.P = new SimpleAppCommentAdapter();
            this.P.a(this.ab);
            this.P.a(c.c(this), this.j, this.l, this.mCompositeDisposable);
            this.P.a(new AppCommentView.a() {
                @Override
                public void a(AppComment appComment, int i) {
                    if (AppDetailFragment.this.m()) {
                        AppDetailFragment.this.ae.a(appComment.id, i);
                    }
                    c.b.a(AppDetailFragment.this, i, appComment.id, AppDetailFragment.this.ab);
                }

                @Override
                public void a(AppComment appComment) {
                    int rid = appComment.getRid();
                    UserCircleCenterActivity.a(AppDetailFragment.this.d, rid);
                    c.b.a(AppDetailFragment.this, appComment.id, AppDetailFragment.this.ab, rid);
                }

                @Override
                public void b(AppComment appComment) {
                    if (AppDetailFragment.this.m()) {
                        AppDetailFragment.this.a().a(appComment.setPkgName(AppDetailFragment.this.ab));
                    }
                    c.b.a(AppDetailFragment.this, appComment.id, AppDetailFragment.this.ab);
                }

                @Override
                public void c(AppComment appComment) {
                    AppDetailFragment.this.a(appComment);
                    c.b.c(AppDetailFragment.this, appComment.id, AppDetailFragment.this.ab);
                    c.a.b(appComment);
                }

                @Override
                public void d(AppComment appComment) {
                    AppDetailFragment.this.a(appComment);
                    c.a.b(appComment);
                }
            });
            this.O.setLayoutManager(new LinearLayoutManager(this.d, 0, false));
            this.O.setAdapter(this.P);
        }
        this.P.a(list);
        this.L.setVisibility(0);
    }

    public void a(AppComment appComment) {
        FragmentActivity activity = getActivity();
        if (appComment == null || this.W == null || d.a((Activity) activity)) {
            return;
        }
        AppDetailActivity appDetailActivity = (AppDetailActivity) activity;
        AppCommentDetailActivity.a(this, 7881, appComment.id, appComment.userId, this.W.getPkgname(), appDetailActivity.i(), appDetailActivity.j());
    }

    private void d(String str) {
        String[] split = !TextUtils.isEmpty(str) ? str.split(StatisticsManager.COMMA) : null;
        if (split == null || split.length == 0) {
            this.Q.setVisibility(8);
            this.R.setVisibility(8);
            return;
        }
        this.R.removeAllViews();
        for (String str2 : split) {
            if (!TextUtils.isEmpty(str2)) {
                TextView textView = (TextView) w.b(this.d, "item_app_detail_compatibility");
                if (textView == null) {
                    return;
                }
                textView.setText(str2);
                this.R.addView(textView);
            }
        }
        this.Q.setVisibility(0);
        this.R.setVisibility(0);
    }

    private void e(RankingDetailInfo rankingDetailInfo) {
        if (!cd.a(rankingDetailInfo.getVersion())) {
            StringBuilder sb = new StringBuilder();
            sb.append(this.d.getString(R.string.version_label));
            sb.append(" ");
            sb.append(rankingDetailInfo.getVersion());
            sb.append("     ");
            sb.append(rankingDetailInfo.getUpdatetime());
            this.J.setText(sb);
            return;
        }
        this.I.setVisibility(8);
    }

    @SuppressLint({"SetTextI18n"})
    private void f(RankingDetailInfo rankingDetailInfo) {
        String download = rankingDetailInfo.getDownload();
        if (!cd.a(download) && !download.equals("0")) {
            this.u.setText(download + w.e(this.d, "download_count_desc"));
        } else {
            this.v.setVisibility(8);
        }
        if (!cd.a(rankingDetailInfo.getPublisher())) {
            this.o.setText(rankingDetailInfo.getPublisher());
        } else {
            this.p.setVisibility(8);
        }
        if (!cd.a(rankingDetailInfo.getDeveloper())) {
            this.m.setText(rankingDetailInfo.getDeveloper());
        } else {
            this.n.setVisibility(8);
        }
        if (!cd.a(rankingDetailInfo.getObbsize())) {
            this.q.setText(rankingDetailInfo.getObbsize());
        } else {
            this.r.setVisibility(8);
        }
        if (!cd.a(rankingDetailInfo.getApksize())) {
            this.s.setText(rankingDetailInfo.getApksize());
        } else {
            this.t.setVisibility(8);
        }
    }

    @Override
    public void onActivityResult(int i, int i2, @Nullable Intent intent) {
        if (i == 10002 && i2 == -1) {
            Toast.makeText(this.d, "申请成功", 0).show();
            return;
        }
        if (i == 7881) {
            this.ae.a(intent != null ? intent.getIntExtra("id", 0) : 0);
        }
        super.onActivityResult(i, i2, intent);
    }

    private static List<HorizontalTagBoxBean> g(RankingDetailInfo rankingDetailInfo) {
        ArrayList arrayList = new ArrayList();
        if (!cd.a(rankingDetailInfo.getHighQuality())) {
            HorizontalTagBoxBean horizontalTagBoxBean = new HorizontalTagBoxBean();
            horizontalTagBoxBean.tag = rankingDetailInfo.getHighQuality();
            horizontalTagBoxBean.tagStyle = 2;
            arrayList.add(horizontalTagBoxBean);
        }
        if (rankingDetailInfo.getCc1TagList() != null) {
            for (int i = 0; i < rankingDetailInfo.getCc1TagList().size(); i++) {
                CC1Tag cC1Tag = rankingDetailInfo.getCc1TagList().get(i);
                HorizontalTagBoxBean horizontalTagBoxBean2 = new HorizontalTagBoxBean();
                horizontalTagBoxBean2.tag = cC1Tag.tag;
                horizontalTagBoxBean2.tagId = cC1Tag.tagId;
                if (i > 10) {
                    horizontalTagBoxBean2.tagStyle = 1;
                } else {
                    horizontalTagBoxBean2.tagStyle = 0;
                }
                arrayList.add(horizontalTagBoxBean2);
            }
        }
        return arrayList;
    }

    public boolean m() {
        FragmentActivity activity = getActivity();
        if (d.a((Activity) activity)) {
            return false;
        }
        if (bx.a().b(activity)) {
            return true;
        }
        com.excelliance.kxqp.gs.router.a.a.f8074a.invokeLogin(activity);
        return false;
    }

    public void a(AppComment appComment, RankingDetailInfo rankingDetailInfo) {
        com.excelliance.kxqp.community.widgets.dialog.f.a((Fragment) this, appComment, rankingDetailInfo, false);
    }

    public static void e(String str) {
        BiEventClick biEventClick = new BiEventClick();
        biEventClick.current_page = "详情页";
        biEventClick.button_name = str;
        com.excelliance.kxqp.gs.g.c.a().a(biEventClick);
    }

    @Override
    public void h() {
        super.h();
        c.g.a(this, this.k.f1371b);
    }
}