From 3483aa72525e5a436b710322ff6062da763e5e19 Mon Sep 17 00:00:00 2001 From: jacques Date: Sun, 12 Apr 2020 17:57:48 +0000 Subject: [PATCH] Realign --- .../pilldroid/MedicamentDetailActivity.java | 1 + .../pilldroid/MedicamentDetailFragment.java | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailActivity.java b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailActivity.java index 773be84..3e047d1 100644 --- a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailActivity.java @@ -36,6 +36,7 @@ public class MedicamentDetailActivity extends AppCompatActivity { Snackbar.make(view, "Will be use to save changes in a drug", Snackbar.LENGTH_LONG) .setAction("Action", null).show(); setResult(1); + finish(); } }); diff --git a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java index b9f843d..7c2b196 100644 --- a/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java +++ b/app/src/main/java/net/foucry/pilldroid/MedicamentDetailFragment.java @@ -122,14 +122,22 @@ public class MedicamentDetailFragment extends Fragment { { Context context = getContext(); Toast.makeText(context, "***PROUT***", Toast.LENGTH_SHORT).show(); + View currentView = getView(); + View nameView; + View adminModeView; + View presentationView; + View stockView; + View priseView; + View warningView; + View alertView; - Intent intent = getIntent(); + stockView = currentView.findViewById(R.id.alert_cell); + TextView stockValue = stockView.findViewById(R.id.valeur); - String presentation = intent.getStringExtra("Presentation"); - String name = intent.getStringExtra("Nom"); + Log.d(TAG, "StockValue == "+ stockValue); + Log.d(TAG, "medicamentID "+ medicament.getId()); - Log.d(TAG, "value of Presentation "+ presentation); - Log.d(TAG, "value of Nom "+ name); + Toast.makeText(context,"stock value "+ stockValue, Toast.LENGTH_SHORT).show(); super.onStop(); } }