统一暂停,继续下载处理

This commit is contained in:
huangzhuanghua
2016-05-20 16:35:11 +08:00
parent a87a6fe256
commit 3d696fc991
25 changed files with 131 additions and 326 deletions

View File

@ -352,13 +352,11 @@ public class DownloadItemUtils {
TextView downloadBtn, TextView download_speed,
TextView download_percentage, GameEntity entity, int position,
RecyclerView.Adapter<RecyclerView.ViewHolder> adapter,
Handler handler, ArrayMap<String, Long> lastTimeMap,
ArrayMap<String, String> statusMap,
ArrayMap<String, LinkedBlockingQueue<String>> platformMap,
String entrance, DismissEntity dismissEntity, String location) {
setOnClickListener(context, downloadBtn, download_speed,
download_percentage, entity, position, adapter, handler,
lastTimeMap, statusMap, platformMap, entrance, true,
download_percentage, entity, position, adapter, statusMap, platformMap, entrance, true,
dismissEntity, location);
}
@ -367,7 +365,6 @@ public class DownloadItemUtils {
final TextView download_percentage, final GameEntity entity,
final int position,
final RecyclerView.Adapter<RecyclerView.ViewHolder> adapter,
final Handler handler, final ArrayMap<String, Long> lastTimeMap,
final ArrayMap<String, String> statusMap,
final ArrayMap<String, LinkedBlockingQueue<String>> platformMap,
final String entrance, final boolean isShowPlatform,
@ -468,8 +465,7 @@ public class DownloadItemUtils {
dismissEntity.setShow(true);
DownloadDialog.getInstance(context)
.showPopupWindow(viewBtn, entity,
entrance, handler,
lastTimeMap, statusMap,
entrance, statusMap,
download_speed,
download_percentage,
location);
@ -598,8 +594,6 @@ public class DownloadItemUtils {
viewBtn,
entity,
entrance,
handler,
lastTimeMap,
statusMap,
download_speed,
download_percentage,
@ -658,9 +652,9 @@ public class DownloadItemUtils {
Message msg = Message.obtain();
msg.what = Constants.PAUSE_DOWNLOAD_TASK;
msg.obj = entity.getApk().get(0).getUrl();
lastTimeMap.put(entity.getApk().get(0).getUrl(),
DownloadManager.getInstance(context).put(entity.getApk().get(0).getUrl(),
System.currentTimeMillis());
handler.sendMessageDelayed(msg, 1000);
DownloadManager.getInstance(context).sendMessageDelayed(msg, 1000);
} else if ("继续".equals(str)) {
ArrayMap<String, DownloadEntry> entryMap = entity
.getEntryMap();
@ -730,9 +724,9 @@ public class DownloadItemUtils {
Message msg = Message.obtain();
msg.what = Constants.CONTINUE_DOWNLOAD_TASK;
msg.obj = entity.getApk().get(0).getUrl();
lastTimeMap.put(entity.getApk().get(0).getUrl(),
DownloadManager.getInstance(context).put(entity.getApk().get(0).getUrl(),
System.currentTimeMillis());
handler.sendMessageDelayed(msg, 1000);
DownloadManager.getInstance(context).sendMessageDelayed(msg, 1000);
} else if ("安装".equals(str)) {
String path = entity.getEntryMap()
.get(entity.getEntryMap().keyAt(0)).getPath();