- Progress pg = new Progress(getString(json, "name"),
- getInt(json, "min", 0), getInt(json, "max", 100));
- pg.setProgress(getInt(json, "progress", 0));
+ Progress pg = new Progress( //
+ getString(json, "name"), //
+ getInt(json, "min", 0), //
+ getInt(json, "max", 100) //
+ );
+
+ pg.setRelativeProgress(getDouble(json, "progress", 0));
+
+ Object meta = getObject(json, "meta");
+ if (meta != null) {
+ pg.put("meta", meta);
+ }
+
+ JSONArray jchildren = getJsonArr(json, "children");
+ for (int i = 0; i < jchildren.length(); i++) {
+ try {
+ JSONObject jchild = jchildren.getJSONObject(i);
+ Double weight = getDouble(jchild, "weight", 0);
+ pg.addProgress(toProgress(jchild), weight);
+ } catch (Exception e) {
+ }
+ }