OurPlay v5.5.9版本的 MD5 值为:d4e139798f4c2243a1145c8af5e21046
以下内容为反编译后的 RankingDetailActivity.java 源代码,内容仅作参考
package com.excelliance.kxqp.ui.detail;
import a.q;
import android.app.Activity;
import android.app.Dialog;
import android.content.BroadcastReceiver;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Message;
import android.text.SpannableStringBuilder;
import android.text.TextUtils;
import android.text.style.AbsoluteSizeSpan;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.coordinatorlayout.widget.CoordinatorLayout;
import androidx.core.app.ActivityCompat;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentStatePagerAdapter;
import androidx.lifecycle.Observer;
import androidx.lifecycle.ViewModelProviders;
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import androidx.viewpager.widget.ViewPager;
import androidx.work.WorkRequest;
import com.android.spush.util.WebActionRouter;
import com.bytedance.sdk.open.aweme.CommonConstants;
import com.bytedance.sdk.open.aweme.common.constants.ParamKeyConstants;
import com.excean.bytedancebi.bean.BiAppUploadInfo;
import com.excean.bytedancebi.bean.BiEventAppButtonClick;
import com.excean.bytedancebi.bean.BiEventBrowsePage;
import com.excean.bytedancebi.bean.BiEventClick;
import com.excean.bytedancebi.bean.BiEventContent;
import com.excean.bytedancebi.bean.BiEventPageOpen;
import com.excean.bytedancebi.bean.BiEventPermission;
import com.excean.bytedancebi.bean.PageDes;
import com.excean.bytedancebi.viewtracker.ExRelativeLayout;
import com.excean.bytedancebi.viewtracker.ExTextView;
import com.excean.ggspace.main.R;
import com.excelliance.kxqp.GameUtil;
import com.excelliance.kxqp.PlatSdk;
import com.excelliance.kxqp.VersionManager;
import com.excelliance.kxqp.api.ApiManager;
import com.excelliance.kxqp.b.k;
import com.excelliance.kxqp.bean.AppButtonDisplayResult;
import com.excelliance.kxqp.bean.AppBuyBean;
import com.excelliance.kxqp.bean.GamerVideoBean;
import com.excelliance.kxqp.bean.ReponsePlayableArea;
import com.excelliance.kxqp.bean.ReponsePlayableGameInfo;
import com.excelliance.kxqp.bean.ReponsePlayablePort;
import com.excelliance.kxqp.bean.WXconfig;
import com.excelliance.kxqp.bitmap.bean.RankingItem;
import com.excelliance.kxqp.bitmap.bean.ResponseData;
import com.excelliance.kxqp.bitmap.model.Entrance;
import com.excelliance.kxqp.bitmap.model.GiftPackBean;
import com.excelliance.kxqp.bitmap.model.RankBean;
import com.excelliance.kxqp.bitmap.model.ThirdLink;
import com.excelliance.kxqp.bitmap.ui.b.i;
import com.excelliance.kxqp.bitmap.ui.imp.RankingListFragment;
import com.excelliance.kxqp.gs.adapter.GiftPackAdapter;
import com.excelliance.kxqp.gs.adapter.RecommendAppAdapter;
import com.excelliance.kxqp.gs.adapter.ThirdLinkAdapter;
import com.excelliance.kxqp.gs.appstore.common.CommonDialog;
import com.excelliance.kxqp.gs.base.b;
import com.excelliance.kxqp.gs.bean.AddGameBean;
import com.excelliance.kxqp.gs.bean.ImportParams;
import com.excelliance.kxqp.gs.bean.NativeAppInfo;
import com.excelliance.kxqp.gs.bean.PingIpInfo;
import com.excelliance.kxqp.gs.bean.ShareGameBean;
import com.excelliance.kxqp.gs.dialog.ad;
import com.excelliance.kxqp.gs.dialog.ap;
import com.excelliance.kxqp.gs.download.o;
import com.excelliance.kxqp.gs.g.x;
import com.excelliance.kxqp.gs.main.MainActivity;
import com.excelliance.kxqp.gs.newappstore.Bean.AppGoodsBean;
import com.excelliance.kxqp.gs.newappstore.b.b;
import com.excelliance.kxqp.gs.newappstore.ui.c;
import com.excelliance.kxqp.gs.service.ProxyDelayService;
import com.excelliance.kxqp.gs.thpool.tp;
import com.excelliance.kxqp.gs.ui.CommonActivity;
import com.excelliance.kxqp.gs.ui.feedback.ShowFeedbackResultDialog;
import com.excelliance.kxqp.gs.ui.gameaccount.BuyGameAccountActivity;
import com.excelliance.kxqp.gs.ui.make_money.DeepBaseActivity;
import com.excelliance.kxqp.gs.ui.question.CommonWebViewActivity;
import com.excelliance.kxqp.gs.ui.question.WebNoVideoActivity;
import com.excelliance.kxqp.gs.ui.search.child.SearchListFragment;
import com.excelliance.kxqp.gs.ui.share.core.config.SocializeMedia;
import com.excelliance.kxqp.gs.ui.view.ImagePagerIndicator;
import com.excelliance.kxqp.gs.ui.view.ProgressButton;
import com.excelliance.kxqp.gs.ui.view.RankingDetailIndicator;
import com.excelliance.kxqp.gs.util.ViewSwitcher;
import com.excelliance.kxqp.gs.util.as;
import com.excelliance.kxqp.gs.util.az;
import com.excelliance.kxqp.gs.util.bf;
import com.excelliance.kxqp.gs.util.bq;
import com.excelliance.kxqp.gs.util.bs;
import com.excelliance.kxqp.gs.util.bx;
import com.excelliance.kxqp.gs.util.by;
import com.excelliance.kxqp.gs.util.bz;
import com.excelliance.kxqp.gs.util.cd;
import com.excelliance.kxqp.gs.util.ce;
import com.excelliance.kxqp.gs.util.cg;
import com.excelliance.kxqp.gs.util.s;
import com.excelliance.kxqp.gs.util.w;
import com.excelliance.kxqp.platforms.ExcellianceAppInfo;
import com.excelliance.kxqp.sdk.StatisticsGS;
import com.excelliance.kxqp.task.store.common.CommonDialog;
import com.excelliance.kxqp.ui.InitialData;
import com.excelliance.kxqp.ui.detail.DownloadProgressButton;
import com.excelliance.kxqp.ui.detail.comment.CommentFragment;
import com.excelliance.kxqp.ui.detail.g;
import com.excelliance.kxqp.ui.detail.raiders.StrategyFragment;
import com.excelliance.kxqp.ui.detail.strategy.StrategyDetailActivity;
import com.excelliance.kxqp.ui.detail.strategy.StrategyInfo;
import com.excelliance.kxqp.util.af;
import com.excelliance.kxqp.util.an;
import com.excelliance.kxqp.util.r;
import com.excelliance.kxqp.widget.video.NiceVideoPlayer;
import com.excelliance.kxqp.widget.video.j;
import com.excelliance.staticslio.StatisticsManager;
import com.google.android.material.appbar.AppBarLayout;
import com.quick.sdk.slice.SliceResolvedActivity;
import com.tencent.open.SocialConstants;
import com.umeng.analytics.pro.am;
import io.github.prototypez.service.account.request.LoginRequest;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.json.JSONException;
import org.json.JSONObject;
public class RankingDetailActivity extends DeepBaseActivity<h> implements ad.a, g.b {
private ViewGroup A;
private ViewGroup B;
private TextView C;
private TextView D;
private TextView E;
private TextView F;
private String G;
private LinearLayout H;
private ImageView I;
private String[] J;
private View K;
private ImageView M;
private String N;
private int O;
private String S;
private String T;
private ProgressButton U;
private FrameLayout V;
private TextView W;
private TextView X;
private TextView Y;
private LinearLayout Z;
View f14253a;
private View aA;
private int aC;
private String aD;
private View aE;
private ExcellianceAppInfo aF;
private String aG;
private Button aH;
private View aI;
private RecyclerView aJ;
private GiftPackAdapter aK;
private View aL;
private TextView aM;
private LinearLayout aN;
private LinearLayout aO;
private View aP;
private TextView aQ;
private DownloadProgressButton aR;
private View aS;
private LinearLayout aT;
private LinearLayout aU;
private LinearLayout aV;
private RelativeLayout aW;
private DownloadProgressButton aX;
private DownloadProgressButton aY;
private View aZ;
private ExTextView aa;
private View ab;
private ImagePagerIndicator ac;
private RankingDetailIndicator ad;
private ViewPager ae;
private boolean ag;
private List<Fragment> ah;
private List<String> ai;
private View aj;
private ImageView ak;
private TextView al;
private RankingDetailViewModel am;
private LinearLayout an;
private ImageView ao;
private TextView ap;
private View as;
private RecyclerView at;
private RecommendAppAdapter au;
private View av;
private RecyclerView aw;
private ThirdLinkAdapter ax;
private TextView ay;
private View az;
ExcellianceAppInfo f14254b;
private com.excelliance.kxqp.util.master.d bL;
private ap bb;
private boolean bd;
private FragmentStatePagerAdapter bf;
private io.reactivex.b.b bg;
private io.reactivex.b.b bh;
private int bi;
private io.reactivex.b.b bj;
private String bl;
private ArrayList<GamerVideoBean> bm;
private ArrayList<ExcellianceAppInfo> bn;
private com.excelliance.kxqp.bitmap.ui.b.i bo;
private String br;
private int bs;
private String bt;
private String bu;
private String bv;
private String bw;
private RankingDetailFragment bx;
public com.excelliance.kxqp.gs.newappstore.b.b c;
private CommentFragment d;
private Button e;
private DownloadProgressButton f;
private TextView g;
private TextView h;
private TextView i;
private TextView j;
private TextView k;
private ImageView l;
private NiceVideoPlayer m;
private j n;
private ExcellianceAppInfo p;
private Button q;
private ImageView r;
private ImageView s;
private ImageView t;
private TextView u;
private ad v;
private CoordinatorLayout w;
private AppBarLayout x;
private ViewGroup y;
private TextView z;
private RankingDetailInfo o = new RankingDetailInfo();
private boolean L = false;
private boolean P = false;
private final boolean Q = false;
private String R = "other";
private int af = 0;
private int aq = 0;
private boolean ar = false;
private boolean aB = true;
private c ba = c.b();
private boolean bc = false;
private int be = 0;
private boolean bk = false;
private BiEventAppButtonClick bp = new BiEventAppButtonClick();
private AppButtonDisplayResult bq = new AppButtonDisplayResult();
private CountDownLatch by = null;
private int bz = 101;
private int bA = 102;
private BroadcastReceiver bB = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
String action;
if (intent == null || (action = intent.getAction()) == null) {
return;
}
if ((context.getPackageName() + ".download.notify.progress").equals(action)) {
Bundle bundleExtra = intent.getBundleExtra("bundle");
if (RankingDetailActivity.this.p == null || bundleExtra == null) {
return;
}
bundleExtra.getInt("index");
long j = bundleExtra.getLong(RankingItem.KEY_SIZE);
String string = bundleExtra.getString(WebActionRouter.KEY_PKG);
long j2 = bundleExtra.getLong(ExcellianceAppInfo.KEY_CURRNETPOS);
bundleExtra.getString("main");
bundleExtra.getString(ExcellianceAppInfo.KEY_PATCH);
bundleExtra.getInt("type");
Log.i("RankingDetailActivity", "s:" + j + "pkg:" + string);
if (j == 0 || cd.a(string)) {
return;
}
int i = (int) ((((float) j2) * 100.0f) / ((float) j));
if (!RankingDetailActivity.this.p.getAppPackageName().equals(string) || RankingDetailActivity.this.p.currnetPos == j2) {
return;
}
RankingDetailActivity.this.p.setDownloadProgress(i);
RankingDetailActivity.this.p.setAppSize(j);
RankingDetailActivity.this.p.currnetPos = j2;
az.d("RankingDetailActivity", "progress = " + RankingDetailActivity.this.p.getDownloadProgress() + " statename = " + RankingItem.getStateName(RankingDetailActivity.this.mContext, RankingDetailActivity.this.p) + " status = " + RankingDetailActivity.this.p.getDownloadStatus() + " progress2 = " + i);
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
return;
}
if ((context.getPackageName() + ".download.notify.state").equals(action)) {
Log.d("RankingDetailActivity", "onReceive: " + action);
Bundle bundleExtra2 = intent.getBundleExtra("bundle");
if (bundleExtra2 == null) {
return;
}
long j3 = bundleExtra2.getLong(RankingItem.KEY_SIZE);
bundleExtra2.getInt("index");
int i2 = bundleExtra2.getInt("state");
bundleExtra2.getInt("errorCount");
String string2 = bundleExtra2.getString(WebActionRouter.KEY_PKG);
int i3 = (int) ((((float) bundleExtra2.getLong(ExcellianceAppInfo.KEY_CURRNETPOS)) * 100.0f) / ((float) j3));
if (cd.a(string2)) {
return;
}
ExcellianceAppInfo excellianceAppInfo = null;
if (RankingDetailActivity.this.p != null && RankingDetailActivity.this.p.getAppPackageName().equals(string2)) {
excellianceAppInfo = RankingDetailActivity.this.p;
excellianceAppInfo.setPath(as.b(RankingDetailActivity.this.mContext, string2));
}
if (excellianceAppInfo != null) {
switch (i2) {
case 0:
case 3:
case 6:
case 7:
case 9:
case 10:
case 14:
case 15:
case 16:
case 17:
case 18:
default:
return;
case 1:
ExcellianceAppInfo a2 = InitialData.a(RankingDetailActivity.this.mContext).a(-1, 0, string2);
if (a2 != null) {
excellianceAppInfo.setGameType(a2.getGameType());
excellianceAppInfo.setDownloadProgress(a2.getDownloadProgress());
}
if (excellianceAppInfo.getDownloadProgress() >= 100 && TextUtils.isEmpty(excellianceAppInfo.getMainObb()) && TextUtils.isEmpty(excellianceAppInfo.getPatchObb())) {
if ("7".equals(excellianceAppInfo.getGameType())) {
excellianceAppInfo.setDownloadStatus(1);
} else {
excellianceAppInfo.setDownloadStatus(5);
}
RankingDetailActivity.this.D();
az.d("RankingDetailActivity", "progress = " + RankingDetailActivity.this.p.getDownloadProgress() + " statename = " + RankingItem.getStateName(RankingDetailActivity.this.mContext, RankingDetailActivity.this.p) + " status = " + RankingDetailActivity.this.p.getDownloadStatus() + " progress2 = " + i3);
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
return;
}
return;
case 2:
if (com.excelliance.kxqp.gs.util.b.ai(RankingDetailActivity.this.mContext)) {
RankingDetailActivity.this.b(excellianceAppInfo.getAppPackageName());
}
if (excellianceAppInfo.getDownloadStatus() != 2) {
excellianceAppInfo.setDownloadStatus(2);
az.d("RankingDetailActivity", "4--progress = " + RankingDetailActivity.this.p.getDownloadProgress() + " statename = " + RankingItem.getStateName(RankingDetailActivity.this.mContext, RankingDetailActivity.this.p) + " status = " + RankingDetailActivity.this.p.getDownloadStatus() + " progress2 = " + i3);
RankingDetailActivity.this.D();
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
if (!ResponseData.getClickDownloadPkg(context).contains(excellianceAppInfo.getAppPackageName()) || ResponseData.getStartDownloadPkg(RankingDetailActivity.this.mContext).contains(excellianceAppInfo.getAppPackageName())) {
return;
}
ResponseData.saveStartDownloadPkg(RankingDetailActivity.this.mContext, excellianceAppInfo.getAppPackageName(), true);
StatisticsGS.getInstance().uploadUserAction(RankingDetailActivity.this.mContext, 90, excellianceAppInfo.getAppPackageName());
return;
}
return;
case 4:
if (excellianceAppInfo.getDownloadStatus() != 4) {
excellianceAppInfo.setDownloadStatus(4);
az.d("RankingDetailActivity", "progress = " + RankingDetailActivity.this.p.getDownloadProgress() + " statename = " + RankingItem.getStateName(RankingDetailActivity.this.mContext, RankingDetailActivity.this.p) + " status = " + RankingDetailActivity.this.p.getDownloadStatus() + " progress2 = " + i3);
RankingDetailActivity.this.D();
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
return;
}
return;
case 5:
case 8:
ExcellianceAppInfo a3 = InitialData.a(RankingDetailActivity.this.mContext).a(-1, 0, string2);
if (a3 != null) {
excellianceAppInfo.setGameType(a3.getGameType());
excellianceAppInfo.setDownloadProgress(a3.getDownloadProgress());
}
if (excellianceAppInfo.getDownloadProgress() >= 100 || TextUtils.equals(excellianceAppInfo.getGameType(), "5")) {
excellianceAppInfo.setDownloadStatus(5);
return;
}
return;
case 11:
excellianceAppInfo.setDownloadStatus(11);
RankingDetailActivity.this.D();
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
return;
case 12:
excellianceAppInfo.setDownloadStatus(12);
RankingDetailActivity.this.D();
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
return;
case 13:
excellianceAppInfo.setDownloadStatus(13);
RankingDetailActivity.this.D();
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
return;
case 19:
RankingDetailActivity.this.D();
return;
}
}
}
}
};
private BroadcastReceiver bC = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (intent != null) {
Log.i("nbox_intent", "action:" + intent.getAction() + " bundles:" + intent.getExtras());
String action = intent.getAction();
if (RankingDetailActivity.this.p != null) {
if (TextUtils.equals(action, context.getPackageName() + VersionManager.q)) {
Log.d("RankingDetailActivity", "onReceive: " + VersionManager.q);
String stringExtra = intent.getStringExtra("installingPackageName");
String stringExtra2 = intent.getStringExtra("uninstallPackageName");
if (TextUtils.isEmpty(stringExtra) && cd.a(stringExtra2)) {
Log.d("RankingDetailActivity", "onReceive: pkg is empty");
return;
}
boolean a2 = cd.a(stringExtra2);
if (a2) {
stringExtra2 = stringExtra;
}
if (RankingDetailActivity.this.p.getAppPackageName().equals(stringExtra2)) {
if (a2) {
ExcellianceAppInfo a3 = InitialData.a(RankingDetailActivity.this.mContext).a(-1, 0, stringExtra);
Log.d("RankingDetailActivity", "onReceive: " + a3);
if (a3 != null) {
RankingDetailActivity.this.p.setDownloadStatus(a3.getDownloadStatus());
RankingDetailActivity.this.p.setPath(a3.getPath());
RankingDetailActivity.this.p.setGameType(a3.getGameType());
RankingDetailActivity.this.p.setDownloadProgress(a3.getDownloadProgress());
if (intent.getBooleanExtra("needObb", true) && TextUtils.isEmpty(a3.getMainObb()) && TextUtils.isEmpty(a3.getPatchObb()) && !RankingDetailActivity.this.bk) {
RankingDetailActivity.this.p.setDownloadStatus(5);
}
az.d("RankingDetailActivity", "5--progress = " + RankingDetailActivity.this.p.getDownloadProgress() + " statename = " + RankingItem.getStateName(RankingDetailActivity.this.mContext, RankingDetailActivity.this.p) + " status = " + RankingDetailActivity.this.p.getDownloadStatus());
RankingDetailActivity.this.D();
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
return;
}
return;
}
RankingDetailActivity.this.p.setDownloadProgress(0);
RankingDetailActivity.this.p.setDownloadStatus(0);
RankingDetailActivity.this.p.setGameType("7");
az.d("RankingDetailActivity", "6--progress = " + RankingDetailActivity.this.p.getDownloadProgress() + " statename = " + RankingItem.getStateName(RankingDetailActivity.this.mContext, RankingDetailActivity.this.p) + " status = " + RankingDetailActivity.this.p.getDownloadStatus());
RankingDetailActivity.this.D();
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
return;
}
return;
}
}
if (TextUtils.equals(action, context.getPackageName() + ".user_login_in")) {
if (RankingDetailActivity.this.S != null && RankingDetailActivity.this.aK != null && RankingDetailActivity.this.aK.l() != null && RankingDetailActivity.this.aK.l().size() > 0) {
((h) RankingDetailActivity.this.mPresenter).d(RankingDetailActivity.this.S);
}
if (RankingDetailActivity.this.f14254b != null) {
com.excelliance.kxqp.bitmap.ui.b.i.a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.f14254b, null, 0);
return;
}
return;
}
if (TextUtils.equals(action, context.getPackageName() + ".action_download_game")) {
String stringExtra3 = intent.getStringExtra("GamePkg");
ExcellianceAppInfo b2 = TextUtils.isEmpty(stringExtra3) ? null : com.excelliance.kxqp.repository.a.a(context).b(stringExtra3);
if (b2 == null) {
b2 = RankingDetailActivity.this.p;
}
String appPackageName = b2 != null ? b2.getAppPackageName() : "";
StringBuilder sb = new StringBuilder();
sb.append("onReceive: dpkg ");
sb.append(stringExtra3);
sb.append(", cpkg = ");
sb.append(appPackageName);
sb.append(", getDownloadStatus = ");
sb.append(RankingDetailActivity.this.p.getDownloadStatus());
sb.append(", ea.getDownloadStatus=");
sb.append(b2 != null ? Integer.valueOf(b2.getDownloadStatus()) : "null");
Log.d("RankingDetailActivity", sb.toString());
if (TextUtils.equals(stringExtra3, appPackageName)) {
if (b2.getDownloadStatus() == 0 || b2.getDownloadStatus() == 4 || b2.getDownloadStatus() == 9) {
boolean d = com.excelliance.kxqp.gs.ui.home.b.a(context).d();
if (((d && b2.cpu == 1) || (!d && b2.cpu == 2)) && !com.excelliance.kxqp.util.master.e.a(context)) {
if (RankingDetailActivity.this.bL == null) {
RankingDetailActivity.this.bL = new com.excelliance.kxqp.util.master.d(context, true);
}
RankingDetailActivity.this.bL.a();
return;
}
if (b2.getDownloadStatus() == 0) {
cg.a(context, String.format(context.getString(R.string.app_downloading), RankingDetailActivity.this.p.getAppName()));
}
PageDes pageDes = new PageDes();
pageDes.firstPage = "云游戏内";
pageDes.secondArea = "悬浮球";
RankingDetailActivity.this.p.fromPageAreaPlacement = "悬浮球下载icon";
RankingDetailActivity.this.p.exchangePageDes(pageDes, -1);
RankingDetailActivity.this.E();
return;
}
Log.d("RankingDetailActivity", "onReceive: dpkg already ongoing" + stringExtra3 + ", cpkg = " + appPackageName + ", getDownloadStatus = " + RankingDetailActivity.this.p.getDownloadStatus());
}
}
}
}
};
private Observer<ExcellianceAppInfo> bD = new Observer<ExcellianceAppInfo>() {
@Override
public void onChanged(ExcellianceAppInfo excellianceAppInfo) {
AppBuyBean l;
Log.d("RankingDetailActivity", String.format("RankingDetailActivity/onChanged:thread(%s)", Thread.currentThread().getName()));
if (excellianceAppInfo != null) {
if (!bs.s(excellianceAppInfo.appPackageName) && (l = com.excelliance.kxqp.repository.a.a(RankingDetailActivity.this.mContext).l(excellianceAppInfo.getAppPackageName())) != null) {
l.initData();
excellianceAppInfo.isBuy = l.isBuy(RankingDetailActivity.this.mContext) ? 1 : 0;
}
int i = excellianceAppInfo.playable;
if (RankingDetailActivity.this.p != null) {
i = RankingDetailActivity.this.p.playable;
}
RankingDetailActivity.this.p = excellianceAppInfo;
RankingDetailActivity.this.p.playable = i;
RankingDetailActivity.this.p.buttonStatus = RankingDetailActivity.this.aC;
RankingDetailActivity.this.p.buttonText = RankingDetailActivity.this.aD;
RankingDetailActivity.this.a(RankingDetailActivity.this.p, RankingDetailActivity.this.bp);
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
if (RankingDetailActivity.this.p.getDownloadStatus() == 2 && com.excelliance.kxqp.gs.util.b.ai(RankingDetailActivity.this.mContext)) {
RankingDetailActivity.this.b(excellianceAppInfo.getAppPackageName());
return;
}
return;
}
Log.d("RankingDetailActivity", " 0 mAppInfo" + RankingDetailActivity.this.p);
Log.d("RankingDetailActivity", String.format("no RankingDetailActivity/onChanged:thread(%s)", Thread.currentThread().getName()));
RankingDetailActivity.this.u();
}
};
private Observer<AppBuyBean> bE = new Observer<AppBuyBean>() {
@Override
public void onChanged(AppBuyBean appBuyBean) {
Log.d("RankingDetailActivity", String.format("onChanged RankingDetailActivity/onChanged:thread(%s)", Thread.currentThread().getName()));
if (appBuyBean == null) {
if (RankingDetailActivity.this.p != null) {
RankingDetailActivity.this.p.isBuy = 0;
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
return;
}
return;
}
az.d("RankingDetailActivity", "onChanged mDAppBuyBean:" + appBuyBean);
if (RankingDetailActivity.this.p != null) {
appBuyBean.initData();
az.d("RankingDetailActivity", "onChanged 2 mDAppBuyBean:" + appBuyBean);
RankingDetailActivity.this.p.isBuy = appBuyBean.isBuy(RankingDetailActivity.this.mContext) ? 1 : 0;
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
}
}
};
private com.excelliance.kxqp.bitmap.ui.a bF = new com.excelliance.kxqp.bitmap.ui.a() {
@Override
public void a(ExcellianceAppInfo excellianceAppInfo) {
RankingDetailActivity.this.f14254b = excellianceAppInfo;
com.excelliance.kxqp.gs.router.a.a.f8074a.invokeLogin(new LoginRequest.Builder((Activity) RankingDetailActivity.this).build());
}
};
private View.OnClickListener bG = new AnonymousClass18();
private View.OnClickListener bH = new View.OnClickListener() {
@Override
public void onClick(View view) {
RankingDetailActivity.this.b();
RankingDetailActivity.this.a(RankingDetailActivity.this.mContext, 1, RankingDetailActivity.this.p);
com.excelliance.kxqp.gs.g.c.a().a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.mPageDes.firstPage, 1, RankingDetailActivity.this.p);
}
};
private ad.b bI = new ad.b() {
@Override
public void a(int i, String str) {
if (RankingDetailActivity.this.v != null) {
RankingDetailActivity.this.v.b();
}
int i2 = 0;
if (i != 2) {
if (i != 4) {
if (i != 8) {
if (i != 16) {
if (i != 32) {
if (i == 64) {
i2 = 6;
((h) RankingDetailActivity.this.mPresenter).a(str, RankingDetailActivity.this.mContext, SocializeMedia.MORESHARE, RankingDetailActivity.this);
}
} else if (as.i(RankingDetailActivity.this.mContext, "com.sina.weibo")) {
i2 = 5;
((h) RankingDetailActivity.this.mPresenter).a(str, RankingDetailActivity.this.mContext, SocializeMedia.SINA, RankingDetailActivity.this);
} else {
cg.a(RankingDetailActivity.this.mContext, w.e(RankingDetailActivity.this.mContext, "share_sdk_not_install_wb"));
}
} else if (as.i(RankingDetailActivity.this.mContext, "com.tencent.mobileqq") || as.i(RankingDetailActivity.this.mContext, "com.tencent.tim")) {
((h) RankingDetailActivity.this.mPresenter).a(str, RankingDetailActivity.this.mContext, SocializeMedia.QQ, RankingDetailActivity.this);
i2 = 4;
} else {
cg.a(RankingDetailActivity.this.mContext, w.e(RankingDetailActivity.this.mContext, "share_sdk_not_install_qq"));
}
} else if (as.i(RankingDetailActivity.this.mContext, "com.tencent.mobileqq") || as.i(RankingDetailActivity.this.mContext, "com.tencent.tim")) {
i2 = 3;
((h) RankingDetailActivity.this.mPresenter).a(str, RankingDetailActivity.this.mContext, SocializeMedia.QZONE, RankingDetailActivity.this);
} else {
cg.a(RankingDetailActivity.this.mContext, w.e(RankingDetailActivity.this.mContext, "share_sdk_not_install_qq"));
}
} else if (as.i(RankingDetailActivity.this.mContext, "com.tencent.mm")) {
((h) RankingDetailActivity.this.mPresenter).a(str, RankingDetailActivity.this.mContext, SocializeMedia.WEIXIN, RankingDetailActivity.this);
i2 = 2;
} else {
cg.a(RankingDetailActivity.this.mContext, w.e(RankingDetailActivity.this.mContext, "share_sdk_not_install_wechat"));
}
} else if (as.i(RankingDetailActivity.this.mContext, "com.tencent.mm")) {
i2 = 1;
((h) RankingDetailActivity.this.mPresenter).a(str, RankingDetailActivity.this.mContext, SocializeMedia.WEIXIN_MONMENT, RankingDetailActivity.this);
} else {
cg.a(RankingDetailActivity.this.mContext, w.e(RankingDetailActivity.this.mContext, "share_sdk_not_install_wechat"));
}
if (i2 != 0) {
StatisticsGS.getInstance().uploadUserAction(RankingDetailActivity.this.mContext, 101, i2, str);
}
}
};
private com.excelliance.kxqp.gs.i.d bJ = new com.excelliance.kxqp.gs.i.d() {
@Override
public void a(View view, Object obj, int i) {
RankingDetailActivity.this.a(obj);
}
};
private b.a bK = new b.a() {
@Override
public void a(ExcellianceAppInfo excellianceAppInfo) {
AppGoodsBean appGoodsBean = new AppGoodsBean();
appGoodsBean.f7523a = excellianceAppInfo.getAppPackageName();
appGoodsBean.f7524b = excellianceAppInfo.appName;
appGoodsBean.c = excellianceAppInfo.getAppIconPath();
RankingDetailActivity.this.a(appGoodsBean, excellianceAppInfo);
}
};
private final Object bM = new Object();
private float bN = 10000.0f;
private String bO = null;
private boolean bP = false;
private boolean bQ = false;
private int bR = -1;
@Override
public String getLayoutName() {
return "activity_ranking_detail";
}
@Override
public void onCreate(Bundle bundle) {
super.onCreate(bundle);
initCurrentPageDes();
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(this.mContext.getPackageName() + VersionManager.q);
intentFilter.addAction(this.mContext.getPackageName() + ".user_login_in");
intentFilter.addAction(this.mContext.getPackageName() + ".action_download_game");
this.mContext.registerReceiver(this.bC, intentFilter);
Log.d("RankingDetailActivity", String.format("RankingDetailActivity/onCreate:thread(%s)", Thread.currentThread().getName()));
this.am = (RankingDetailViewModel) ViewModelProviders.of(this).get(RankingDetailViewModel.class);
this.am.a(com.excelliance.kxqp.repository.a.a(this));
this.am.a().observe(this, new Observer<List<ExcellianceAppInfo>>() {
@Override
public void onChanged(List<ExcellianceAppInfo> list) {
if (RankingDetailActivity.this.au != null) {
RankingDetailActivity.this.au.c(list);
}
}
});
this.c = new com.excelliance.kxqp.gs.newappstore.b.b(this.mContext);
i();
if ("globalSearch".equals(this.R) && com.excelliance.kxqp.gs.util.b.ch(this.mContext)) {
h();
}
com.excelliance.kxqp.gs.g.c.a().g(this.mContext);
j();
}
@Override
public void initCurrentPageDes() {
this.mPageDes = new PageDes();
this.mPageDes.firstPage = "详情页";
}
private void h() {
this.bj = com.excelliance.kxqp.bitmap.ui.b.a().a(SearchListFragment.a.class).b((io.reactivex.d.d) new io.reactivex.d.d<SearchListFragment.a>() {
@Override
public void accept(final SearchListFragment.a aVar) throws Exception {
tp.i(new Runnable() {
@Override
public void run() {
NativeAppInfo nativeAppInfo = aVar.f11077a;
String pkgName = nativeAppInfo != null ? nativeAppInfo.getPkgName() : "";
if (RankingDetailActivity.this.p == null || !TextUtils.equals(RankingDetailActivity.this.p.appPackageName, pkgName) || RankingDetailActivity.this.p.downloadStatus != 0 || bs.s(RankingDetailActivity.this.p.getAppPackageName())) {
return;
}
if ("added_package".equals(aVar.f11078b)) {
RankingDetailActivity.this.bk = true;
RankingDetailActivity.this.l();
} else if ("removed_package".equals(aVar.f11078b)) {
RankingDetailActivity.this.bk = false;
RankingDetailActivity.this.l();
}
}
});
}
});
}
private void i() {
this.bg = com.excelliance.kxqp.bitmap.ui.b.a().a(i.c.class).b((io.reactivex.d.d) new io.reactivex.d.d<i.c>() {
@Override
public void accept(i.c cVar) {
if (RankingDetailActivity.this.p != null) {
RankingDetailActivity.this.p.setSubscribeState(cVar.a().subscribeState);
RankingDetailActivity.this.k();
}
}
});
}
private void j() {
this.bh = com.excelliance.kxqp.bitmap.ui.b.a().b(i.b.class).b((io.reactivex.d.d) new io.reactivex.d.d<i.b>() {
@Override
public void accept(i.b bVar) throws Exception {
if (RankingDetailActivity.this.p != null) {
RankingDetailActivity.this.p.setSubscribeState(1);
RankingDetailActivity.this.k();
com.excelliance.kxqp.bitmap.ui.d.a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.p);
com.excelliance.kxqp.bitmap.ui.b.a().c(i.b.class);
}
}
});
}
public void k() {
if (this.p == null || this.p.subscribe != 1) {
return;
}
int subscribeState = this.p.getSubscribeState();
String stateName = RankingItem.getStateName(this.mContext, this.p, this.bq);
this.f.setCurrentText(stateName);
this.f.setTextColor(w.a(this.mContext, subscribeState == 1 ? "white_view" : "new_main_color"));
this.f.setBackgroundBorderColor(w.a(this.mContext, subscribeState == 1 ? "white_view" : "new_main_color"));
if (com.excean.ab_builder.c.a.R(this.mContext)) {
this.aY.setCurrentText(stateName);
this.aR.setCurrentText(stateName);
} else if (com.excean.ab_builder.c.a.S(this.mContext)) {
this.aX.setCurrentText(stateName);
}
}
@Override
public void initOther() {
this.G = getIntent().getStringExtra("key");
this.S = getIntent().getStringExtra(WebActionRouter.KEY_PKG);
this.T = getIntent().getStringExtra(ParamKeyConstants.WebViewConstants.QUERY_FROM);
this.R = getIntent().getStringExtra("sourceFrom");
this.bl = getIntent().getStringExtra("categoryString");
if (TextUtils.isEmpty(this.R)) {
this.R = "other";
}
this.bi = getIntent().getIntExtra("position", 0);
t();
if ("globalSearch".equals(this.R)) {
this.aG = getIntent().getStringExtra("search_word");
}
this.aq = getIntent().getIntExtra("sourceFrom_market", 0);
this.ar = getIntent().getBooleanExtra("from_banner", false);
this.bs = getIntent().getIntExtra("max_show_times", 0);
this.bt = getIntent().getStringExtra("sence");
this.bu = getIntent().getStringExtra("sSence");
this.bv = getIntent().getStringExtra("tencentPosition");
this.bw = getIntent().getStringExtra("tencentGameId");
}
@Override
@RequiresApi(api = 23)
public void initId() {
this.V = (FrameLayout) findId("fl_header_container");
if (com.excelliance.kxqp.gs.util.b.au(this.mContext)) {
this.V.addView(w.b(this.mContext, "header_ranking_content_new"));
this.W = (TextView) findId("tv_rank");
this.X = (TextView) findId("tv_rank_name");
this.Y = (TextView) findId("tv_download_count");
this.Z = (LinearLayout) findId("ll_rank_info");
this.ab = findId("rl_ranking");
this.aa = (ExTextView) findId("tv_edit_content");
this.as = findId("ll_recommend_container");
this.at = (RecyclerView) findId("recycler_game_list");
this.az = findId("v_line_recommend_app");
this.aE = findId("v_header_line");
} else {
this.V.addView(w.b(this.mContext, "header_ranking_content"));
}
this.av = findId("ll_third_link_container");
this.aA = this.V.findViewById(R.id.ll_link_official_container);
this.aL = this.V.findViewById(R.id.ll_lol_question_container);
this.aM = (TextView) this.V.findViewById(R.id.lol_link_content);
this.aw = (RecyclerView) findId("third_link_recycler");
this.aI = findId("ll_gift_pack");
this.aJ = (RecyclerView) findId("gift_pack_recycler");
this.ay = (TextView) findId("link_title");
this.H = (LinearLayout) findId("title_bar_top");
this.K = findId("fe_group");
this.I = (ImageView) findId("iv_game");
this.M = (ImageView) findId("iv_follow");
this.l = (ImageView) findId("iv_game_icon");
this.k = (TextView) findId("tv_app_name");
this.j = (TextView) findId("tv_publisher");
this.i = (TextView) findId("tv_developer");
this.h = (TextView) findId("tv_gp_score");
this.g = (TextView) findId("tv_xs_score");
this.w = (CoordinatorLayout) findId("coordinatorLayout");
this.x = (AppBarLayout) findId("appbar");
this.F = (TextView) findId("tv_generalize");
this.m = (NiceVideoPlayer) findId("videoPlayer");
this.f = (DownloadProgressButton) findId("pg_download");
this.f14253a = findId("fl_bottom_layout");
this.U = (ProgressButton) findId("progress_button");
this.u = (TextView) findId("tv_download_status");
this.ak = (ImageView) findId("iv_back");
this.al = (TextView) findId("tv_name");
this.an = (LinearLayout) findId("title_bar_top_with_behavior");
this.ao = (ImageView) this.an.findViewById(this.mContext.getResources().getIdentifier("iv_back", "id", getPackageName()));
this.ap = (TextView) this.an.findViewById(this.mContext.getResources().getIdentifier("tv_name", "id", getPackageName()));
this.r = (ImageView) this.an.findViewById(R.id.btn_share);
this.r.setVisibility(0);
this.r.setTag(8);
this.q = (Button) findIdAndSetTag("btn_follow", 7);
this.aH = (Button) this.V.findViewById(R.id.btn_strategy);
this.e = (Button) findIdAndSetTag("btn_download", 6);
this.F.setVisibility(8);
this.f.setEnablePause(true);
this.q.setSelected(true);
this.r.setSelected(true);
this.s = (ImageView) findIdAndSetTag("iv_share", 8);
this.t = (ImageView) findIdAndSetTag("iv_like", 9);
this.aS = findId("ll_action_root");
if (com.excean.ab_builder.c.a.n(this.mContext)) {
this.f.setButtonRadius(com.excelliance.kxqp.gs.util.ad.a(this.mContext, 13.0f));
}
if (com.excelliance.kxqp.gs.util.b.as(this.mContext)) {
this.e.setVisibility(0);
this.f14253a.setVisibility(0);
this.f.setVisibility(8);
this.e.setOnClickListener(this);
}
this.y = (ViewGroup) findId("layout_fix_subscribe");
this.z = (TextView) findId("tv_fix_subscribe");
this.A = (ViewGroup) findId("layout_qq_group");
this.B = (ViewGroup) findId("layout_waiter");
this.D = (TextView) findId("tv_join_waiter_group");
this.C = (TextView) findId("tv_qq_group_num");
this.E = (TextView) findId("tv_qq_group_operate");
this.aZ = findId("ll_play");
if (com.excelliance.kxqp.gs.util.b.bE(this.mContext)) {
this.r.setVisibility(8);
this.s.setVisibility(0);
this.t.setVisibility(0);
this.s.setOnClickListener(this);
this.t.setOnClickListener(this);
} else {
this.r.setVisibility(0);
this.s.setVisibility(8);
this.t.setVisibility(8);
}
r();
n();
s();
if (com.excelliance.kxqp.gs.newappstore.b.c.a(this.mContext)) {
this.H.setBackgroundColor(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
this.u.setTextColor(com.excelliance.kxqp.gs.newappstore.b.c.f7694a);
}
this.aN = (LinearLayout) findViewById(R.id.entrances_layout_parent);
this.aQ = (TextView) findViewById(R.id.ranking);
this.aQ.setTag(10);
this.aQ.setOnClickListener(this);
this.aO = (LinearLayout) findViewById(R.id.layout_game_group);
this.aP = findViewById(R.id.iv_game_group);
if (com.excean.ab_builder.c.a.R(getContext())) {
this.f.setVisibility(8);
this.u.setVisibility(8);
this.aR = (DownloadProgressButton) this.an.findViewById(R.id.title_download);
this.aR.setButtonRadius(com.excelliance.kxqp.gs.util.ad.a(this.mContext, 13.0f));
this.aR.setEnablePause(true);
this.aU = (LinearLayout) this.V.findViewById(R.id.ll_mid_download);
this.aV = (LinearLayout) this.V.findViewById(R.id.ll_download_state);
this.aY = (DownloadProgressButton) this.V.findViewById(R.id.mid_download);
this.aW = (RelativeLayout) this.V.findViewById(R.id.rl_old_layout);
this.aW.setVisibility(8);
this.aV.setVisibility(8);
this.aY.setEnablePause(true);
return;
}
if (com.excean.ab_builder.c.a.S(this.mContext)) {
this.u.setVisibility(8);
this.f.setVisibility(8);
this.aV = (LinearLayout) this.V.findViewById(R.id.ll_download_state);
this.aT = (LinearLayout) findId("ll_bottom_download");
this.aX = (DownloadProgressButton) findId("bottom_download");
this.aX.setEnablePause(true);
this.aV.setVisibility(8);
}
}
public void l() {
if (!com.excelliance.kxqp.gs.download.b.a().a(this.p.buttonStatus) && this.p.subscribe != 1) {
c(8);
return;
}
if (com.excean.ab_builder.c.a.R(this.mContext)) {
this.aU.setVisibility(0);
DownloadProgressButton downloadProgressButton = this.f;
this.f = this.aY;
v();
this.f = this.aR;
v();
return;
}
if (com.excean.ab_builder.c.a.S(this.mContext)) {
this.aT.setVisibility(0);
this.f = this.aX;
v();
return;
}
v();
}
public void m() {
int a2 = com.excelliance.kxqp.gs.util.ad.a(this.mContext, 74.0f);
int[] iArr = new int[2];
if (this.aU != null && this.aU.getVisibility() == 0) {
this.aU.getLocationInWindow(iArr);
if (a2 > this.aU.getHeight() + iArr[1]) {
this.aR.setVisibility(this.aY.getVisibility());
this.al.setGravity(3);
} else {
this.aR.setVisibility(8);
this.al.setGravity(1);
}
}
}
private void n() {
this.ac = (ImagePagerIndicator) findId("image_indicator");
this.ad = (RankingDetailIndicator) findId("ranking_indicator");
this.aj = findId("indicator_line");
this.ae = (ViewPager) findId("view_pager");
this.bx = new RankingDetailFragment();
Bundle bundle = new Bundle();
bundle.putString("key_type", this.G);
bundle.putString("gamePackageName", this.S);
this.bx.setArguments(bundle);
this.aj.setVisibility(0);
this.ae.setVisibility(0);
this.ah = new ArrayList();
this.ai = new ArrayList();
this.ah.add(this.bx);
this.ai.add("详情");
if (com.excelliance.kxqp.gs.util.b.az(this.mContext)) {
o();
} else if (com.excelliance.kxqp.gs.util.b.bk(this.mContext)) {
p();
} else {
q();
}
this.aj.setVisibility(this.ai.size() <= 1 ? 8 : 0);
this.bf = new FragmentStatePagerAdapter(getSupportFragmentManager()) {
@Override
public int getItemPosition(@NonNull Object obj) {
return -2;
}
@Override
public int getCount() {
return RankingDetailActivity.this.ah.size();
}
@Override
public Fragment getItem(int i) {
return (Fragment) RankingDetailActivity.this.ah.get(i);
}
@Override
@Nullable
public CharSequence getPageTitle(int i) {
return (CharSequence) RankingDetailActivity.this.ai.get(i);
}
};
this.ae.setAdapter(this.bf);
}
private void o() {
this.ac.setVisibility(0);
this.ad.setVisibility(8);
this.ac.setIndicatorWidth(com.excelliance.kxqp.gs.util.ad.a(this.mContext, 55.0f));
this.ac.setIndicatorHeight(com.excelliance.kxqp.gs.util.ad.a(this.mContext, 3.0f));
this.ac.a((String[]) this.ai.toArray(new String[0]), 14.0f);
this.ac.a(this.ae, 0);
this.ac.invalidate();
this.ac.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrollStateChanged(int i) {
}
@Override
public void onPageScrolled(int i, float f, int i2) {
}
@Override
public void onPageSelected(int i) {
RankingDetailActivity.this.b(i);
}
});
this.ae.setOffscreenPageLimit(3);
}
private void p() {
this.ac.setVisibility(8);
this.ad.setVisibility(0);
this.d = new CommentFragment();
Bundle bundle = new Bundle();
bundle.putString("pkgName", this.S);
this.d.setArguments(bundle);
this.ah.add(this.d);
this.ai.add("评论");
this.ad.setIndicatorWidth(com.excelliance.kxqp.gs.util.ad.a(this.mContext, 55.0f));
this.ad.setIndicatorHeight(com.excelliance.kxqp.gs.util.ad.a(this.mContext, 3.0f));
this.ad.a((String[]) this.ai.toArray(new String[0]), new String[this.ai.size()], 16.0f, 12.0f);
this.ad.a(this.ae, 0);
this.ad.invalidate();
this.ad.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
@Override
public void onPageScrollStateChanged(int i) {
}
@Override
public void onPageScrolled(int i, float f, int i2) {
}
@Override
public void onPageSelected(int i) {
RankingDetailActivity.this.b(i);
}
});
this.ae.setOffscreenPageLimit(2);
}
public void b(int i) {
if (i > this.ah.size() - 1) {
return;
}
Fragment fragment = this.ah.get(i);
if (fragment instanceof CommentFragment) {
bz.a().a(this.mContext, 60000, 1, "点击评论");
} else if (fragment instanceof StrategyFragment) {
bz.a().a(this.mContext, 60000, 2, "点击攻略");
}
}
private void q() {
this.ad.setVisibility(8);
this.ac.setVisibility(8);
((AppBarLayout.LayoutParams) ((ViewGroup) findViewByName("ll_header")).getLayoutParams()).setScrollFlags(1);
}
private void r() {
int i = this.mContext.getResources().getDisplayMetrics().widthPixels;
FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) this.m.getLayoutParams();
layoutParams.height = (int) (i * 0.5625f);
layoutParams.width = i;
this.I.setLayoutParams(layoutParams);
this.m.setLayoutParams(layoutParams);
this.m.setPlayerType(222);
this.n = new j(this);
this.m.setController(this.n);
}
private void s() {
this.x.addOnOffsetChangedListener(new AppBarLayout.OnOffsetChangedListener() {
@Override
public void onOffsetChanged(AppBarLayout appBarLayout, int i) {
if (Math.abs(i) >= com.excelliance.kxqp.gs.util.ad.a(RankingDetailActivity.this.mContext, 160.0f)) {
RankingDetailActivity.this.n.g();
}
RankingDetailActivity.this.O = Math.abs(i);
if (com.excean.ab_builder.c.a.R(RankingDetailActivity.this.mContext)) {
RankingDetailActivity.this.m();
}
}
});
this.q.setOnClickListener(this);
this.r.setOnClickListener(this);
this.n.setShareClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
cg.a(RankingDetailActivity.this.mContext, "分享");
}
});
this.ak.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RankingDetailActivity.this.onBackPressed();
}
});
this.ao.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RankingDetailActivity.this.onBackPressed();
}
});
this.z.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Runnable runnable = new Runnable() {
@Override
public void run() {
((h) RankingDetailActivity.this.mPresenter).c(RankingDetailActivity.this.o.getPkgname());
}
};
b.a(RankingDetailActivity.this.mContext, new Runnable() {
@Override
public void run() {
}
}, runnable);
}
});
}
private void t() {
if (TextUtils.isEmpty(this.R)) {
return;
}
this.be = bz.a().a(this.R);
}
public void b(String str) {
if (this.ag) {
int c = by.a(this.mContext, "global_config").c("sp_key_download_guide_tip_display", 0);
boolean booleanValue = by.a(this.mContext, "global_config").b("sp_key_download_guide_tip_display" + str, false).booleanValue();
if (c >= 5 || booleanValue) {
return;
}
Toast toast = new Toast(this.mContext);
TextView textView = new TextView(this.mContext);
textView.setPadding(com.excelliance.kxqp.gs.util.ad.a(this.mContext, 10.0f), com.excelliance.kxqp.gs.util.ad.a(this.mContext, 5.0f), com.excelliance.kxqp.gs.util.ad.a(this.mContext, 10.0f), com.excelliance.kxqp.gs.util.ad.a(this.mContext, 5.0f));
textView.setAlpha(0.7f);
textView.setBackgroundResource(w.j(this.mContext, "bg_crape"));
textView.setTextColor(-1);
textView.setTextSize(2, 14.0f);
textView.setText(w.e(this.mContext, "download_guide_msg"));
toast.setView(textView);
int[] iArr = new int[2];
this.f.getLocationOnScreen(iArr);
toast.setGravity(48, iArr[0], (int) (iArr[1] - (this.f.getHeight() * 2.5f)));
toast.show();
by.a(this.mContext, "global_config").a("sp_key_download_guide_tip_display", c + 1);
by.a(this.mContext, "global_config").a("sp_key_download_guide_tip_display" + str, true);
}
}
@Override
public h initPresenter() {
return new h(this.mContext.getApplicationContext(), this);
}
@Override
public void initAfterPresenter() {
if (TextUtils.equals("ranking_list", this.T)) {
this.P = true;
}
if (TextUtils.isEmpty(this.S)) {
return;
}
((h) this.mPresenter).a(this.S);
if (com.excelliance.kxqp.gs.util.b.cA(this.mContext)) {
((h) this.mPresenter).e(this.S);
}
if (com.excean.ab_builder.c.a.Q(this.mContext)) {
((h) this.mPresenter).f(this.S);
}
}
public void u() {
Log.d("RankingDetailActivity", " mAppInfo" + this.p);
if (this.p != null && this.p.haveApkInstalled() && this.p.market_install_local == 1) {
Log.d("RankingDetailActivity", " 1 mAppInfo" + this.p);
this.p.setGameType("7");
this.p.setDownloadProgress(0);
this.p.setDownloadStatus(0);
this.p.setFree(this.aB);
this.p.buttonStatus = this.aC;
this.p.buttonText = this.aD;
a(this.p, this.bp);
a(this.p.getDownloadProgress(), this.p.getDownloadStatus());
}
}
@Override
public void onResume() {
super.onResume();
this.ag = true;
Log.d("RankingDetailActivity", String.format("RankingDetailActivity/onResume:thread(%s)", Thread.currentThread().getName()));
if (!TextUtils.isEmpty(this.S)) {
this.am.a(this.S).observe(this, this.bD);
}
if (com.excelliance.kxqp.gs.util.b.bh(this.mContext) && !TextUtils.isEmpty(this.S) && !bs.s(this.S)) {
this.am.b(this.S).observe(this, this.bE);
}
if (!TextUtils.isEmpty(this.R) && !TextUtils.isEmpty(this.S)) {
if (TextUtils.isEmpty(this.bl)) {
bz.a().b(this.mContext, this.R, this.S);
} else {
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("typeId", this.bl);
if (!TextUtils.isEmpty(this.T) && "ranking_list".equals(this.T)) {
bz.a().a(this.mContext, 3000, "进入更多列表中一款游戏的详情", jSONObject.toString());
} else {
bz.a().a(this.mContext, 3000, 1, "进入商店页中一款游戏的详情", jSONObject.toString());
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}
if (this.p != null && this.p.haveApkInstalled() && this.p.market_install_local == 1 && !bs.s(this.S)) {
az.i("RankingDetailActivity", "rankdetail uploadMarketAppAndRemoveMarketNoshort pkg:" + this.p.getAppPackageName());
as.L(this.mContext.getApplicationContext());
}
if (by.a(this.mContext, "sp_config").b("sp_key_is_back_from_add_friends_mini_program", false).booleanValue()) {
com.excelliance.kxqp.bitmap.ui.d.a(this.mContext);
}
}
@Override
public void onPause() {
super.onPause();
if (!TextUtils.isEmpty(this.S)) {
this.am.a(this.S).removeObserver(this.bD);
}
if (com.excelliance.kxqp.gs.util.b.bh(this.mContext) && !TextUtils.isEmpty(this.S) && !bs.s(this.S)) {
this.am.b(this.S).removeObserver(this.bE);
}
this.ag = false;
}
public void a(ExcellianceAppInfo excellianceAppInfo, BiEventAppButtonClick biEventAppButtonClick) {
excellianceAppInfo.exchangePageDes(this.mPageDes, -1);
if (biEventAppButtonClick != null) {
excellianceAppInfo.appUpdateTime = biEventAppButtonClick.game_update_time;
excellianceAppInfo.datafinder_game_id = biEventAppButtonClick.get__itemsFirst("game");
try {
excellianceAppInfo.serverVc = Integer.valueOf(biEventAppButtonClick.game_version).intValue();
} catch (Exception unused) {
}
}
}
private void a(RankingDetailInfo rankingDetailInfo, BiEventAppButtonClick biEventAppButtonClick) {
if (biEventAppButtonClick == null || rankingDetailInfo == null) {
return;
}
biEventAppButtonClick.game_update_time = rankingDetailInfo.appUpdateTime;
biEventAppButtonClick.set__items("game", rankingDetailInfo.datafinder_game_id);
biEventAppButtonClick.game_version = rankingDetailInfo.apk_update_version + "";
}
private void a(ExcellianceAppInfo excellianceAppInfo, BiEventAppButtonClick biEventAppButtonClick, RankingDetailInfo rankingDetailInfo) {
a(rankingDetailInfo, biEventAppButtonClick);
a(excellianceAppInfo, biEventAppButtonClick);
this.bp = com.excelliance.kxqp.gs.g.c.a(excellianceAppInfo, excellianceAppInfo.fromPageAreaPosition, excellianceAppInfo.fromPage, this.bp.expose_banner_area);
}
public void a(ExcellianceAppInfo excellianceAppInfo) {
this.bp.expose_banner_area = excellianceAppInfo.fromPageArea;
if (com.excean.ab_builder.c.a.R(this.mContext)) {
if (this.aR.getVisibility() == 0) {
this.bp.expose_banner_area = "详情页顶部";
return;
} else {
this.bp.expose_banner_area = "详情页中间";
return;
}
}
if (com.excean.ab_builder.c.a.S(this.mContext) && this.aT.getVisibility() == 0) {
this.bp.expose_banner_area = "详情页底部";
}
}
private void a(RankingDetailInfo rankingDetailInfo) {
if (rankingDetailInfo == null) {
return;
}
az.i("RankingDetailActivity", "handleLoadData isLy:" + rankingDetailInfo.isOpLy);
this.o = rankingDetailInfo;
if (this.p == null) {
this.aF = (ExcellianceAppInfo) com.excelliance.kxqp.repository.a.a(rankingDetailInfo.getAppInfo());
this.p = rankingDetailInfo.getAppInfo();
az.i("RankingDetailActivity", "handleLoadData appinfo isLy:" + this.p.isLy);
}
if (this.o.getAppInfo() != null) {
this.p.setFree(this.o.getAppInfo().free);
this.p.apkFrom = this.o.getAppInfo().apkFrom;
this.p.isWhite = this.o.getAppInfo().isWhite;
this.p.isLy = this.o.isOpLy;
this.p.downloadButtonVisible = this.o.getAppInfo().downloadButtonVisible;
this.aB = this.o.getAppInfo().free;
this.p.buttonStatus = this.o.buttonStatus;
this.p.buttonText = this.o.buttonText;
this.p.webUrl = this.o.webUrl;
this.p.noDLAntiAddiction = this.o.noDLAntiAddiction;
this.p.qrcode = this.o.qrcode;
this.p.position = this.bi;
this.p.buttonStatus = this.o.buttonStatus;
this.p.buttonText = this.o.buttonText;
this.aC = this.o.buttonStatus;
this.aD = this.o.buttonText;
}
a(this.p, this.bp, this.o);
if (!bs.s(this.p.getAppPackageName()) && com.excelliance.kxqp.gs.util.b.ch(this.mContext) && this.p.downloadStatus == 0 && "globalSearch".equals(this.R)) {
Iterator<AddGameBean> it = com.excelliance.kxqp.gs.l.f.a(this.mContext).b().iterator();
while (true) {
if (!it.hasNext()) {
break;
} else if (it.next().packageName.equals(this.p.appPackageName)) {
this.bk = true;
break;
}
}
}
w();
this.bd = false;
if (this.mContext != null) {
com.bumptech.glide.i.b(this.mContext.getApplicationContext()).a(rankingDetailInfo.getIcon()).a(new com.bumptech.glide.d.d.a.e(this.mContext), new com.excelliance.kxqp.widget.c(this.mContext, 12)).c(w.j(this.mContext, "icon_default")).d(w.j(this.mContext, "icon_default")).a(this.l);
}
e(rankingDetailInfo.mGiftPackBeanList);
if (com.excelliance.kxqp.gs.download.b.a().c(rankingDetailInfo.buttonStatus) && rankingDetailInfo.thirdLink != null && rankingDetailInfo.thirdLink.size() > 0 && !x.a(this.mContext)) {
az.d("RankingDetailActivity", String.format("VIVOChannelControlHelper/isControl:thirdLink", Thread.currentThread().getName()));
if (!bs.s(this.p.getAppPackageName())) {
d(rankingDetailInfo.thirdLink);
this.bc = true;
this.p.hasThirdDomin = 1;
}
} else if (x.a(this.mContext)) {
I();
}
b(this.o);
if (!x.a(this.mContext)) {
this.bd = RankingItem.getImportStatus(this.mContext, this.p);
}
if (com.excelliance.kxqp.gs.util.b.bA(this.mContext) && this.o.hasOnlineStrategy == 1) {
this.aH.setVisibility(0);
this.aH.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
StrategyInfo strategyInfo = new StrategyInfo();
strategyInfo.apkIcon = RankingDetailActivity.this.p.getAppIconPath();
strategyInfo.name = RankingDetailActivity.this.p.appName;
strategyInfo.newsLink = RankingDetailActivity.this.o.newsLink;
strategyInfo.star = RankingDetailActivity.this.p.getStar();
strategyInfo.title = RankingDetailActivity.this.o.getDesc();
strategyInfo.video = RankingDetailActivity.this.o.strategyVideo;
strategyInfo.videoSize = RankingDetailActivity.this.o.getStrategyVideosize();
strategyInfo.titlePic = RankingDetailActivity.this.o.strategyTitlePic;
strategyInfo.pkgName = RankingDetailActivity.this.p.getAppPackageName();
StrategyDetailActivity.a(RankingDetailActivity.this.mContext, strategyInfo, 2);
}
});
} else {
this.aH.setVisibility(8);
}
y();
z();
A();
B();
C();
if (com.excelliance.kxqp.gs.util.b.au(this.mContext)) {
com.excelliance.kxqp.ui.util.b.a(this.aa, this.o.getDesc(), this.mContext, this.o);
if (!TextUtils.isEmpty(this.o.getDesc()) && this.o.getDesc().contains("小编推荐")) {
com.excelliance.kxqp.gs.g.c.a().a((View) this.aa, true, this.exposure, this.mViewTrackerRxBus, this.mCompositeDisposable, this.o.getAppInfo(), 0, "文章");
this.aa.manualAttachTrackHandler();
}
}
this.al.setText(rankingDetailInfo.getName());
this.ap.setText(rankingDetailInfo.getName());
this.k.setText(rankingDetailInfo.getName());
Log.d("RankingDetailActivity", "handleLoadData: mAppInfo.downloadButtonVisible:" + this.p.downloadButtonVisible + ",hasThirdLink:" + this.bc + ",hasImported:" + this.bd + ",status:" + this.p.downloadStatus);
l();
TextView textView = this.j;
StringBuilder sb = new StringBuilder();
sb.append(w.e(this.mContext, "ranking_detail_distributors_name_tv"));
sb.append(rankingDetailInfo.getPublisher());
textView.setText(sb.toString());
this.i.setText(w.e(this.mContext, "ranking_detail_developers_name_tv") + rankingDetailInfo.getDeveloper());
if (com.excelliance.kxqp.gs.util.b.au(this.mContext)) {
this.h.setText(rankingDetailInfo.getGp_score() + "/5.0");
} else {
this.h.setText("GP:" + rankingDetailInfo.getGp_score());
this.g.setText("XS:" + rankingDetailInfo.getXs_score());
}
if (com.excelliance.kxqp.gs.util.b.bk(this.mContext)) {
float xs_score = (rankingDetailInfo.getXs_score() > 0.0f ? rankingDetailInfo.getXs_score() : rankingDetailInfo.getGp_score()) * 2.0f;
if (com.excelliance.kxqp.gs.util.b.au(this.mContext)) {
((TextView) findId("tv_gp_label")).setText("评分");
this.h.setText(String.valueOf(xs_score));
} else {
this.h.setText("评分:" + xs_score);
}
}
Intent intent = new Intent(this.mContext.getPackageName() + ".action_ranking_detail_refresh_ranking_info");
intent.putExtra("appInfo", rankingDetailInfo);
intent.putExtra("gamePackageName", this.S);
LocalBroadcastManager.getInstance(this.mContext).sendBroadcast(intent);
if (!cd.a(rankingDetailInfo.getId())) {
this.N = rankingDetailInfo.getId();
Log.d("RankingDetailActivity", "appid = " + this.N);
}
if (TextUtils.isEmpty(this.N)) {
this.q.setVisibility(8);
}
if (!cd.a(rankingDetailInfo.getVideoUrl())) {
this.n.setVideoSource(rankingDetailInfo.getVideoUrl());
}
String imageSize = rankingDetailInfo.getImageSize();
this.m.setVisibility(cd.a(rankingDetailInfo.getVideoUrl()) ? 4 : 0);
if (bf.a(this.mContext) && !cd.a(rankingDetailInfo.getVideoUrl())) {
this.L = true;
this.H.setVisibility(8);
if (!cd.a(rankingDetailInfo.getTitlepic())) {
if (this.mContext != null) {
com.bumptech.glide.i.b(this.mContext.getApplicationContext()).a(rankingDetailInfo.getTitlepic()).d(w.j(this.mContext, "ic_ranking_temp")).c(w.j(this.mContext, "ic_ranking_temp")).a(this.I);
}
this.n.a();
this.m.setVolume(0);
} else if (!cd.a(rankingDetailInfo.getImglist())) {
if (!cd.a(imageSize)) {
List<e> b2 = b(imageSize.split(StatisticsManager.COMMA));
if (b2.get(0) != null) {
e eVar = b2.get(0);
if (eVar.a() < eVar.b()) {
String[] split = rankingDetailInfo.getImglist().split(StatisticsManager.COMMA);
if (this.mContext != null) {
com.bumptech.glide.i.b(this.mContext.getApplicationContext()).a(split[0]).d(w.j(this.mContext, "ic_ranking_temp")).c(w.j(this.mContext, "ic_ranking_temp")).a(this.I);
}
}
}
this.n.a();
this.m.setVolume(0);
} else {
this.J = rankingDetailInfo.getImglist().split(StatisticsManager.COMMA);
if (this.J.length > 0) {
a(this.J);
}
}
}
} else if (bf.b(this.mContext) && !cd.a(rankingDetailInfo.getVideoUrl())) {
this.L = true;
this.H.setVisibility(8);
if (!cd.a(rankingDetailInfo.getTitlepic())) {
if (this.mContext != null) {
com.bumptech.glide.i.b(this.mContext.getApplicationContext()).a(rankingDetailInfo.getTitlepic()).d(w.j(this.mContext, "ic_ranking_temp")).c(w.j(this.mContext, "ic_ranking_temp")).a(this.I);
}
} else if (!cd.a(rankingDetailInfo.getImglist())) {
if (!cd.a(imageSize)) {
List<e> b3 = b(imageSize.split(StatisticsManager.COMMA));
if (b3.get(0) != null) {
e eVar2 = b3.get(0);
if (eVar2.a() < eVar2.b()) {
String[] split2 = rankingDetailInfo.getImglist().split(StatisticsManager.COMMA);
if (this.mContext != null) {
com.bumptech.glide.i.b(this.mContext.getApplicationContext()).a(split2[0]).d(w.j(this.mContext, "ic_ranking_temp")).c(w.j(this.mContext, "ic_ranking_temp")).a(this.I);
}
}
}
} else {
this.J = rankingDetailInfo.getImglist().split(StatisticsManager.COMMA);
if (this.J.length > 0) {
a(this.J);
}
}
}
} else if (cd.a(rankingDetailInfo.getVideoUrl())) {
if (!cd.a(rankingDetailInfo.getTitlepic())) {
this.H.setVisibility(8);
if (this.mContext != null) {
com.bumptech.glide.i.b(this.mContext.getApplicationContext()).a(rankingDetailInfo.getTitlepic()).d(w.j(this.mContext, "ic_ranking_temp")).c(w.j(this.mContext, "ic_ranking_temp")).a(this.I);
}
} else if (!cd.a(rankingDetailInfo.getImglist())) {
if (!cd.a(imageSize)) {
List<e> b4 = b(imageSize.split(StatisticsManager.COMMA));
if (b4 != null && b4.size() > 0 && b4.get(0) != null) {
e eVar3 = b4.get(0);
if (eVar3.a() < eVar3.b()) {
this.H.setVisibility(8);
String[] split3 = rankingDetailInfo.getImglist().split(StatisticsManager.COMMA);
if (this.mContext != null) {
com.bumptech.glide.i.b(this.mContext.getApplicationContext()).a(split3[0]).d(w.j(this.mContext, "ic_ranking_temp")).c(w.j(this.mContext, "ic_ranking_temp")).a(this.I);
}
} else {
this.K.setVisibility(8);
this.an.setVisibility(8);
this.H.setVisibility(0);
}
} else {
this.J = rankingDetailInfo.getImglist().split(StatisticsManager.COMMA);
if (this.J != null && this.J.length > 0) {
a(this.J);
} else {
this.H.setVisibility(0);
this.K.setVisibility(8);
this.an.setVisibility(8);
}
}
} else {
this.J = rankingDetailInfo.getImglist().split(StatisticsManager.COMMA);
if (this.J != null && this.J.length > 0) {
a(this.J);
} else {
this.H.setVisibility(0);
this.K.setVisibility(8);
this.an.setVisibility(8);
}
}
} else {
this.H.setVisibility(0);
this.K.setVisibility(8);
this.an.setVisibility(8);
}
}
String b5 = by.a(this.mContext, "sp_app_cooperation_info").b(rankingDetailInfo.getPkgname(), (String) null);
az.d("RankingDetailActivity", "Pkgname = " + rankingDetailInfo.getPkgname());
if (!cd.a(b5)) {
this.F.setVisibility(0);
this.F.setText(c(b5));
az.d("RankingDetailActivity", "str = " + b5);
} else {
az.d("RankingDetailActivity", "null str = " + b5);
}
((h) this.mPresenter).b(rankingDetailInfo.getPkgname());
((h) this.mPresenter).b();
if (this.d != null) {
this.d.a(rankingDetailInfo);
}
if (!"back_from_gp_subscribe".equals(this.T) || this.p == null) {
return;
}
this.p.entrance_from = 3;
this.bo = new com.excelliance.kxqp.bitmap.ui.b.i(this.mContext);
this.bo.a(this.p, this.bF);
}
private void c(int i) {
if (this.f != null) {
this.f.setVisibility(i);
}
if (this.aY != null) {
this.aY.setVisibility(i);
}
if (this.aR != null) {
this.aY.setVisibility(i);
}
}
private void v() {
String str = this.o.buttonText;
this.U.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RankingDetailActivity.this.E();
}
});
this.e.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RankingDetailActivity.this.E();
}
});
this.f.setOnDownLoadClickListener(new DownloadProgressButton.a() {
@Override
public void a() {
RankingDetailActivity.this.E();
}
@Override
public void b() {
RankingDetailActivity.this.E();
}
@Override
public void c() {
RankingDetailActivity.this.E();
}
@Override
public void d() {
RankingDetailActivity.this.E();
}
});
this.aZ.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
RankingDetailActivity.this.bQ = true;
RankingDetailActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
RankingDetailActivity.this.showLoading(RankingDetailActivity.this.mContext.getResources().getString(R.string.loading2));
}
});
RankingDetailActivity.this.p.playable = 1;
com.excelliance.kxqp.gs.g.c.a().a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.mPageDes.firstPage, 1, RankingDetailActivity.this.p);
RankingDetailActivity.this.d(RankingDetailActivity.this.p.appPackageName);
}
});
if (com.excelliance.kxqp.gs.util.b.as(this.mContext)) {
if (this.p.downloadButtonVisible == 1 || x.a(this.mContext)) {
this.f14253a.setVisibility(4);
if (this.bc) {
this.e.setVisibility(0);
if (!this.bd) {
this.bq.appButtonTextFunction.function = "来自第三方链接下载";
this.bq.text = str;
this.e.setOnClickListener(this.bG);
}
} else if (!bs.s(this.p.appPackageName)) {
this.e.setVisibility(4);
} else {
this.e.setVisibility(0);
}
} else {
this.bq.appButtonTextFunction.function = "直接下载";
this.bq.text = str;
this.e.setVisibility(0);
this.f14253a.setVisibility(0);
}
} else if (com.excelliance.kxqp.gs.download.b.a().a(this.p.buttonStatus) || x.a(this.mContext)) {
if (com.excelliance.kxqp.gs.download.b.a().c(this.p.buttonStatus)) {
if (!this.bd && this.p.downloadStatus == 0) {
this.bq.appButtonTextFunction.function = "来自第三方链接下载";
this.bq.text = str;
this.f.setOnDownLoadClickListener(null);
this.f.setOnClickListener(this.bG);
this.f.setVisibility(0);
}
} else {
this.bq.appButtonTextFunction.function = "直接下载";
this.bq.text = str;
this.f.setVisibility(0);
}
}
if (this.o.gamePlayable() && this.p.getDownloadStatus() != 5 && this.p.getDownloadStatus() != 1) {
this.aZ.setVisibility(0);
d(this.p.getAppPackageName());
} else {
this.aZ.setVisibility(8);
}
this.e.setText(str);
this.f.setCurrentText(str);
this.U.a(str).a(this.o.getSize()).a(ProgressButton.b.a(this.p.getDownloadStatus(), this.p.getGameType())).a(this.p.free).update(this.p.needUpdate);
if (this.p != null) {
az.d("RankingDetailActivity", "7--progress = " + this.p.getDownloadProgress() + " statename = " + RankingItem.getStateName(this.mContext, this.p) + " status = " + this.p.getDownloadStatus() + " hasThirdLink " + this.bc);
if (this.bc) {
if (this.bd) {
this.bq.appButtonTextFunction.function = "打开";
this.bq.text = this.mContext.getResources().getString(R.string.state_open);
this.e.setText(this.mContext.getResources().getString(R.string.state_open));
this.U.a(this.mContext.getResources().getString(R.string.state_open));
this.f.setCurrentText(this.mContext.getResources().getString(R.string.state_open));
this.e.setOnClickListener(this.bH);
this.f.setOnDownLoadClickListener(null);
this.f.setOnClickListener(this.bH);
}
} else {
D();
a(this.p.getDownloadProgress(), this.p.getDownloadStatus());
}
}
k();
if (this.bk) {
if (com.excelliance.kxqp.gs.util.b.as(this.mContext)) {
this.e.setVisibility(0);
this.e.setText(R.string.ascent_guide_import);
this.e.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
new a(RankingDetailActivity.this.p, RankingDetailActivity.this.mContext).a();
RankingDetailActivity.this.e.setText(R.string.state_importing);
cg.a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.mContext.getString(R.string.importing));
}
});
} else {
this.f.setVisibility(0);
this.f.setCurrentText(getString(R.string.ascent_guide_import));
this.f.setOnDownLoadClickListener(new DownloadProgressButton.a() {
@Override
public void b() {
}
@Override
public void c() {
}
@Override
public void d() {
}
@Override
public void a() {
new a(RankingDetailActivity.this.p, RankingDetailActivity.this.mContext).a();
RankingDetailActivity.this.f.setCurrentText(RankingDetailActivity.this.getString(R.string.state_importing));
cg.a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.mContext.getString(R.string.importing));
}
});
this.f.a();
}
}
}
private void w() {
boolean z;
az.i("RankingDetailActivity", "RankingDetailActivity/refreshContentPager() called mAppInfoDetail: " + this.o);
if (this.o.hasStrategy()) {
Iterator<Fragment> it = this.ah.iterator();
while (true) {
if (!it.hasNext()) {
z = false;
break;
} else if (it.next() instanceof StrategyFragment) {
z = true;
break;
}
}
if (z) {
return;
}
StrategyFragment strategyFragment = new StrategyFragment();
Bundle bundle = new Bundle();
bundle.putString("appId", this.S);
strategyFragment.setArguments(bundle);
this.ah.add(strategyFragment);
this.ai.add(getResources().getString(R.string.detail_strategy));
this.ac.setVisibility(this.ah.size() > 1 ? 0 : 8);
this.ac.setIndicatorWidth(com.excelliance.kxqp.gs.util.ad.a(this.mContext, 55.0f));
this.ac.setIndicatorHeight(com.excelliance.kxqp.gs.util.ad.a(this.mContext, 3.0f));
this.ac.a((String[]) this.ai.toArray(new String[0]), 14.0f);
this.ac.a(this.ae, 0);
this.ac.invalidate();
this.ad.setVisibility(8);
this.aj.setVisibility(0);
this.bf.notifyDataSetChanged();
}
}
class AnonymousClass18 implements View.OnClickListener {
AnonymousClass18() {
}
@Override
public void onClick(View view) {
RankingDetailActivity.this.b();
RankingDetailActivity.this.bq.exchangeInfo(RankingDetailActivity.this.bp);
com.excelliance.kxqp.gs.g.c.a().a(RankingDetailActivity.this.bp);
com.excelliance.kxqp.gs.download.b.a().a(RankingDetailActivity.this.o.getAppInfo(), RankingDetailActivity.this.mContext, new Runnable() {
@Override
public void run() {
if (bq.a(RankingDetailActivity.this.mContext, true)) {
RankingDetailActivity.this.x();
return;
}
final boolean b2 = bq.b(RankingDetailActivity.this.mContext, true);
bq.a(RankingDetailActivity.this.mContext, new Runnable() {
@Override
public void run() {
ActivityCompat.requestPermissions(RankingDetailActivity.this, new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, b2 ? 4 : 1);
}
}, b2);
}
});
}
}
public void b() {
if (by.a(this.mContext, "sp_customization").b("game", true).booleanValue()) {
Intent intent = new Intent(this.mContext.getPackageName() + ".action_recommend_game");
intent.putParcelableArrayListExtra("appList", this.bn);
intent.putExtra("pkgName", this.S);
LocalBroadcastManager.getInstance(this.mContext).sendBroadcast(intent);
}
}
public void x() {
if (!TextUtils.isEmpty(this.bl)) {
bz.a().a(this.mContext, 147000, this.p.getAppPackageName(), this.aq, this.aG, this.bi + 1, 2, this.bl);
}
this.bb = new ap(this.mContext, this.o.thirdLink, new com.excelliance.kxqp.gs.i.d() {
@Override
public void a(View view, Object obj, int i) {
if (obj != null && (obj instanceof ThirdLink)) {
ThirdLink thirdLink = (ThirdLink) obj;
thirdLink.mBiAppUploadInfo = com.excelliance.kxqp.gs.g.c.c(RankingDetailActivity.this.p);
az.d("RankingDetailActivity", "showThirdLinkDialog onClick position:" + i + " thirdLink:" + thirdLink);
}
RankingDetailActivity.this.bJ.a(view, obj, i);
}
});
this.bb.setOnDismissListener(new DialogInterface.OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialogInterface) {
RankingDetailActivity.this.bb = null;
}
});
this.bb.show();
}
private void y() {
Integer num;
if (!com.excelliance.kxqp.gs.util.b.au(this.mContext) || this.o.getRank() == null || this.o.getRank().c > 100 || this.o.getRank().c <= 0) {
return;
}
SpannableStringBuilder spannableStringBuilder = new SpannableStringBuilder(String.format("#%d", Integer.valueOf(this.o.getRank().c)));
if (spannableStringBuilder.length() >= 2) {
spannableStringBuilder.setSpan(new AbsoluteSizeSpan(12, true), 0, 1, 33);
spannableStringBuilder.setSpan(new AbsoluteSizeSpan(18, true), 1, spannableStringBuilder.length(), 33);
this.X.setText(this.o.getRank().f14365b);
this.W.setText(spannableStringBuilder);
this.ab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (!com.excelliance.kxqp.gs.util.b.av(RankingDetailActivity.this.mContext)) {
com.excelliance.kxqp.gs.main.c.a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.o.getRank().f14364a);
return;
}
Intent intent = new Intent(RankingDetailActivity.this.mContext, (Class<?>) CommonActivity.class);
intent.putExtra("title", RankingDetailActivity.this.o.getRank().f14365b);
intent.putExtra("page", 5);
intent.putExtra(RankingListFragment.KEY_FROM, "detail");
intent.putExtra(RankingListFragment.KEY_CATEGORY_ID, String.valueOf(RankingDetailActivity.this.o.getRank().f14364a));
RankingDetailActivity.this.startActivity(intent);
}
});
if (TextUtils.isEmpty(this.o.getDownload())) {
return;
}
Matcher matcher = Pattern.compile("[^0-9]").matcher(this.o.getDownload());
if (matcher.find()) {
try {
num = Integer.valueOf(matcher.replaceAll("").trim());
} catch (NumberFormatException e) {
az.d("RankingDetailActivity", "ex:" + e.getMessage());
e.printStackTrace();
num = null;
}
if (num != null) {
SpannableStringBuilder spannableStringBuilder2 = new SpannableStringBuilder(com.excelliance.kxqp.ui.minify.c.c.a(num.intValue()) + "+");
int i = 0;
while (true) {
if (i >= spannableStringBuilder2.length()) {
i = 0;
break;
} else if (spannableStringBuilder2.charAt(i) < '0' || spannableStringBuilder2.charAt(i) > '9') {
break;
} else {
i++;
}
}
if (i > 0 && i < spannableStringBuilder2.length()) {
spannableStringBuilder2.setSpan(new AbsoluteSizeSpan(18, true), 0, i, 33);
spannableStringBuilder2.setSpan(new AbsoluteSizeSpan(12, true), i, spannableStringBuilder2.length(), 33);
}
this.Y.setText(spannableStringBuilder2);
}
}
}
}
private void z() {
String e;
String e2;
View.OnClickListener onClickListener;
String qq = this.o.getQq();
final String qqKey = this.o.getQqKey();
if (!cd.a(qq) && !this.o.getQq().equals("0")) {
if (this.G != null && (this.G.equals(w.e(this.mContext, "app_game_type1")) || this.G.equals(w.e(this.mContext, "app_game_type2")))) {
e = String.format(w.e(this.mContext, "game_qq_group"), qq);
} else {
e = String.format(w.e(this.mContext, "app_qq_group"), qq);
}
if (!cd.a(qqKey)) {
e2 = w.e(this.mContext, "click_join");
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
new com.excelliance.kxqp.d.d();
com.excelliance.kxqp.d.d.a(RankingDetailActivity.this.mContext, qqKey);
RankingDetailActivity.this.a("详情页点击加入QQ群按钮");
}
};
} else {
e2 = w.e(this.mContext, "click_copy_zone_number");
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
((ClipboardManager) RankingDetailActivity.this.mContext.getSystemService("clipboard")).setPrimaryClip(ClipData.newPlainText("gplayspace", RankingDetailActivity.this.o.getQq()));
Toast.makeText(RankingDetailActivity.this.mContext, "已复制QQ群号到剪切板~", 0).show();
RankingDetailActivity.this.a("详情页点击加入QQ群按钮");
}
};
}
} else {
e = w.e(this.mContext, "app_game_qq_group");
e2 = w.e(this.mContext, "click_create_qq_group");
onClickListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
if (RankingDetailActivity.this.o != null) {
StringBuilder sb = new StringBuilder("https://h5.ourplay.com.cn/applyForQq");
try {
sb.append("?icon=" + URLEncoder.encode(RankingDetailActivity.this.o.getIcon(), "UTF-8"));
sb.append("&gamename=" + URLEncoder.encode(RankingDetailActivity.this.o.getName(), "UTF-8"));
sb.append("&rid=" + URLEncoder.encode(bx.a().a(RankingDetailActivity.this.mContext), "UTF-8"));
sb.append("&pkg=" + URLEncoder.encode(RankingDetailActivity.this.o.getPkgname(), "UTF-8"));
sb.append("&aid=" + URLEncoder.encode(com.excelliance.kxqp.util.a.b.e(RankingDetailActivity.this.mContext), "UTF-8"));
} catch (UnsupportedEncodingException e3) {
e3.printStackTrace();
}
RankingDetailActivity.this.a("详情页点击创建QQ群按钮");
WebNoVideoActivity.startActivityForResult(RankingDetailActivity.this, CommonConstants.AuthErrorCode.ERROR_PARAM, sb.toString(), (Bundle) null);
}
}
};
}
if (!TextUtils.isEmpty(e)) {
this.C.setText(e);
}
if (!TextUtils.isEmpty(e2)) {
this.E.setText(e2);
}
this.A.setOnClickListener(onClickListener);
}
public void a(String str) {
BiEventClick biEventClick = new BiEventClick();
biEventClick.current_page = "详情页";
biEventClick.button_name = str;
com.excelliance.kxqp.gs.g.c.a().a(biEventClick);
}
private void A() {
boolean z = false;
if (com.excelliance.kxqp.gs.util.b.cn(this.mContext)) {
List<Entrance> list = this.o.mEntrancesList;
boolean z2 = ViewSwitcher.a(this).a() && by.a(this, "sp_total_info").b("SP_GOOGLE_ACCOUNT_ENTRANCE", false).booleanValue();
if (list != null && list.size() > 0 && z2) {
this.aN.setVisibility(0);
LinearLayout linearLayout = (LinearLayout) this.aN.findViewById(R.id.entrances_layout);
linearLayout.removeAllViews();
int i = 0;
while (i < list.size()) {
final Entrance entrance = list.get(i);
az.d("RankingDetailActivity", "setUpAgentRechargeEntrances: " + entrance);
ExRelativeLayout exRelativeLayout = (ExRelativeLayout) LayoutInflater.from(this.mContext).inflate(R.layout.recharge_entrance_item, linearLayout, z);
((TextView) exRelativeLayout.findViewById(R.id.entrance_title)).setText(entrance.title);
Button button = (Button) exRelativeLayout.findViewById(R.id.entrance_btn);
com.excelliance.kxqp.gs.g.c.a().a((View) exRelativeLayout, true, this.ag, this.mViewTrackerRxBus, this.mCompositeDisposable, entrance, 0, this.p.appPackageName);
final BiEventContent biEventContent = new BiEventContent();
biEventContent.current_page = this.mPageDes.firstPage;
biEventContent.content_type = "网页链接";
biEventContent.link_address = entrance.url;
biEventContent.link_mapping_name = entrance.title;
biEventContent.game_packagename = this.p.appPackageName;
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
CommonWebViewActivity.startActivity(RankingDetailActivity.this.mContext, entrance.url);
try {
bz.a().a(RankingDetailActivity.this.mContext, 146000, "详情页代充入口点击", Integer.valueOf(entrance.id).intValue());
} catch (Exception e) {
e.printStackTrace();
}
com.excelliance.kxqp.gs.g.c.a().a(biEventContent);
}
});
if (com.excean.ab_builder.c.a.E(this.mContext)) {
if (this.o.isGms()) {
View view = new View(this);
LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, com.excelliance.kxqp.gs.util.ad.a(this.mContext, 1.0f));
layoutParams.leftMargin = com.excelliance.kxqp.gs.util.ad.a(this.mContext, 12.0f);
layoutParams.rightMargin = com.excelliance.kxqp.gs.util.ad.a(this.mContext, 12.0f);
layoutParams.topMargin = com.excelliance.kxqp.gs.util.ad.a(this.mContext, 5.0f);
layoutParams.bottomMargin = com.excelliance.kxqp.gs.util.ad.a(this.mContext, 5.0f);
view.setBackgroundColor(Color.parseColor("#ffe5e5e5"));
if (linearLayout.getChildCount() != 0) {
linearLayout.addView(view, layoutParams);
}
linearLayout.addView(exRelativeLayout);
}
} else {
linearLayout.addView(exRelativeLayout);
if (i != list.size() - 1) {
View view2 = new View(this.mContext);
LinearLayout.LayoutParams layoutParams2 = new LinearLayout.LayoutParams(com.excelliance.kxqp.gs.util.ad.a(this.mContext, 312.0f), com.excelliance.kxqp.gs.util.ad.a(this.mContext, 0.5f));
layoutParams2.gravity = 17;
view2.setLayoutParams(layoutParams2);
view2.setBackgroundColor(Color.rgb(229, 229, 229));
linearLayout.addView(view2);
}
}
i++;
z = false;
}
} else {
this.aE.setVisibility(0);
}
} else {
this.aE.setVisibility(0);
this.aN.setVisibility(8);
}
if (!com.excean.ab_builder.c.a.E(this.mContext) || this.o.apkFrom == 2) {
return;
}
boolean booleanValue = by.a(this, "sp_total_info").b("SP_GOOGLE_ACCOUNT_ENTRANCE", false).booleanValue();
LinearLayout linearLayout2 = (LinearLayout) this.aN.findViewById(R.id.entrances_layout);
ExRelativeLayout exRelativeLayout2 = (ExRelativeLayout) LayoutInflater.from(this.mContext).inflate(R.layout.recharge_entrance_item, (ViewGroup) linearLayout2, false);
ImageView imageView = (ImageView) exRelativeLayout2.findViewById(R.id.recharge_entrance_im);
TextView textView = (TextView) exRelativeLayout2.findViewById(R.id.entrance_title);
Button button2 = (Button) exRelativeLayout2.findViewById(R.id.entrance_btn);
imageView.setBackground(null);
com.excelliance.kxqp.gs.newappstore.b.c.a(imageView, w.k(this.mContext, "enter_google_account"));
textView.setText(w.e(this.mContext, "ga_account"));
button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view3) {
BuyGameAccountActivity.a(RankingDetailActivity.this.mContext, 0);
BiEventClick biEventClick = new BiEventClick();
biEventClick.current_page = "游戏详情页";
biEventClick.button_name = "详情页谷歌账号购买按钮";
biEventClick.button_function = "跳转谷歌账号购买页面";
com.excelliance.kxqp.gs.g.c.a().a(biEventClick);
}
});
View view3 = new View(this);
view3.setBackgroundColor(Color.parseColor("#ffe5e5e5"));
LinearLayout.LayoutParams layoutParams3 = new LinearLayout.LayoutParams(-1, com.excelliance.kxqp.gs.util.ad.a(this.mContext, 1.0f));
layoutParams3.leftMargin = com.excelliance.kxqp.gs.util.ad.a(this.mContext, 12.0f);
layoutParams3.rightMargin = com.excelliance.kxqp.gs.util.ad.a(this.mContext, 12.0f);
layoutParams3.topMargin = com.excelliance.kxqp.gs.util.ad.a(this.mContext, 5.0f);
layoutParams3.bottomMargin = com.excelliance.kxqp.gs.util.ad.a(this.mContext, 5.0f);
if (booleanValue) {
this.aN.setVisibility(0);
if (linearLayout2.getChildCount() > 0) {
linearLayout2.addView(view3, layoutParams3);
}
linearLayout2.addView(exRelativeLayout2);
ExRelativeLayout exRelativeLayout3 = (ExRelativeLayout) LayoutInflater.from(this.mContext).inflate(R.layout.recharge_entrance_item, (ViewGroup) linearLayout2, false);
ImageView imageView2 = (ImageView) exRelativeLayout3.findViewById(R.id.recharge_entrance_im);
TextView textView2 = (TextView) exRelativeLayout3.findViewById(R.id.entrance_title);
Button button3 = (Button) exRelativeLayout3.findViewById(R.id.entrance_btn);
imageView2.setBackground(null);
com.excelliance.kxqp.gs.newappstore.b.c.a(imageView2, w.k(this.mContext, "enter_riot_account"));
textView2.setText(w.e(this.mContext, "riot_account"));
button3.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view4) {
BuyGameAccountActivity.a(RankingDetailActivity.this.mContext, 1);
BiEventClick biEventClick = new BiEventClick();
biEventClick.current_page = "游戏详情页";
biEventClick.button_name = "详情页拳头账号购买按钮";
biEventClick.button_function = "跳转拳头账号购买页面";
com.excelliance.kxqp.gs.g.c.a().a(biEventClick);
}
});
View view4 = new View(this);
view4.setBackgroundColor(Color.parseColor("#ffe5e5e5"));
linearLayout2.addView(view4, layoutParams3);
linearLayout2.addView(exRelativeLayout3);
return;
}
this.aN.setVisibility(8);
}
private void B() {
if (com.excelliance.kxqp.gs.util.b.co(this.mContext)) {
RankBean rankBean = this.o.mRankBean;
if (rankBean != null) {
if (!TextUtils.isEmpty(rankBean.categoryName) && !TextUtils.isEmpty(rankBean.orderNumber)) {
this.aQ.setVisibility(0);
this.aQ.setText(String.format("%s第%s", rankBean.categoryName, rankBean.orderNumber));
return;
} else {
this.aQ.setVisibility(8);
return;
}
}
this.aQ.setVisibility(8);
}
}
private void C() {
final String str = this.o.mWxminiappid;
final String str2 = this.o.mWxminilink;
if (TextUtils.isEmpty(str) || TextUtils.isEmpty(str2)) {
return;
}
this.aO.setVisibility(0);
this.aP.setVisibility(0);
((TextView) findViewById(R.id.tv_join_game_group)).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
af.a aVar = new af.a();
aVar.f14919a = RankingDetailActivity.this.mPageDes.firstPage;
aVar.c = "保存图片";
aVar.e = "展示二维码";
aVar.d = "详情页私域弹窗";
WXconfig wXconfig = new WXconfig();
wXconfig.appid = str;
wXconfig.deeplink = str2;
wXconfig.qrcode = RankingDetailActivity.this.o.qrcode;
wXconfig.title = RankingDetailActivity.this.o.wxminititle;
wXconfig.desc = RankingDetailActivity.this.o.wxminidesc;
com.excelliance.kxqp.d.f.a(RankingDetailActivity.this.mContext, str, af.a(RankingDetailActivity.this.mContext, str2), wXconfig, aVar);
BiEventClick biEventClick = new BiEventClick();
biEventClick.current_page = RankingDetailActivity.this.mPageDes.firstPage;
biEventClick.page_type = "主页";
biEventClick.button_name = "详情页点击加入企微群按钮";
biEventClick.button_function = "跳转小程序";
com.excelliance.kxqp.gs.g.c.a().a(biEventClick);
}
});
}
private void a(final String[] strArr) {
az.d("RankingDetailActivity", "imglist = " + strArr[0]);
((h) this.mPresenter).a(new com.excelliance.kxqp.ui.detail.a() {
@Override
public void a(final String str) {
RankingDetailActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if (str.equals("Y") && !RankingDetailActivity.this.L) {
RankingDetailActivity.this.H.setVisibility(8);
if (RankingDetailActivity.this.mContext != null) {
com.bumptech.glide.i.b(RankingDetailActivity.this.mContext.getApplicationContext()).a(strArr[0]).d(w.j(RankingDetailActivity.this.mContext, "ic_ranking_temp")).c(w.j(RankingDetailActivity.this.mContext, "ic_ranking_temp")).a(RankingDetailActivity.this.I);
return;
}
return;
}
if (str.equals("N") && !RankingDetailActivity.this.L) {
RankingDetailActivity.this.K.setVisibility(8);
RankingDetailActivity.this.an.setVisibility(8);
RankingDetailActivity.this.H.setVisibility(0);
return;
}
if (str.equals("Y") && RankingDetailActivity.this.L) {
az.d("RankingDetailActivity", str);
RankingDetailActivity.this.n.setImage(strArr[0]);
if (!bf.a(RankingDetailActivity.this.mContext) || RankingDetailActivity.this.O >= com.excelliance.kxqp.gs.util.ad.a(RankingDetailActivity.this.mContext, 160.0f)) {
return;
}
az.d("RankingDetailActivity", "mScrollY = " + RankingDetailActivity.this.O + " 160dp = " + com.excelliance.kxqp.gs.util.ad.a(RankingDetailActivity.this.mContext, 160.0f));
RankingDetailActivity.this.n.a();
return;
}
if (str.equals("N") && RankingDetailActivity.this.L) {
az.d("RankingDetailActivity", str);
if (!bf.a(RankingDetailActivity.this.mContext) || RankingDetailActivity.this.O >= com.excelliance.kxqp.gs.util.ad.a(RankingDetailActivity.this.mContext, 160.0f)) {
return;
}
az.d("RankingDetailActivity", "mScrollY = " + RankingDetailActivity.this.O + " 160dp = " + com.excelliance.kxqp.gs.util.ad.a(RankingDetailActivity.this.mContext, 160.0f));
RankingDetailActivity.this.n.a();
}
}
});
}
@Override
public void b(String str) {
az.d("RankingDetailActivity", str);
RankingDetailActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
if (RankingDetailActivity.this.L) {
if (!bf.a(RankingDetailActivity.this.mContext) || RankingDetailActivity.this.O >= com.excelliance.kxqp.gs.util.ad.a(RankingDetailActivity.this.mContext, 160.0f)) {
return;
}
RankingDetailActivity.this.n.a();
return;
}
RankingDetailActivity.this.K.setVisibility(8);
RankingDetailActivity.this.an.setVisibility(8);
RankingDetailActivity.this.H.setVisibility(0);
}
});
}
}, strArr[0]);
}
private String c(String str) {
int length = str.length();
if (length <= 10) {
return str;
}
int i = length - 10;
return str.substring(0, i) + "\n" + str.substring(i, length);
}
public void D() {
com.excelliance.kxqp.ui.util.b.a(this.e, RankingItem.getStateNameResult(this.mContext, this.p).text, "");
}
public void a(int i, int i2) {
String str = RankingItem.getStateNameResult(this.mContext, this.p).text;
if (this.p != null && this.aF != null) {
this.p.apkFrom = this.aF.apkFrom;
this.p.setFree(this.aF.isFree());
this.p.setOnline(this.aF.getOnline());
this.p.price = this.aF.price;
}
az.d("RankingDetailActivity", "refreshDownData mAppInfo:" + this.p);
if (com.excelliance.kxqp.gs.util.b.as(this.mContext)) {
this.U.setProgress(i);
this.U.a(str).a(ProgressButton.b.a(i2, this.p.getGameType())).a(this.p.free).update(this.p.needUpdate);
} else if (bs.s(this.p.getAppPackageName())) {
this.f.setCurrentText(str);
if (com.excean.ab_builder.c.a.R(this.mContext)) {
this.aR.setCurrentText(str);
this.aY.setCurrentText(str);
} else if (com.excean.ab_builder.c.a.S(this.mContext)) {
this.aX.setCurrentText(str);
}
} else if (this.bk) {
this.u.setVisibility(8);
if (this.p.downloadStatus == 0) {
this.f.setEnabled(true);
if (com.excean.ab_builder.c.a.R(this.mContext)) {
this.aR.setEnabled(true);
this.aY.setEnabled(true);
} else if (com.excean.ab_builder.c.a.S(this.mContext)) {
this.aX.setEnabled(true);
}
} else if (this.p.isInstalled()) {
this.f.setCurrentText(getString(R.string.state_open));
if (com.excean.ab_builder.c.a.R(this.mContext)) {
this.aR.setCurrentText(getString(R.string.state_open));
this.aY.setCurrentText(getString(R.string.state_open));
} else if (com.excean.ab_builder.c.a.S(this.mContext)) {
this.aX.setCurrentText(getString(R.string.state_open));
}
} else {
this.f.setEnabled(false);
this.f.setCurrentText(getString(R.string.state_importing));
if (com.excean.ab_builder.c.a.R(this.mContext)) {
this.aR.setEnabled(false);
this.aR.setCurrentText(getString(R.string.state_importing));
this.aY.setEnabled(false);
this.aY.setCurrentText(getString(R.string.state_importing));
} else if (com.excean.ab_builder.c.a.S(this.mContext)) {
this.aX.setEnabled(false);
this.aX.setCurrentText(getString(R.string.state_importing));
}
}
} else {
this.u.setVisibility(0);
this.bq = RankingItem.getStateNameResult(this.mContext, this.p);
float f = i * 1.0f;
this.f.a(f, this.bq.text, i2, this.p.isBuy);
if (com.excean.ab_builder.c.a.R(this.mContext)) {
this.aR.a(f, this.bq.text, i2, this.p.isBuy);
this.aY.a(f, this.bq.text, i2, this.p.isBuy);
} else if (com.excean.ab_builder.c.a.S(this.mContext)) {
this.aX.a(f, this.bq.text, i2, this.p.isBuy);
}
}
if (bs.s(this.p.appPackageName)) {
return;
}
if (i == 0) {
Iterator<ExcellianceAppInfo> it = InitialData.a(getApplicationContext()).a().iterator();
while (true) {
if (!it.hasNext()) {
break;
}
ExcellianceAppInfo next = it.next();
if (next.getAppPackageName().equals(this.p.getAppPackageName())) {
this.p.setMainObb(next.getMainObb());
this.p.setPatch(next.getPatch());
this.p.setPatchObb(next.getPatchObb());
break;
}
}
}
if (com.excelliance.kxqp.gs.util.b.as(this.mContext) || this.bk) {
return;
}
d(this.p.getDownloadStatus());
}
private void d(int i) {
if (this.p == null) {
return;
}
if (this.p.downloadButtonVisible == 1 || x.a(this.mContext)) {
this.u.setVisibility(8);
return;
}
if (i == 9 || i == 13) {
this.u.setText(w.e(this, "detail_status_wait"));
this.u.setVisibility(0);
return;
}
switch (i) {
case 0:
break;
case 1:
if ("7".equals(this.p.getGameType())) {
this.u.setText(w.e(this, "detail_status_installing"));
this.u.setVisibility(0);
return;
}
return;
case 2:
if (a(this.mContext, this.p)) {
this.u.setText(w.e(this, "detail_status_obb_downloading"));
this.u.setVisibility(0);
return;
} else {
this.u.setText(w.e(this, "detail_status_apk_downloading"));
this.u.setVisibility(0);
return;
}
default:
switch (i) {
case 4:
case 6:
this.u.setText(w.e(this, "detail_status_paused"));
this.u.setVisibility(0);
return;
case 5:
break;
default:
this.u.setText("");
this.u.setVisibility(8);
return;
}
}
this.u.setText("");
this.u.setVisibility(8);
}
private static boolean a(Context context, ExcellianceAppInfo excellianceAppInfo) {
return excellianceAppInfo.loseObb() || (com.excelliance.kxqp.gs.util.b.S(context) && (excellianceAppInfo.loseYalpSplit() || excellianceAppInfo.loseYalpDelta()));
}
@Override
public void onClick(int i) {
if (i != 1) {
switch (i) {
case 6:
default:
return;
case 7:
if (!bx.a().b(this.mContext)) {
com.excelliance.kxqp.gs.router.a.a.f8074a.invokeLogin(this.mContext);
return;
} else {
if (this.p == null || cd.a(this.N)) {
return;
}
((h) this.mPresenter).a(this.q.isActivated() ? 2 : 1, this.N);
return;
}
case 8:
if (this.p != null) {
this.v = new ad(this.mContext, this.p.getAppPackageName(), this.p.getAppName());
this.v.a(this.bI);
this.v.a();
this.v.c();
return;
}
return;
case 9:
if (bx.a().b(this.mContext)) {
com.excelliance.kxqp.gs.router.a.a.f8075b.invokeAdd2CollectionDialog(this.mContext, this.o.getRank_id());
return;
} else {
Toast.makeText(this.mContext, "请先登录", 0).show();
return;
}
case 10:
if (!com.excelliance.kxqp.gs.util.b.co(this.mContext) || this.o.mRankBean == null) {
return;
}
String str = this.o.mRankBean.categoryId;
if (TextUtils.isEmpty(str)) {
return;
}
try {
bz.a().a(this.mContext, 143000, Integer.valueOf(str).intValue(), "点击详情页的排行榜");
com.excelliance.kxqp.gs.g.c.a().a(this.mPageDes.firstPage, (String) null, "主页", this.aQ.getText().toString(), "去详情页排行榜", this.p);
} catch (Exception e) {
e.printStackTrace();
}
RankingActivity.a(this.mContext, str, true);
return;
}
}
finish();
}
public void E() {
if (this.p == null) {
return;
}
boolean a2 = bq.a(this.mContext, this.p);
b();
if (bq.a(this.mContext, a2)) {
F();
return;
}
final boolean b2 = bq.b(this.mContext, a2);
bq.a(this.mContext, new Runnable() {
@Override
public void run() {
ActivityCompat.requestPermissions(RankingDetailActivity.this, new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, b2 ? 3 : 0);
}
}, b2);
}
private void F() {
Runnable runnable = new Runnable() {
@Override
public void run() {
RankingDetailActivity.this.G();
}
};
if (this.o.noDLAntiAddiction == 0 && com.excelliance.kxqp.gs.download.b.a().b(this.o.buttonStatus) && this.p.subscribe != 1) {
r.a(this, runnable, true, this.mPageDes.firstPage);
} else {
G();
}
}
public void G() {
if (this.o == null || this.p == null) {
return;
}
Log.d("RankingDetailActivity", "download: mAppInfo::" + this.p);
if (!bs.s(this.p.getAppPackageName()) || this.p.getDownloadStatus() == 8 || this.p.getDownloadStatus() == 5 || (this.p.getDownloadStatus() == 1 && !"7".equals(this.p.getGameType()))) {
if (this.p.market_strategy == 1 && this.ar) {
this.aq = 3;
}
a(this.p);
az.d("RankingDetailActivity", "specialFrom:" + this.aq + " pkg:" + this.p.getAppPackageName());
switch (this.p.getDownloadStatus()) {
case 0:
if (this.p.subscribe == 1) {
this.p.entrance_from = 3;
}
this.p.maxShowTimes = this.bs;
Log.d("RankingDetailActivity", "download: mMaxShowTimes:" + this.bs);
if (TextUtils.isEmpty(this.bl)) {
if (TextUtils.isEmpty(this.aG)) {
bz.a().a(this.mContext, this.p.getAppPackageName(), this.R, this.aq);
} else {
bz.a().a(this.mContext, this.p.getAppPackageName(), this.R, this.aq, this.aG);
}
} else {
bz.a().a(this.mContext, this.p.getAppPackageName(), this.aq, this.bl);
}
this.bq.exchangeInfo(this.bp);
com.excelliance.kxqp.gs.g.c.a().a(this.bp);
if (!TextUtils.isEmpty(this.bv)) {
com.excelliance.kxqp.gs.ui.tencentpage.c.a().a(this.mContext, this.bv, this.bt, this.bu, "3", this.bw);
}
io.reactivex.i.b(new o.a().a((ExcellianceAppInfo) com.excelliance.kxqp.repository.a.a(this.p)).a(this).a()).a(new com.excelliance.kxqp.gs.launch.function.b(this)).b(io.reactivex.a.b.a.a()).a(io.reactivex.g.a.b()).c(new com.excelliance.kxqp.gs.download.h()).a(io.reactivex.a.b.a.a()).a(new io.reactivex.d.d<o>() {
@Override
public void accept(o oVar) throws Exception {
com.excelliance.kxqp.gs.download.b.a().a(RankingDetailActivity.this.p, RankingDetailActivity.this.mContext, new com.excelliance.kxqp.bitmap.ui.a.d(RankingDetailActivity.this.mContext, new com.excelliance.kxqp.bitmap.ui.a.a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.bK, RankingDetailActivity.this.p, new com.excelliance.kxqp.bitmap.ui.a.b(RankingDetailActivity.this.mContext, RankingDetailActivity.this.p, new com.excelliance.kxqp.bitmap.ui.a.e(RankingDetailActivity.this.mContext, RankingDetailActivity.this.p, new Runnable() {
@Override
public void run() {
if (com.excelliance.kxqp.gs.util.b.bf(RankingDetailActivity.this.mContext) && !s.a(RankingDetailActivity.this.o.getRecommendList())) {
if (RankingDetailActivity.this.as != null) {
RankingDetailActivity.this.as.setVisibility(com.excelliance.kxqp.gs.util.b.bf(RankingDetailActivity.this.mContext) ? 0 : 8);
}
RankingDetailActivity.this.as.setVisibility(0);
RankingDetailActivity.this.az.setVisibility(0);
RankingDetailActivity.this.at.setLayoutManager(new LinearLayoutManager(RankingDetailActivity.this.mContext, 0, false));
RankingDetailActivity.this.au = new RecommendAppAdapter(RankingDetailActivity.this.mContext, com.excelliance.kxqp.bitmap.ui.imp.j.a(RankingDetailActivity.this.mContext).a(RankingDetailActivity.this.o.getRecommendList()));
RankingDetailActivity.this.au.b(false);
RankingDetailActivity.this.at.setAdapter(RankingDetailActivity.this.au);
}
com.excelliance.kxqp.gs.appstore.editors.detail.a.a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.p, RankingDetailActivity.this.R, RankingDetailActivity.this.aq);
az.d("RankingDetailActivity", "progress = " + RankingDetailActivity.this.p.getDownloadProgress() + " statename = " + RankingItem.getStateName(RankingDetailActivity.this.mContext, RankingDetailActivity.this.p) + " status = " + RankingDetailActivity.this.p.getDownloadStatus());
RankingDetailActivity.this.a(RankingDetailActivity.this.p.getDownloadProgress(), RankingDetailActivity.this.p.getDownloadStatus());
}
}))), RankingDetailActivity.this.p));
}
}, new com.excelliance.kxqp.gs.launch.d());
return;
case 1:
if ("7".equals(this.p.getGameType())) {
Toast.makeText(this.mContext, com.excelliance.kxqp.swipe.a.a.getString(this.mContext, "installing_now"), 0).show();
} else {
a(this.mContext, 1, this.p);
com.excelliance.kxqp.gs.g.c.a().a(this.mContext, this.mPageDes.firstPage, 1, this.p);
}
if (TextUtils.isEmpty(this.bv)) {
return;
}
com.excelliance.kxqp.gs.ui.tencentpage.c.a().a(this.mContext, this.bv, this.bt, this.bu, "4", this.bw);
return;
case 2:
com.excelliance.kxqp.gs.download.c.a().a(this, this.p);
com.excelliance.kxqp.gs.g.c.a().a(this.mContext.getApplicationContext(), this.p);
return;
case 4:
com.excelliance.kxqp.gs.download.c.a().a(this, this.p);
com.excelliance.kxqp.gs.g.c.a().b(this.mContext.getApplicationContext(), this.p);
return;
case 5:
case 8:
if ((this.p.needUpdate || com.excelliance.kxqp.bitmap.a.a.b(this.mContext, this.p.getAppPackageName()).update) && !bs.s(this.p.getAppPackageName())) {
az.d("RankingDetailActivity", "appButtonDisplayResult :" + this.bq);
if (H() && !TextUtils.equals("1", this.p.getGameType())) {
this.bq.exchangeInfo(this.bp);
com.excelliance.kxqp.gs.g.c.a().b(this.bp);
com.excelliance.kxqp.bitmap.ui.b.b.a(this.mContext, this.p, as.o(this.mContext));
} else {
this.p.downloadStatus = 0;
this.p.needUpdate = true;
E();
}
} else {
a(this.mContext, 1, this.p);
com.excelliance.kxqp.gs.g.c.a().a(this.mContext, this.mPageDes.firstPage, 1, this.p);
}
if (TextUtils.isEmpty(this.bv)) {
return;
}
com.excelliance.kxqp.gs.ui.tencentpage.c.a().a(this.mContext, this.bv, this.bt, this.bu, "5", this.bw);
return;
case 9:
com.excelliance.kxqp.gs.appstore.editors.detail.a.a(this.mContext, this.p, this.R, this.aq);
az.d("RankingDetailActivity", "progress = " + this.p.getDownloadProgress() + " statename = " + RankingItem.getStateName(this.mContext, this.p) + " status = " + this.p.getDownloadStatus());
a(this.p.getDownloadProgress(), this.p.getDownloadStatus());
return;
case 11:
Toast.makeText(this.mContext, com.excelliance.kxqp.swipe.a.a.getString(this.mContext, "generating_obb"), 0).show();
return;
case 12:
Toast.makeText(this.mContext, com.excelliance.kxqp.swipe.a.a.getString(this.mContext, "generating_obb_error"), 0).show();
return;
case 19:
if (com.excelliance.kxqp.gs.g.e.b().g(this.p.appPackageName)) {
cg.a(this.mContext, this.mContext.getString(R.string.cancel_updating));
return;
}
return;
default:
return;
}
}
}
@Override
public void onRequestPermissionsResult(int i, @NonNull String[] strArr, @NonNull int[] iArr) {
super.onRequestPermissionsResult(i, strArr, iArr);
boolean b2 = bq.b(this.mContext);
boolean e = bq.e(this.mContext);
Log.d("RankingDetailActivity", "onRequestPermissionsResult: rationale:" + e);
BiEventPermission biEventPermission = new BiEventPermission();
biEventPermission.permission_type = "存储权限";
int i2 = 0;
if (i == 0 || i == 3) {
if (!b2 && !e) {
biEventPermission.is_succeed = "失败";
bq.j(this.mContext);
} else if (b2) {
if (i == 3) {
ShowFeedbackResultDialog.a.a(this.mContext, this.mContext.getPackageName());
bq.a(this.mContext);
} else {
F();
}
PlatSdk.h(this.mContext);
biEventPermission.is_succeed = "成功";
} else {
biEventPermission.is_succeed = "失败";
Toast.makeText(this.mContext, R.string.please_open_storage_permission, 0).show();
}
} else if (i == 1 || i == 4) {
if (!b2 && !e) {
biEventPermission.is_succeed = "失败";
bq.j(this.mContext);
} else if (b2) {
if (i == 4) {
ShowFeedbackResultDialog.a.a(this.mContext, this.mContext.getPackageName());
bq.a(this.mContext);
} else {
x();
}
PlatSdk.h(this.mContext);
biEventPermission.is_succeed = "成功";
} else {
biEventPermission.is_succeed = "失败";
Toast.makeText(this.mContext, R.string.please_open_storage_permission, 0).show();
}
} else if (i == 2 || i == 5 || i == 1219) {
if (!b2 && !e) {
biEventPermission.is_succeed = "失败";
bq.j(this.mContext);
} else if (b2) {
if (i != 5) {
if (i == 1219) {
if (this.bx != null) {
this.bx.a();
}
} else {
List<ThirdLink> l = this.ax.l();
while (true) {
if (i2 >= l.size()) {
break;
}
ThirdLink thirdLink = l.get(i2);
if (TextUtils.equals(thirdLink.url, this.br)) {
this.br = null;
a(thirdLink);
break;
}
i2++;
}
}
} else {
ShowFeedbackResultDialog.a.a(this.mContext, this.mContext.getPackageName());
bq.a(this.mContext);
}
PlatSdk.h(this.mContext);
biEventPermission.is_succeed = "成功";
} else {
biEventPermission.is_succeed = "失败";
Toast.makeText(this.mContext, R.string.please_open_storage_permission, 0).show();
}
}
com.excelliance.kxqp.gs.g.c.a().a(biEventPermission);
}
private boolean H() {
Iterator<ExcellianceAppInfo> it = RankingItem.pareseRankingItems(this.mContext, ResponseData.getUpdateData(this.mContext), true).iterator();
while (it.hasNext()) {
ExcellianceAppInfo next = it.next();
if (next.appPackageName.equals(this.p.appPackageName)) {
return next.getOnline() == 3;
}
}
return false;
}
@Override
public void onStop() {
super.onStop();
if (this.m == null || !this.m.i()) {
return;
}
this.m.c();
}
@Override
public void onDestroy() {
super.onDestroy();
this.mContext.unregisterReceiver(this.bC);
((h) this.mPresenter).a();
com.excelliance.kxqp.widget.video.i.a().c(this.m);
if (this.c != null) {
this.c.a();
}
if (this.bg != null && !this.bg.b()) {
this.bg.a();
}
if (this.bj != null && !this.bj.b()) {
this.bj.a();
}
if (this.bh == null || this.bh.b()) {
return;
}
this.bh.a();
}
@Override
public void onBackPressed() {
if (com.excelliance.kxqp.widget.video.i.a().g()) {
return;
}
super.onBackPressed();
}
@Override
public void a(ShareGameBean shareGameBean, SocializeMedia socializeMedia) {
if (shareGameBean == null || shareGameBean.beanIsNull()) {
((Activity) this.mContext).runOnUiThread(new Runnable() {
@Override
public void run() {
cg.a(RankingDetailActivity.this.mContext, w.e(RankingDetailActivity.this.mContext, "share_sdk_share_no_info"));
}
});
} else {
((h) this.mPresenter).a(this, socializeMedia, shareGameBean);
}
}
private List<e> b(String[] strArr) {
if (strArr.length <= 0) {
return null;
}
ArrayList arrayList = new ArrayList();
for (String str : strArr) {
String[] split = str.split("\\*");
if (split.length > 0) {
for (int i = 0; i < strArr.length; i++) {
e eVar = new e();
eVar.b(Integer.valueOf(split[0]).intValue());
eVar.a(Integer.valueOf(split[1]).intValue());
arrayList.add(eVar);
}
}
}
return arrayList;
}
public RankingDetailInfo c() {
return this.o;
}
public ArrayList<GamerVideoBean> d() {
return this.bm;
}
public void a(Context context, Message message) {
String str;
int i = message.what;
com.excelliance.kxqp.gs.dialog.g gVar = new com.excelliance.kxqp.gs.dialog.g(context, w.o(context, "theme_dialog_no_title2"), "account_dialog");
gVar.a(new b.InterfaceC0157b() {
@Override
public void b(int i2, Message message2, int i3) {
}
@Override
public void a(int i2, Message message2, int i3) {
RankingDetailActivity.this.finish();
Intent intent = new Intent(RankingDetailActivity.this.mContext.getPackageName() + ".action.switch.fragment");
intent.putExtra("index", com.excelliance.kxqp.gs.main.c.h());
RankingDetailActivity.this.mContext.sendBroadcast(intent);
RankingDetailActivity.this.mContext.startActivity(new Intent(RankingDetailActivity.this.mContext, (Class<?>) MainActivity.class));
}
});
if (gVar.isShowing()) {
return;
}
String str2 = "";
String e = w.e(context, "dialog_sure");
String e2 = w.e(context, "legal_alert_dialog_title");
if (i == 4) {
str2 = w.e(context, "ranking_detail_environment_toast");
e = w.e(context, "i_know");
str = w.e(context, "to_look");
} else {
str = null;
}
gVar.show();
gVar.c(i);
gVar.a(message);
gVar.a(str2);
gVar.b(e2);
if (i == 4) {
gVar.a(true, str, e);
} else {
gVar.a(true, e, null);
}
}
public void a(Context context, final int i, ExcellianceAppInfo excellianceAppInfo) {
if (i == 1) {
if (as.d(this.mContext, false) && excellianceAppInfo.gms) {
Message message = new Message();
message.what = 4;
a(context, message);
return;
} else {
final Runnable runnable = new Runnable() {
@Override
public void run() {
Intent intent = new Intent(RankingDetailActivity.this.mContext.getPackageName() + ".action.switch.fragment");
intent.putExtra("index", com.excelliance.kxqp.gs.main.c.h());
RankingDetailActivity.this.mContext.sendBroadcast(intent);
Intent intent2 = new Intent(RankingDetailActivity.this.mContext, (Class<?>) MainActivity.class);
intent2.putExtra("launch", true);
RankingDetailActivity.this.mContext.startActivity(intent2);
RankingListFragment.operateTouristGame(RankingDetailActivity.this.mContext, i, "游戏详情页", RankingDetailActivity.this.p);
}
};
Runnable runnable2 = new Runnable() {
@Override
public void run() {
((h) RankingDetailActivity.this.mPresenter).c(RankingDetailActivity.this.o.getPkgname());
runnable.run();
}
};
if (this.ba.a()) {
b.a(this.mContext, runnable, runnable2);
return;
} else {
runnable.run();
return;
}
}
}
if (com.excelliance.kxqp.gs.appstore.a.a(context) && !this.P && i == 1) {
new CommonDialog().a(com.excelliance.kxqp.swipe.a.a.getString(this.mContext, "title")).b(com.excelliance.kxqp.swipe.a.a.getString(this.mContext, "go_launch_tab")).c(com.excelliance.kxqp.swipe.a.a.getString(this.mContext, "confirm")).d(com.excelliance.kxqp.swipe.a.a.getString(this.mContext, "cancel")).a(new CommonDialog.a() {
@Override
public void a(Dialog dialog) {
Intent intent = new Intent(RankingDetailActivity.this.mContext.getPackageName() + ".action.switch.fragment");
intent.putExtra("index", com.excelliance.kxqp.gs.main.c.h());
RankingDetailActivity.this.mContext.sendBroadcast(intent);
RankingDetailActivity.this.mContext.startActivity(new Intent(RankingDetailActivity.this.mContext, (Class<?>) MainActivity.class));
}
@Override
public void b(Dialog dialog) {
dialog.dismiss();
}
}).show(((FragmentActivity) this.mContext).getSupportFragmentManager(), "CommonDialog");
} else {
RankingListFragment.operateTouristGame(this.mContext, i, this.p);
}
}
public static void a(Context context, String str, String str2) {
Intent intent = new Intent(context, (Class<?>) RankingDetailActivity.class);
intent.putExtra(WebActionRouter.KEY_PKG, str);
intent.putExtra("sourceFrom", str2);
context.startActivity(intent);
}
@Override
public void a(RankingDetailInfo rankingDetailInfo, boolean z) {
if (z && rankingDetailInfo != null) {
a(rankingDetailInfo);
} else {
this.H.setVisibility(8);
}
hideLoading();
}
@Override
public void a(int i, boolean z) {
Context context;
String str;
if (z) {
this.q.setActivated(i == 1);
this.M.setVisibility(i == 1 ? 0 : 4);
this.q.setText(i == 1 ? "已关注" : "关注");
Context context2 = this.mContext;
if (i == 1) {
context = this.mContext;
str = "rank_detail_follow";
} else {
context = this.mContext;
str = "rank_detail_unfollow";
}
Toast.makeText(context2, w.e(context, str), 0).show();
}
}
@Override
public void a(c cVar) {
if (cVar == null) {
return;
}
this.ba = cVar;
if (cVar.f14428a) {
this.y.setVisibility(0);
if (cVar.f14429b) {
this.z.setText(w.e(this.mContext, "ranking_fix_subscribed"));
this.z.setClickable(false);
return;
} else {
this.z.setText(w.e(this.mContext, "ranking_fix_go_subscribe"));
this.z.setClickable(true);
return;
}
}
this.y.setVisibility(8);
}
@Override
public void a(boolean z) {
if (z) {
this.ba.f14429b = true;
this.z.setText(w.e(this.mContext, "ranking_fix_subscribed"));
this.z.setClickable(false);
Toast.makeText(this.mContext, w.e(this.mContext, "ranking_fix_subscribe_success"), 0).show();
return;
}
Toast.makeText(this.mContext, w.e(this.mContext, "ranking_fix_subscribe_failed"), 0).show();
}
@Override
public void a(boolean z, int i) {
if (this.d != null) {
this.d.b(z && i == 1);
}
}
public ExcellianceAppInfo e() {
return this.p;
}
public String f() {
return this.R;
}
public int g() {
if (this.p.market_strategy == 1 && this.ar) {
this.aq = 3;
}
return this.aq;
}
public void a(Fragment fragment) {
if (fragment == null || s.a(this.ah)) {
return;
}
int indexOf = this.ah.indexOf(fragment);
if (indexOf > 0 && indexOf < this.ai.size()) {
this.ai.remove(indexOf);
this.ac.b((String[]) this.ai.toArray(new String[0]), 14.0f);
this.ad.b((String[]) this.ai.toArray(new String[0]), new String[this.ai.size()], 16.0f, 12.0f);
}
this.ah.remove(fragment);
if (this.ae != null && this.ae.getAdapter() != null) {
this.ae.getAdapter().notifyDataSetChanged();
az.d("RankingDetailActivity", "requestHide:" + fragment);
}
if (this.ah == null || this.ah.size() != 1) {
return;
}
this.ac.setVisibility(8);
this.ad.setVisibility(8);
this.aj.setVisibility(8);
}
private void d(List<ThirdLink> list) {
az.d("RankingDetailActivity", "setThirdLinkView linkList" + list);
this.av.setVisibility(0);
this.aw.setLayoutManager(new LinearLayoutManager(this.mContext, 1, false));
this.ax = new ThirdLinkAdapter(this.mContext, list);
this.ax.a(new com.excelliance.kxqp.gs.i.d() {
@Override
public void a(View view, Object obj, int i) {
if (obj != null && (obj instanceof ThirdLink)) {
ThirdLink thirdLink = (ThirdLink) obj;
BiAppUploadInfo c = com.excelliance.kxqp.gs.g.c.c(RankingDetailActivity.this.p);
c.fromPage = "详情页三方链接区域";
thirdLink.mBiAppUploadInfo = c;
az.d("RankingDetailActivity", "setThirdLinkView onClick position:" + i + " thirdLink:" + thirdLink);
}
RankingDetailActivity.this.bJ.a(view, obj, i);
}
});
this.ax.b(false);
this.aw.setAdapter(this.ax);
if (com.excean.ab_builder.c.a.W(this.mContext)) {
this.av.setVisibility(8);
}
}
public void a(final Object obj) {
if (bq.a(this.mContext, true)) {
by.a(this.mContext, "sp_config").b("sp_key_anti_addiction_system_switch", false).booleanValue();
bx.a().b(this.mContext);
StringBuilder sb = new StringBuilder();
sb.append("setThirdLinkView onClick position:");
sb.append(this.bi);
sb.append(" data != null :");
sb.append(obj != null);
az.d("RankingDetailActivity", sb.toString());
if (obj != null) {
az.d("RankingDetailActivity", "setThirdLinkView onClick position:" + this.bi + " data instanceof ThirdLink :" + (obj instanceof ThirdLink));
}
if ("from_ranking_activity_then_enter_detail_activity".equals(this.R)) {
bz.a().a(this.mContext, 145000, 5, "详情页点击三方链接");
} else if (TextUtils.isEmpty(this.bl)) {
bz.a().b(this.mContext, this.p.getAppPackageName(), this.aq, this.aG, this.bi + 1, this.be);
} else {
bz.a().a(this.mContext, 76000, this.p.getAppPackageName(), this.aq, this.aG, this.bi + 1, this.be, this.bl);
}
if (this.bb != null) {
this.bb.dismiss();
}
Runnable runnable = new Runnable() {
@Override
public void run() {
if (obj == null || !(obj instanceof ThirdLink)) {
return;
}
ThirdLink thirdLink = (ThirdLink) obj;
az.d("RankingDetailActivity", "mThirdLinkOnClickLister onClick position:" + RankingDetailActivity.this.bi + " thirdLink:" + thirdLink);
if (cd.a(thirdLink.url)) {
return;
}
an.d(thirdLink, RankingDetailActivity.this.mContext, "RankingDetailActivity");
}
};
if (!ce.c(this.mContext)) {
if ((!by.a(this.mContext, "global_config").b("sp_disable_time_error_not_notice", false).booleanValue()) & bf.e(this.mContext)) {
new com.excelliance.kxqp.bitmap.ui.a.f(this.mContext, runnable).run();
return;
}
}
runnable.run();
return;
}
final boolean b2 = bq.b(this.mContext, true);
bq.a(this.mContext, new Runnable() {
@Override
public void run() {
ActivityCompat.requestPermissions(RankingDetailActivity.this, new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, b2 ? 5 : 2);
}
}, b2);
if (obj == null || !(obj instanceof ThirdLink)) {
return;
}
this.br = ((ThirdLink) obj).url;
}
private void e(List<GiftPackBean> list) {
az.d("RankingDetailActivity", "setGiftPackView giftPackBeans" + list);
if (list != null && list.size() > 0) {
if (this.aK == null) {
this.aI.setVisibility(0);
this.aJ.setLayoutManager(new LinearLayoutManager(this.mContext, 1, false));
this.aK = new GiftPackAdapter(this.mContext, list, (h) this.mPresenter, this.S);
this.aK.b(false);
this.aJ.setAdapter(this.aK);
this.aE.setVisibility(8);
return;
}
this.aK.b(list);
return;
}
this.aI.setVisibility(8);
this.aE.setVisibility(8);
}
private void b(String str, int i) {
az.d("RankingDetailActivity", "setSingleGiftPack giftPackCode:" + str + " id:" + i);
if (cd.a(str) || this.aK == null) {
return;
}
boolean z = false;
Iterator<GiftPackBean> it = this.aK.l().iterator();
while (true) {
if (!it.hasNext()) {
break;
}
GiftPackBean next = it.next();
if (i == next.id) {
next.code = str;
next.state = GiftPackBean.GETED;
z = true;
break;
}
}
if (z) {
this.aK.notifyDataSetChanged();
}
}
private void I() {
this.aA.setVisibility(0);
this.aA.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if (Build.VERSION.SDK_INT <= 17) {
as.A(RankingDetailActivity.this.mContext, "https://h5.ourplay.com.cn/html/vivoCheck/index.html#/");
return;
}
Intent intent = new Intent(RankingDetailActivity.this.mContext, (Class<?>) CommonWebViewActivity.class);
intent.putExtra(SocialConstants.PARAM_URL, "https://h5.ourplay.com.cn/html/vivoCheck/index.html#/");
intent.putExtra("clickToOfficialDownload", true);
RankingDetailActivity.this.mContext.startActivity(intent);
}
});
}
public void a(final AppGoodsBean appGoodsBean, ExcellianceAppInfo excellianceAppInfo) {
com.excelliance.kxqp.gs.newappstore.ui.c cVar = new com.excelliance.kxqp.gs.newappstore.ui.c((Activity) this.mContext, excellianceAppInfo);
cVar.a(new c.a() {
@Override
public void a(View view, int i) {
switch (i) {
case 1:
appGoodsBean.setPayMethod(1);
appGoodsBean.setGoodsType(6);
RankingDetailActivity.this.c.a(appGoodsBean);
return;
case 2:
if (!as.i(RankingDetailActivity.this.mContext, "com.tencent.mm")) {
cg.a(RankingDetailActivity.this.mContext, w.e(RankingDetailActivity.this.mContext, "share_sdk_not_install_wechat"));
return;
} else {
appGoodsBean.setPayMethod(2);
appGoodsBean.setGoodsType(6);
RankingDetailActivity.this.c.a(appGoodsBean);
return;
}
default:
return;
}
}
});
cVar.a(((Activity) this.mContext).findViewById(android.R.id.content));
}
public void a(int i) {
int indexOf;
if (s.a(this.ah) || this.d == null || (indexOf = this.ah.indexOf(this.d)) <= 0 || indexOf >= this.ai.size()) {
return;
}
this.ac.b((String[]) this.ai.toArray(new String[0]), 14.0f);
String[] strArr = new String[this.ai.size()];
if (i > 0) {
strArr[indexOf] = String.valueOf(i);
}
this.ad.b((String[]) this.ai.toArray(new String[0]), strArr, 16.0f, 12.0f);
}
@Override
public void onActivityResult(int i, int i2, @Nullable Intent intent) {
if (i == 10002 && i2 == -1) {
Toast.makeText(this.mContext, "申请成功", 0).show();
return;
}
if (i == 1 && i2 == -1) {
E();
return;
}
if (i == 10003 && i2 == -1 && intent != null && "login_op_message_from_detail".equals(intent.getStringExtra("flag"))) {
if (this.p != null) {
com.excelliance.kxqp.bitmap.ui.b.i.a(this.mContext, this.p, null, 0);
return;
}
return;
}
super.onActivityResult(i, i2, intent);
}
@Override
public void a(List<GiftPackBean> list) {
e(list);
hideLoading();
}
@Override
public void a(String str, int i) {
b(str, i);
hideLoading();
}
@Override
public void b(List<GamerVideoBean> list) {
this.bm = new ArrayList<>();
this.bm.addAll(list);
Intent intent = new Intent(this.mContext.getPackageName() + ".action_ranking_detail_refresh_gamer_video_list");
intent.putParcelableArrayListExtra("videoList", this.bm);
intent.putExtra("gamePackageName", this.S);
LocalBroadcastManager.getInstance(this.mContext).sendBroadcast(intent);
}
@Override
public void c(List<ExcellianceAppInfo> list) {
this.bn = new ArrayList<>();
this.bn.addAll(list);
if (com.excean.ab_builder.c.a.Q(this.mContext) && by.a(this.mContext, "last_app_and_count").b("sp_key_has_Launched_game", false).booleanValue()) {
b();
}
}
@Override
public int getType() {
return this.bR;
}
private class a implements Runnable {
private ExcellianceAppInfo f14343b;
private Context c;
public a(ExcellianceAppInfo excellianceAppInfo, Context context) {
this.f14343b = excellianceAppInfo;
this.c = context;
}
public void a() {
tp.f(this);
}
@Override
public void run() {
com.excelliance.kxqp.repository.a.a(this.c).b(this.f14343b.getAppPackageName(), 8);
VersionManager.getInstance().b(this.f14343b.getAppPackageName(), 0, 9);
ImportParams importParams = new ImportParams();
importParams.setPkgs(this.f14343b.getAppPackageName());
importParams.setCopyApk(false);
importParams.setStartApp(true);
importParams.setPosition(12);
k.a(this.c).a(importParams);
}
}
public void a(final String str, final String str2) {
tp.f(new Runnable() {
@Override
public void run() {
ReponsePlayablePort reponsePlayablePort;
if (TextUtils.isEmpty(str2)) {
Log.e("RankingDetailActivity", "startPlayGame no port url " + str2);
RankingDetailActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
com.excelliance.kxqp.gs.g.c.a().a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.mPageDes.firstPage, 3, "启动失败", RankingDetailActivity.this.p);
RankingDetailActivity.this.hideLoading();
RankingDetailActivity.this.J();
}
});
return;
}
com.excelliance.kxqp.api.c cVar = new com.excelliance.kxqp.api.c(RankingDetailActivity.this.mContext);
az.d("RankingDetailActivity", "startPlayGame urlGetPort: " + str2);
String r = GameUtil.getIntance().r(RankingDetailActivity.this.mContext);
DisplayMetrics displayMetrics = new DisplayMetrics();
RankingDetailActivity.this.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
az.d("RankingDetailActivity", "startPlayGame DisplayMetrics dm.widthPixels: " + displayMetrics.widthPixels + ", heightPixels = " + displayMetrics.heightPixels + ", densityDpi = " + displayMetrics.densityDpi);
cVar.a(ApiManager.getInstance().a(RankingDetailActivity.this.mContext, 15000L, 15000L, str2 != null ? str2 : "https://api.ourplay.com.cn/").l(new q.a().a("uid", r).a(am.o, str).a("width", String.valueOf(displayMetrics.widthPixels)).a("height", String.valueOf(displayMetrics.heightPixels)).a("dpi", String.valueOf(displayMetrics.densityDpi)).a()));
com.excelliance.kxqp.gs.appstore.model.ResponseData b2 = cVar.b();
az.d("RankingDetailActivity", "startPlayGame responsePortData:" + b2);
ReponsePlayableGameInfo reponsePlayableGameInfo = null;
if (b2.code == 0) {
if (b2 != null && b2.data != 0) {
reponsePlayablePort = (ReponsePlayablePort) b2.data;
Intent intent = new Intent();
intent.setComponent(new ComponentName(RankingDetailActivity.this.mContext.getPackageName(), "com.excelliance.zmcaplayer.client.VideoActivity"));
intent.putExtra("game_cpu", RankingDetailActivity.this.p.cpu);
intent.putExtra("master_cpu", !com.excelliance.kxqp.gs.ui.home.b.a(RankingDetailActivity.this.mContext).d() ? 2 : 1);
intent.putExtra("assist_pkg", com.excelliance.kxqp.manager.d.a(RankingDetailActivity.this.mContext).b(RankingDetailActivity.this.mContext));
JSONObject jSONObject = new JSONObject();
if (reponsePlayablePort != null) {
try {
jSONObject.put("token", reponsePlayablePort.token);
} catch (Exception e) {
e.printStackTrace();
}
cVar.a(ApiManager.getInstance().a(RankingDetailActivity.this.mContext, 15000L, 15000L, "https://api.ourplay.com.cn/").m(new q.a().a(am.o, str).a("uid", r).a()));
com.excelliance.kxqp.gs.appstore.model.ResponseData b3 = cVar.b();
az.d("RankingDetailActivity", "startPlayGame responseGameData:" + b3);
if (b3.code == 0) {
if (b3 != null && b3.data != 0) {
reponsePlayableGameInfo = (ReponsePlayableGameInfo) b3.data;
}
} else {
Log.e("RankingDetailActivity", "startPlayGame responseGameData failed " + b3);
String str3 = b3.msg;
if (!TextUtils.isEmpty(str3)) {
cg.a(RankingDetailActivity.this.mContext, str3);
}
}
}
int i = reponsePlayableGameInfo != null ? reponsePlayableGameInfo.game_screen : 2;
az.d("RankingDetailActivity", "startPlayGame reponsePortInfo: " + reponsePlayablePort + ",pkg = " + str);
if (reponsePlayablePort == null) {
com.excelliance.kxqp.gs.g.c.a().a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.mPageDes.firstPage, 3, "启动成功", RankingDetailActivity.this.p);
intent.putExtra("server_addr", reponsePlayablePort.ip);
intent.putExtra("server_port", Integer.parseInt(reponsePlayablePort.port));
intent.putExtra("session_token", jSONObject.toString());
intent.putExtra("home_package", str);
intent.putExtra("screen_orientation", i);
intent.putExtra("game_package", str);
intent.putExtra("play_time", reponsePlayableGameInfo != null ? reponsePlayableGameInfo.play_time : 120);
intent.putExtra("display_width", reponsePlayablePort.width);
intent.putExtra("display_height", reponsePlayablePort.height);
intent.putExtra("display_dpi", reponsePlayablePort.dpi);
SliceResolvedActivity.startActivity(RankingDetailActivity.this.mContext, "com.excelliance.zmcaplayer.client", intent);
} else {
Log.e("RankingDetailActivity", "startPlayGame reponsePortInfo null");
RankingDetailActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
com.excelliance.kxqp.gs.g.c.a().a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.mPageDes.firstPage, 3, "启动失败", RankingDetailActivity.this.p);
RankingDetailActivity.this.J();
}
});
}
RankingDetailActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
RankingDetailActivity.this.hideLoading();
}
});
}
} else {
Log.e("RankingDetailActivity", "startPlayGame get reponsePortInfo failed " + b2);
String str4 = b2.msg;
if (!TextUtils.isEmpty(str4)) {
cg.a(RankingDetailActivity.this.mContext, str4);
}
}
reponsePlayablePort = null;
Intent intent2 = new Intent();
intent2.setComponent(new ComponentName(RankingDetailActivity.this.mContext.getPackageName(), "com.excelliance.zmcaplayer.client.VideoActivity"));
intent2.putExtra("game_cpu", RankingDetailActivity.this.p.cpu);
intent2.putExtra("master_cpu", !com.excelliance.kxqp.gs.ui.home.b.a(RankingDetailActivity.this.mContext).d() ? 2 : 1);
intent2.putExtra("assist_pkg", com.excelliance.kxqp.manager.d.a(RankingDetailActivity.this.mContext).b(RankingDetailActivity.this.mContext));
JSONObject jSONObject2 = new JSONObject();
if (reponsePlayablePort != null) {
}
if (reponsePlayableGameInfo != null) {
}
az.d("RankingDetailActivity", "startPlayGame reponsePortInfo: " + reponsePlayablePort + ",pkg = " + str);
if (reponsePlayablePort == null) {
}
RankingDetailActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
RankingDetailActivity.this.hideLoading();
}
});
}
});
}
public void d(final String str) {
if (this.bP) {
return;
}
if (this.bQ && !TextUtils.isEmpty(this.bO)) {
a(str, this.bO);
}
if (TextUtils.isEmpty(this.bO)) {
this.bP = true;
tp.f(new Runnable() {
@Override
public void run() {
boolean z;
com.excelliance.kxqp.api.c cVar = new com.excelliance.kxqp.api.c(RankingDetailActivity.this.mContext);
cVar.a(ApiManager.getInstance().a(RankingDetailActivity.this.mContext, 15000L, 15000L, "https://api.ourplay.com.cn/").e());
com.excelliance.kxqp.gs.appstore.model.ResponseData b2 = cVar.b();
az.d("RankingDetailActivity", "startPlayGame responseData:" + b2);
if (b2.code == 0) {
if (b2 != null && b2.data != 0) {
List list = (List) b2.data;
az.d("RankingDetailActivity", "startPlayGame reponseInfoList: " + list);
if (list != null && list.size() > 0) {
az.d("RankingDetailActivity", "startPlayGame getBestServerForPlayPort size: " + list.size());
final int size = list.size();
final HashMap hashMap = new HashMap();
for (int i = 0; i < size; i++) {
final ReponsePlayableArea reponsePlayableArea = (ReponsePlayableArea) list.get(i);
tp.f(new Runnable() {
@Override
public void run() {
PingIpInfo pingIpInfo = new PingIpInfo();
if (reponsePlayableArea == null || TextUtils.isEmpty(reponsePlayableArea.api)) {
return;
}
az.d("RankingDetailActivity", "startPlayGame getBestServerForPlayPort rpa.api: " + reponsePlayableArea.api);
int lastIndexOf = reponsePlayableArea.api.lastIndexOf(":");
int indexOf = reponsePlayableArea.api.indexOf("//");
if (lastIndexOf <= 10 || indexOf <= 0) {
return;
}
pingIpInfo.ip = reponsePlayableArea.api.substring(indexOf + 2, lastIndexOf);
ProxyDelayService.a(pingIpInfo, WorkRequest.DEFAULT_BACKOFF_DELAY_MILLIS);
Log.d("RankingDetailActivity", "startPlayGame delayTime: " + pingIpInfo.delayTime);
synchronized (RankingDetailActivity.this.bM) {
if (pingIpInfo.delayTime < RankingDetailActivity.this.bN) {
RankingDetailActivity.this.bN = pingIpInfo.delayTime;
RankingDetailActivity.this.bO = reponsePlayableArea.api;
}
hashMap.put(reponsePlayableArea.api, pingIpInfo);
if (hashMap.size() > 2 || hashMap.size() >= size) {
RankingDetailActivity.this.bM.notifyAll();
}
}
}
});
}
az.d("RankingDetailActivity", "startPlayGame getBestServerForPlayPort size: " + hashMap.size() + ", size = " + size);
synchronized (RankingDetailActivity.this.bM) {
try {
RankingDetailActivity.this.bM.wait();
} catch (Exception e) {
e.printStackTrace();
}
}
az.d("RankingDetailActivity", "startPlayGame bestTime= " + RankingDetailActivity.this.bN + ",mPortServer: " + RankingDetailActivity.this.bO);
StringBuilder sb = new StringBuilder();
sb.append("startPlayGame bestTime= ");
sb.append(RankingDetailActivity.this.bN);
Log.d("RankingDetailActivity", sb.toString());
if (RankingDetailActivity.this.bQ) {
if (RankingDetailActivity.this.bN < 2000.0f) {
RankingDetailActivity.this.a(str, RankingDetailActivity.this.bO);
} else {
RankingDetailActivity.this.bO = null;
RankingDetailActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
com.excelliance.kxqp.gs.g.c.a().a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.mPageDes.firstPage, 3, "启动失败", RankingDetailActivity.this.p);
RankingDetailActivity.this.hideLoading();
cg.a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.mContext.getResources().getString(R.string.network_not_good_retry));
}
});
}
}
z = true;
RankingDetailActivity.this.bP = false;
if (z && RankingDetailActivity.this.bQ) {
RankingDetailActivity.this.runOnUiThread(new Runnable() {
@Override
public void run() {
com.excelliance.kxqp.gs.g.c.a().a(RankingDetailActivity.this.mContext, RankingDetailActivity.this.mPageDes.firstPage, 3, "启动失败", RankingDetailActivity.this.p);
RankingDetailActivity.this.hideLoading();
RankingDetailActivity.this.J();
}
});
return;
}
}
}
} else {
Log.e("RankingDetailActivity", "startPlayGame get getPlayAreaList failed " + b2);
String str2 = b2.msg;
if (!TextUtils.isEmpty(str2)) {
cg.a(RankingDetailActivity.this.mContext, str2);
}
}
z = false;
RankingDetailActivity.this.bP = false;
if (z) {
}
}
});
}
}
public void J() {
new com.excelliance.kxqp.task.store.common.CommonDialog().b(this.mContext.getResources().getString(R.string.playing_users_exceed_max)).d(this.mContext.getResources().getString(R.string.download)).e(this.mContext.getResources().getString(R.string.cancel)).a(new CommonDialog.a() {
@Override
public void a(Dialog dialog) {
dialog.dismiss();
Log.d("RankingDetailActivity", "onPositiveClick mViewPlayable.onClick()");
if (RankingDetailActivity.this.p.getDownloadStatus() == 0 || RankingDetailActivity.this.p.getDownloadStatus() == 4 || RankingDetailActivity.this.p.getDownloadStatus() == 9) {
RankingDetailActivity.this.E();
}
}
@Override
public void b(Dialog dialog) {
dialog.dismiss();
}
}).show(((FragmentActivity) this.mContext).getSupportFragmentManager(), "CommonDialog");
}
@Override
public void disExposure() {
super.disExposure();
K();
}
private void K() {
BiEventBrowsePage biEventBrowsePage = new BiEventBrowsePage();
biEventBrowsePage.current_page = this.mPageDes.firstPage;
if (this.p != null) {
biEventBrowsePage.game_packagename = this.p.getAppPackageName();
biEventBrowsePage.game_update_time = this.p.appUpdateTime;
biEventBrowsePage.game_version = this.p.serverVc + "";
biEventBrowsePage.set__items("game", this.p.datafinder_game_id);
if (this.mPageBrowseHandle.f1371b > 0) {
biEventBrowsePage.pageview_duration = com.excean.bytedancebi.d.d.a(this.mPageBrowseHandle.f1371b) + "";
com.excelliance.kxqp.gs.g.c.a().a(biEventBrowsePage);
}
}
}
private void b(RankingDetailInfo rankingDetailInfo) {
ArrayList arrayList = new ArrayList();
if (!TextUtils.isEmpty(rankingDetailInfo.mWxminiappid) && !TextUtils.isEmpty(rankingDetailInfo.mWxminilink)) {
arrayList.add("加入企微交流群");
}
if (!cd.a(this.o.getQq()) && !this.o.getQq().equals("0")) {
arrayList.add("申请加入QQ群");
} else {
arrayList.add("申请创建QQ群");
}
a(arrayList, rankingDetailInfo);
BiEventPageOpen biEventPageOpen = new BiEventPageOpen();
biEventPageOpen.current_page = this.mPageDes.firstPage;
biEventPageOpen.expose_banner_area = this.mPageDes.secondArea;
if (arrayList.size() > 0) {
biEventPageOpen.page_function_name = arrayList.toString();
}
if (this.aG != null) {
biEventPageOpen.keyword_search = this.aG;
}
biEventPageOpen.set__items("game", this.p.datafinder_game_id);
com.excean.bytedancebi.c.a.a().a(biEventPageOpen);
}
private void a(List<String> list, RankingDetailInfo rankingDetailInfo) {
ExcellianceAppInfo appInfo = rankingDetailInfo.getAppInfo();
if (appInfo != null) {
if (appInfo.subscribe == 1) {
list.add("详情页可预约");
} else if (this.bk) {
list.add("详情页可下载");
} else {
boolean z = false;
if (com.excelliance.kxqp.gs.util.b.as(this.mContext)) {
if ((appInfo.downloadButtonVisible == 1 || x.a(this.mContext)) && !this.bc) {
if (!bs.s(appInfo.appPackageName)) {
list.add("详情页无绿色按钮");
if (z) {
list.add("详情页可下载");
}
} else {
this.e.setVisibility(0);
}
}
z = true;
if (z) {
}
} else {
if ((appInfo.downloadButtonVisible == 1 || x.a(this.mContext)) && !this.bc) {
if (!bs.s(this.p.appPackageName)) {
list.add("详情页无绿色按钮");
if (z) {
}
} else {
this.f.setVisibility(0);
}
}
z = true;
if (z) {
}
}
}
list.add("详情页点击联系微信客服");
}
}
}