基本完成Xapk解压安装,还有部分细节可能要调整

This commit is contained in:
kehaoyuan
2020-07-09 18:31:27 +08:00
parent e63a374da1
commit 49b0b982f5
15 changed files with 266 additions and 75 deletions

View File

@ -263,6 +263,7 @@ public class DownloadItemUtils {
boolean isShowPlatform, boolean isNormal) {
updateItemViewStatus(holder, true, null);
holder.gameProgressbar.setProgressDrawable(context.getResources().getDrawable(R.drawable.progressbar_bg_style));
String platform = PlatformUtils.getInstance(context).getPlatformName(downloadEntity.getPlatform());
@ -327,9 +328,10 @@ public class DownloadItemUtils {
if (XapkUnzipStatus.UNZIPPING.name().equals(xapkStatus)) {
String percent = downloadEntity.getMeta().get(XapkInstaller.XAPK_UNZIP_PERCENT);
holder.gameProgressbar.setProgressDrawable(context.getResources().getDrawable(R.drawable.progressbar_xapk_style));
holder.gameDownloadSpeed.setText("解压中");
holder.gameDownloadSpeed.setText(R.string.unzipping);
holder.gameProgressbar.setProgress((int) (Float.valueOf(percent) * 10));
holder.gameDownloadPercentage.setText(percent + "%");
holder.gameDownloadBtn.setText(R.string.unzipping);
return;
}
@ -571,10 +573,6 @@ public class DownloadItemUtils {
}
DataUtils.onGameLaunchEvent(context, gameEntity.getName(), gameEntity.getApk().get(0).getPlatform(), location);
PackageUtils.launchApplicationByPackageName(context, gameEntity.getApk().get(0).getPackageName());
} else if (str.equals(context.getString(R.string.waiting))
|| str.equals(context.getString(R.string.downloading))) {
context.startActivity(DownloadManagerActivity.getDownloadMangerIntent(context,
apk.getUrl(), entrance + "+(" + location.split(":")[0] + ")"));
} else if (str.equals(context.getString(R.string.update))) {
if (entrance.contains("我的游戏")) {
MtaHelper.onEvent("我的游戏_启动", "更新", gameEntity.getName());
@ -583,6 +581,9 @@ public class DownloadItemUtils {
DialogUtils.checkDownload(context, apk.getSize(),
isSubscribe -> update(context, gameEntity, entrance, location, isSubscribe, traceEvent));
});
} else {
context.startActivity(DownloadManagerActivity.getDownloadMangerIntent(context,
apk.getUrl(), entrance + "+(" + location.split(":")[0] + ")"));
}
}