Commit 19c9dcc6 authored by Ivan Del Pino's avatar Ivan Del Pino Committed by Alexander Salas Bastidas
Browse files

feat(range): change range to get split urls


Signed-off-by: default avatarIvan Del Pino <idelpino@teclib.com>
parent 15d0b9e4
......@@ -645,9 +645,9 @@ public class MainActivity extends AppCompatActivity {
updateAdapter("Error: Download file" + errorMessage);
}
});
String[] values = {url, url, url, url, url};
String[] urls = {url, url, url, url, url, url, url};
glpi.handleMultipleDownload(values, 0, 3, new GLPI.ResponseHandle<ArrayList<ResponseBody>, String>() {
glpi.handleMultipleDownload(urls, 0, 3, new GLPI.ResponseHandle<ArrayList<ResponseBody>, String>() {
@Override
public void onResponse(ArrayList<ResponseBody> response) {
Toast.makeText(MainActivity.this, "Success", Toast.LENGTH_SHORT).show();
......
......@@ -570,6 +570,7 @@ public class GLPI extends ServiceGenerator {
ArrayList<ArrayList<Observable<ResponseBody>>> listRxUrls = new ArrayList<>();
String[] listModifyUrls = splitArray(urls, start, step);
int starts = start;
while (true) {
for (String url : listModifyUrls) {
......@@ -580,7 +581,8 @@ public class GLPI extends ServiceGenerator {
listUrls.add(observableOne);
}
}
listModifyUrls = splitArray(urls, start + step, step);
starts = starts + step;
listModifyUrls = splitArray(urls, starts, step);
listRxUrls.add(listUrls);
listUrls = new ArrayList<>();
if (listModifyUrls.length == 0)
......@@ -602,6 +604,7 @@ public class GLPI extends ServiceGenerator {
@Override
public void run() throws Exception {
callback.onResponse(listResponseBody);
listResponseBody.clear();
}
})
.subscribe(new Consumer<ResponseBody>() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment