去掉取消下载按钮,变为等待

This commit is contained in:
huangzhuanghua
2016-05-21 17:54:06 +08:00
parent 5446f882f7
commit 90dab2875b
3 changed files with 15 additions and 23 deletions

View File

@ -162,8 +162,7 @@ public class DownloadItemUtils {
switch (downloadEntry.getStatus()) {
case downloading:
if (!"pause".equals(statusMap.get(downloadEntry
.getUrl()))) {
if (!"pause".equals(statusMap.get(downloadEntry.getUrl()))) {
if (isShowPlatform) {
if (platform == null) {
download_speed
@ -211,18 +210,16 @@ public class DownloadItemUtils {
+ ")");
}
}
download_percentage.setText(downloadEntry.getPercent()
+ "%");
if (entity.getApk() != null
&& entity.getApk().size() == 1) {
downloadBtn.setText("暂停");
downloadBtn
.setBackgroundResource(R.drawable.textview_gray_style);
downloadBtn.setTextColor(0xFF999999);
download_percentage.setText(downloadEntry.getPercent() + "%");
if (entity.getApk() != null && entity.getApk().size() == 1) {
if (!"pause".equals(statusMap.get(downloadEntry.getUrl()))) {
downloadBtn.setText("暂停");
downloadBtn.setBackgroundResource(R.drawable.textview_gray_style);
downloadBtn.setTextColor(0xFF999999);
}
} else {
downloadBtn.setText("下载");
downloadBtn
.setBackgroundResource(R.drawable.textview_blue_style);
downloadBtn.setBackgroundResource(R.drawable.textview_blue_style);
downloadBtn.setTextColor(0xFFFFFFFF);
}
break;
@ -236,18 +233,14 @@ public class DownloadItemUtils {
} else {
download_speed.setText("等待");
}
download_percentage.setText(downloadEntry.getPercent()
+ "%");
if (entity.getApk() != null
&& entity.getApk().size() == 1) {
downloadBtn.setText("取消");
downloadBtn
.setBackgroundResource(R.drawable.textview_gray_style);
download_percentage.setText(downloadEntry.getPercent() + "%");
if (entity.getApk() != null && entity.getApk().size() == 1) {
downloadBtn.setText("等待");
downloadBtn.setBackgroundResource(R.drawable.textview_gray_style);
downloadBtn.setTextColor(0xFF999999);
} else {
downloadBtn.setText("下载");
downloadBtn
.setBackgroundResource(R.drawable.textview_blue_style);
downloadBtn.setBackgroundResource(R.drawable.textview_blue_style);
downloadBtn.setTextColor(0xFFFFFFFF);
}
break;

View File

@ -74,7 +74,7 @@ public class DownloadManager {
*/
private boolean checkDownloadEntryRecordValidate(String url) {
DownloadEntry entry = get(url);
if (entry != null) {
if (entry != null && ((int)entry.getPercent()) != 0) {
File file = new File(entry.getPath());
if (!file.exists()) {
DownloadDao.getInstance(context).delete(url);

View File

@ -99,7 +99,6 @@ public class Game1Fragment extends Fragment implements OnRefreshListener {
.entrySet()) {
DownloadEntry downloadEntry = entry.getValue();
String name = downloadEntry.getName();
Utils.log("name = " + name);
Integer location = locationMap.get(name);
if (location != null) {
int index = location.intValue();