This commit is contained in:
AriaLyy
2017-08-01 15:33:41 +08:00
parent 7055093f7a
commit d22d7a3e6b
5 changed files with 36 additions and 14 deletions

View File

@ -42,6 +42,7 @@ public class SingleTaskActivity extends BaseActivity<ActivitySingleBinding> {
private static final String DOWNLOAD_URL =
//"http://kotlinlang.org/docs/kotlin-docs.pdf";
//"https://atom-installer.github.com/v1.13.0/AtomSetup.exe?s=1484074138&ext=.exe";
//"http://static.gaoshouyou.com/d/22/94/822260b849944492caadd2983f9bb624.apk";
"http://static.gaoshouyou.com/d/22/94/822260b849944492caadd2983f9bb624.apk";
//"http://down2.xiaoshuofuwuqi.com/d/file/filetxt/20170608/14/%BA%DA%CE%D7%CA%A6%E1%C8%C6%F0.txt";
//"http://tinghuaapp.oss-cn-shanghai.aliyuncs.com/20170612201739607815";

View File

@ -93,7 +93,8 @@ public class DownloadAdapter extends AbsRVAdapter<AbsEntity, DownloadAdapter.Sim
}
public synchronized void updateState(AbsEntity entity) {
if (entity.getState() == DownloadEntity.STATE_CANCEL) {
if (entity.getState() == IEntity.STATE_CANCEL) {
mData.remove(entity);
mPositions.clear();
int i = 0;
for (AbsEntity entity_1 : mData) {
@ -217,10 +218,10 @@ public class DownloadAdapter extends AbsRVAdapter<AbsEntity, DownloadAdapter.Sim
}
private void handleSubChild(GroupHolder holder, final AbsEntity entity) {
if (holder.childList.getSubData().size() > 0){
holder.childList.updateChildProgress(((DownloadGroupEntity)entity).getSubTask());
}else {
holder.childList.addData(((DownloadGroupEntity)entity).getSubTask());
if (holder.childList.getSubData().size() > 0) {
holder.childList.updateChildProgress(((DownloadGroupEntity) entity).getSubTask());
} else {
holder.childList.addData(((DownloadGroupEntity) entity).getSubTask());
}
}