From 20d10224263dd20452226d9775f6b2439523a78f Mon Sep 17 00:00:00 2001 From: Antonin Rouxel Date: Fri, 12 Jan 2024 11:55:12 +0100 Subject: [PATCH 1/4] Update --- .../medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt b/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt index 0abb2baa..1918f05a 100644 --- a/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt +++ b/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt @@ -334,7 +334,7 @@ fun NavGraphBuilder.prescriptionNavGraph( "DrugQuantity" -> treatment.posology += " $word" "DrugForm" -> treatment.posology += " $word" "DrugFrequency" -> treatment.posology += " $word" - "DrugDuration" -> treatment.posology += " $word" + "DrugDuration" -> treatment.renew += " $word" } } @@ -344,7 +344,7 @@ fun NavGraphBuilder.prescriptionNavGraph( "DrugQuantity" -> treatment.posology += " $word" "DrugForm" -> treatment.posology += " $word" "DrugFrequency" -> treatment.posology += " $word" - "DrugDuration" -> treatment.posology += " $word" + "DrugDuration" -> treatment.renew += " $word" } } } From 165b69d760a9e744080ba2acd383622391f2e971 Mon Sep 17 00:00:00 2001 From: Quentin Date: Fri, 12 Jan 2024 11:58:27 +0100 Subject: [PATCH 2/4] =?UTF-8?q?Modification=20importation=20des=20donn?= =?UTF-8?q?=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../medicapp/ui/navigation/PrescriptionNavGraph.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt b/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt index 0abb2baa..52742b2c 100644 --- a/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt +++ b/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt @@ -10,7 +10,10 @@ import androidx.activity.result.contract.ActivityResultContracts import androidx.annotation.RequiresApi import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.material3.CircularProgressIndicator import androidx.compose.material3.LinearProgressIndicator import androidx.compose.material3.Text import androidx.compose.runtime.Composable @@ -22,6 +25,7 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.unit.dp import androidx.core.content.FileProvider import androidx.lifecycle.ViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle @@ -367,7 +371,11 @@ fun NavGraphBuilder.prescriptionNavGraph( Box(modifier = Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { Column(horizontalAlignment = Alignment.CenterHorizontally) { Text(text = "Traitement de l'ordonnance en cours...") - LinearProgressIndicator() + + Spacer(modifier = Modifier.height(10.dp)) + + //LinearProgressIndicator() + CircularProgressIndicator() } } } else { From 666609ddf73bab271fd95ea963c2d156a4fe9737 Mon Sep 17 00:00:00 2001 From: Quentin Date: Fri, 12 Jan 2024 12:01:16 +0100 Subject: [PATCH 3/4] Barre horizontale de chargement --- .../fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt b/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt index c37e4522..5c21f428 100644 --- a/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt +++ b/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt @@ -374,8 +374,7 @@ fun NavGraphBuilder.prescriptionNavGraph( Spacer(modifier = Modifier.height(10.dp)) - //LinearProgressIndicator() - CircularProgressIndicator() + LinearProgressIndicator() } } } else { From 4b5d65d45ec795c9a29ec02afbbab4700c36d26b Mon Sep 17 00:00:00 2001 From: Antonin Rouxel Date: Fri, 12 Jan 2024 12:02:00 +0100 Subject: [PATCH 4/4] Update --- .../fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt b/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt index 1918f05a..db6bf926 100644 --- a/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt +++ b/app/src/main/java/fr/medicapp/medicapp/ui/navigation/PrescriptionNavGraph.kt @@ -313,7 +313,7 @@ fun NavGraphBuilder.prescriptionNavGraph( onResult = { success: Boolean -> hasImage = success - if (imageUri != null) { + if (imageUri != null && success) { loading.value = true val prescriptionAI = PrescriptionAI.getInstance(context) val prediction = prescriptionAI.analyse(