Skip to content

Commit

Permalink
Fix #3
Browse files Browse the repository at this point in the history
  • Loading branch information
mariogrip committed Nov 1, 2014
1 parent 217deb5 commit e76e224
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion app/src/main/java/com/mariogrip/octodroid/Activity.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ public void run() {
texttimel.setText(" " + "-");
textprinttime.setText(" " + util.toHumanRead(Double.parseDouble(util.getData("job", "printTime").toString())));
progress.setProgress(util.getProgress());

}
break;
case 1:
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/com/mariogrip/octodroid/util.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,14 +245,16 @@ public static int getProgress(){
json = new JSONObject(jsonData_job);
JSONObject printTime_json = new JSONObject(json.getString("progress"));
String comp = printTime_json.getString("completion");
if (comp.equals("") || comp.equals("null")){
if (comp.equals("") || comp.equals("null")) {
acom = 0;
}else{
try {
acom = Double.parseDouble(comp);
}catch (NumberFormatException e){
acom = 0;
}
}
if (acom < 0){
if (acom < 1){
returnData = 0;
}else{
returnData = (int) acom;
Expand Down

0 comments on commit e76e224

Please sign in to comment.