更新提示Dialog 修改
This commit is contained in:
@ -1141,6 +1141,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
game.setVersion(appEntity.getVersion());
|
||||
game.setUrl(appEntity.getUrl());
|
||||
game.setPlatform("官方版");
|
||||
game.setId("5618b86e8ab49e17088b4575");
|
||||
PackageManager.addUpdate(0, game);
|
||||
|
||||
String updateMD5 = MD5Utils.getUpdateMD5(appEntity.getUrl(), appEntity.getContent());
|
||||
@ -1179,7 +1180,7 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
content.setText(Html.fromHtml(appEntity.getContent()));
|
||||
|
||||
TextView versison = (TextView) view.findViewById(R.id.update_app_version);
|
||||
versison.setText(String.format("光环助手V%s更新内容:",appEntity.getVersion()));
|
||||
versison.setText(String.format("光环助手V%s更新内容:", appEntity.getVersion()));
|
||||
|
||||
TextView size = (TextView) view.findViewById(R.id.update_app_size);
|
||||
size.setText(String.format("大小:%s", appEntity.getSize()));
|
||||
@ -1222,14 +1223,14 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
updateDialog.show();
|
||||
}
|
||||
|
||||
private Dialog dialog;
|
||||
private Dialog downloadDialog;
|
||||
private ProgressBar app_pb_progress;
|
||||
private TextView app_tv_speed;
|
||||
private TextView app_tv_percent;
|
||||
private TextView app_tv_cancel;
|
||||
|
||||
private void showDownloadDialog(String md5) {
|
||||
dialog = new Dialog(this);
|
||||
downloadDialog = new Dialog(this);
|
||||
|
||||
View view = View.inflate(this, R.layout.app_updating_dialog, null);
|
||||
|
||||
@ -1245,18 +1246,18 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
if (appEntity.isForce()) {
|
||||
finish();
|
||||
} else {
|
||||
dialog.dismiss();
|
||||
downloadDialog.dismiss();
|
||||
isShowDownload = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
dialog.setCancelable(false);
|
||||
dialog.closeOptionsMenu();
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setContentView(view);
|
||||
dialog.show();
|
||||
downloadDialog.setCanceledOnTouchOutside(false);
|
||||
downloadDialog.setCancelable(false);
|
||||
downloadDialog.closeOptionsMenu();
|
||||
downloadDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
downloadDialog.setContentView(view);
|
||||
downloadDialog.show();
|
||||
|
||||
isShowDownload = true;
|
||||
|
||||
@ -1286,7 +1287,9 @@ public class MainActivity extends BaseFragmentActivity implements OnClickListene
|
||||
app_tv_percent.setText(downloadEntity.getPercent() + "%");
|
||||
if (DownloadStatus.done.equals(downloadEntity.getStatus())) {
|
||||
DownloadManager.getInstance(getApplicationContext()).cancel(downloadEntity.getUrl(), false);
|
||||
dialog.dismiss();
|
||||
if (downloadDialog != null) {
|
||||
downloadDialog.dismiss();
|
||||
}
|
||||
isShowDownload = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user