support start all item in download scene from the bottom up

This commit is contained in:
Epix authored and NekoInverter committed 2020-03-26 13:43:13 +08:00
1 parent b9dbfc99d6
commit b85bb1fa8e
4 files changed
+24

No files matched your search

@@ -551,6 +551,24 @@ public class DownloadsScene extends ToolbarScene
}).show();
return true;
}
case R.id.action_start_all_reversed: {
List<DownloadInfo> list = mList;
if (list == null) {
return true;
}
LongList gidList = new LongList();
for (int i = list.size() - 1; i > -1; i--) {
DownloadInfo info = list.get(i);
if(info.state!=DownloadInfo.STATE_FINISH){
gidList.add(info.gid);
}
}
Intent intent = new Intent(activity, DownloadService.class);
intent.setAction(DownloadService.ACTION_START_RANGE);
intent.putExtra(DownloadService.KEY_GID_LIST, gidList);
activity.startService(intent);
return true;
}
}
return false;
}