From c79a5725fdc0f1a321e806bf2d83287e2bc4ee52 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Tue, 18 Jul 2017 13:19:43 +0200 Subject: [PATCH] Update InsulinFastactingProlongedFragment.java ... in case DIA has changed. --- .../InsulinFastactingProlongedFragment.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/InsulinFastactingProlonged/InsulinFastactingProlongedFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/InsulinFastactingProlonged/InsulinFastactingProlongedFragment.java index acc915b001..e1d0143934 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/InsulinFastactingProlonged/InsulinFastactingProlongedFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/InsulinFastactingProlonged/InsulinFastactingProlongedFragment.java @@ -36,12 +36,22 @@ public class InsulinFastactingProlongedFragment extends Fragment { insulinDia = (TextView) view.findViewById(R.id.insulin_dia); insulinGraph = (ActivityGraph) view.findViewById(R.id.insuling_graph); - insulinName.setText(insulinFastactingProlongedPlugin.getFriendlyName()); - insulinComment.setText(insulinFastactingProlongedPlugin.getComment()); - insulinDia.setText(MainApp.sResources.getText(R.string.dia) + " " + new Double(insulinFastactingProlongedPlugin.getDia()).toString() + "h"); - insulinGraph.show(insulinFastactingProlongedPlugin); + updateGUI(); return view; } + @Override + public void onResume() { + super.onResume(); + updateGUI(); + } + + private void updateGUI() { + insulinName.setText(insulinFastactingProlongedPlugin.getFriendlyName()); + insulinComment.setText(insulinFastactingProlongedPlugin.getComment()); + insulinDia.setText(MainApp.sResources.getText(R.string.dia) + " " + new Double(insulinFastactingProlongedPlugin.getDia()).toString() + "h"); + insulinGraph.show(insulinFastactingProlongedPlugin); + } + }