proper iob update on treatmnets&temps tab
This commit is contained in:
parent
35ff53dbb4
commit
582ffc3c9a
2 changed files with 7 additions and 25 deletions
|
@ -207,17 +207,6 @@ public class TempBasalsFragment extends Fragment implements PluginBase, TempBasa
|
||||||
TempBasal t = tempBasals.get(pos);
|
TempBasal t = tempBasals.get(pos);
|
||||||
total.plus(t.iobCalc(now));
|
total.plus(t.iobCalc(now));
|
||||||
}
|
}
|
||||||
final IobTotal finalTotal = total;
|
|
||||||
|
|
||||||
Activity activity = getActivity();
|
|
||||||
if (visibleNow && activity != null && recyclerView != null)
|
|
||||||
activity.runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (iobTotal != null)
|
|
||||||
iobTotal.setText(formatNumber2decimalplaces.format(finalTotal.basaliob));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
lastCalculationTimestamp = new Date().getTime();
|
lastCalculationTimestamp = new Date().getTime();
|
||||||
lastCalculation = total;
|
lastCalculation = total;
|
||||||
|
@ -385,6 +374,9 @@ public class TempBasalsFragment extends Fragment implements PluginBase, TempBasa
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
recyclerView.swapAdapter(new RecyclerViewAdapter(tempBasals), false);
|
recyclerView.swapAdapter(new RecyclerViewAdapter(tempBasals), false);
|
||||||
|
if (lastCalculation != null)
|
||||||
|
iobTotal.setText(formatNumber2decimalplaces.format(lastCalculation.basaliob));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,20 +154,6 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
|
||||||
total.bolussnooze += bIOB.iobContrib;
|
total.bolussnooze += bIOB.iobContrib;
|
||||||
}
|
}
|
||||||
|
|
||||||
final IobTotal finalTotal = total;
|
|
||||||
|
|
||||||
Activity activity = getActivity();
|
|
||||||
if (visibleNow && activity != null && recyclerView != null)
|
|
||||||
activity.runOnUiThread(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (iobTotal != null)
|
|
||||||
iobTotal.setText(formatNumber2decimalplaces.format(finalTotal.iob));
|
|
||||||
if (activityTotal != null)
|
|
||||||
activityTotal.setText(formatNumber3decimalplaces.format(finalTotal.activity));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
lastCalculationTimestamp = new Date().getTime();
|
lastCalculationTimestamp = new Date().getTime();
|
||||||
lastCalculation = total;
|
lastCalculation = total;
|
||||||
}
|
}
|
||||||
|
@ -346,6 +332,10 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
recyclerView.swapAdapter(new RecyclerViewAdapter(treatments), false);
|
recyclerView.swapAdapter(new RecyclerViewAdapter(treatments), false);
|
||||||
|
if (lastCalculation != null)
|
||||||
|
iobTotal.setText(formatNumber2decimalplaces.format(lastCalculation.iob));
|
||||||
|
if (lastCalculation != null)
|
||||||
|
activityTotal.setText(formatNumber3decimalplaces.format(lastCalculation.activity));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue