From c847db66a3135dae1db0ab47d893abd6b0d4554a Mon Sep 17 00:00:00 2001 From: Jacques Foucry Date: Tue, 21 Apr 2020 21:53:16 +0200 Subject: [PATCH] Add grabbing prise, warning and alert values; display and current medicament values --- .../pilldroid/MedicamentDetailFragment.java | 30 ++++++++++++++----- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java index 26d31ed..3a0cde4 100644 --- a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java +++ b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java @@ -120,24 +120,38 @@ public class MedicamentDetailFragment extends Fragment { public void onStop() { Context context = getContext(); - Toast.makeText(context, "***PROUT***", Toast.LENGTH_SHORT).show(); View currentView = getView(); - View nameView; - View adminModeView; - View presentationView; + // View nameView; + // View adminModeView; + // View presentationView; View stockView; View priseView; View warningView; View alertView; - stockView = currentView.findViewById(R.id.alert_cell); + stockView = currentView.findViewById(R.id.stock_cell); TextView stockTextView = stockView.findViewById(R.id.valeur); String stockValue = stockTextView.getText().toString(); - Log.d(TAG, "StockValue == "+ stockValue); - Log.d(TAG, "medicamentID "+ medicament.getId()); + priseView = currentView.findViewById(R.id.prise_cell); + TextView priseTextView = priseView.findViewById(R.id.valeur); + String priseValue = priseTextView.getText().toString(); + + alertView = currentView.findViewById(R.id.alert_cell); + TextView alertTextView = alertView.findViewById(R.id.valeur); + String alertValue = alertTextView.getText().toString(); + + warningView = currentView.findViewById(R.id.warning_cell); + TextView warningTextView = warningView.findViewById(R.id.valeur); + String warningValue = warningTextView.getText().toString(); + + Log.d(TAG, "StockValue == "+ stockValue); + Log.d(TAG, "PriseValue == "+ priseValue); + Log.d(TAG, "AlertValue == "+ alertValue); + Log.d(TAG, "WarningValue == "+ warningValue); + Log.d(TAG, "medicamentID "+ medicament.getId()); + Log.d(TAG, "medicament "+ medicament()); - Toast.makeText(context,"stock value "+ stockValue, Toast.LENGTH_SHORT).show(); super.onStop(); } }