From b3079837d3d51cbe90b0e51686fb1a3b36411bba Mon Sep 17 00:00:00 2001 From: jacques Date: Sat, 30 Jul 2022 08:34:11 +0200 Subject: [PATCH] factorize a non-use method (after finding another method --- app/src/main/java/net/foucry/pilldroid/Utils.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/src/main/java/net/foucry/pilldroid/Utils.java b/app/src/main/java/net/foucry/pilldroid/Utils.java index 41f5766..dc942a6 100644 --- a/app/src/main/java/net/foucry/pilldroid/Utils.java +++ b/app/src/main/java/net/foucry/pilldroid/Utils.java @@ -59,4 +59,15 @@ public class Utils { } }); } + + public static void rearrangePrescriptionList(List prescriptionList) { + Prescription currentPrescription = null; + for (int i=0 ; i < prescriptionList.size(); i++ ){ + currentPrescription = prescriptionList.get(i); + if (currentPrescription.getTake() == 0) { + prescriptionList.remove(currentPrescription); + prescriptionList.add(prescriptionList.size(), currentPrescription); + } + } + } }