Merge develop into master #1

Merged
SemvdH merged 297 commits from develop into main 2021-01-06 22:20:51 +00:00
2 changed files with 6 additions and 43 deletions
Showing only changes of commit f3e636f586 - Show all commits

View File

@@ -65,46 +65,4 @@ public class FileIO<T> {
}
return res;
}
// public void writeFileData(T objectToWrite, Context context) {
// //TODO make
// //object naar jsonobject
// //jsonarray toevoegen/maken
// //filewriter naar file
//
// String filename = "";
// if (objectToWrite instanceof Coupon){
// filename = "coupons.json";
// }
//
// if (objectToWrite instanceof Route){
// filename = "routes.json";
// }
//
// if (objectToWrite instanceof Location){
// filename = "locations.json";
// }
//
// try (FileOutputStream fileOutputStream = context.openFileOutput(filename, Context.MODE_PRIVATE)){
// String json = new Gson().toJson(objectToWrite);
//
// fileOutputStream.write(json.getBytes(StandardCharsets.UTF_8));
//
// } catch (FileNotFoundException e) {
// e.printStackTrace();
// } catch (IOException e) {
// e.printStackTrace();
// }
//
// /*try (FileWriter fileWriter = new FileWriter(filename)){
//
// String json = new Gson().toJson(objectToWrite);
//
// fileWriter.append(json);
// fileWriter.flush();
//
// } catch (IOException e) {
// e.printStackTrace();
// }*/
// }
}

View File

@@ -74,9 +74,14 @@ public class Route implements Parcelable {
return this.imageURL;
}
public int calculateTotalTimeMinutes() {
// 5 km / h walking speed
return (int) ((totalDistance / 1000) / 5) * 60;
}
public int getTotalTime() {
//TODO calculate total time according to all locations in list
return totalTime;
}