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