overview scroll, determinebasal fix
This commit is contained in:
parent
88698576a2
commit
267e0220c0
4 changed files with 193 additions and 172 deletions
|
@ -23,11 +23,14 @@ public class APSResult implements Parcelable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
if (changeRequested)
|
if (changeRequested) {
|
||||||
|
if (rate == 0 && duration == 0)
|
||||||
|
return MainApp.sResources.getString(R.string.canceltemp);
|
||||||
|
else
|
||||||
return MainApp.sResources.getString(R.string.rate) + ": " + DecimalFormatter.to2Decimal(rate) + " U/h\n" +
|
return MainApp.sResources.getString(R.string.rate) + ": " + DecimalFormatter.to2Decimal(rate) + " U/h\n" +
|
||||||
MainApp.sResources.getString(R.string.duration) + ": " + DecimalFormatter.to0Decimal(duration) + " min\n" +
|
MainApp.sResources.getString(R.string.duration) + ": " + DecimalFormatter.to0Decimal(duration) + " min\n" +
|
||||||
MainApp.sResources.getString(R.string.reason) + ": " + reason;
|
MainApp.sResources.getString(R.string.reason) + ": " + reason;
|
||||||
else
|
} else
|
||||||
return MainApp.sResources.getString(R.string.nochangerequested);
|
return MainApp.sResources.getString(R.string.nochangerequested);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -172,6 +172,9 @@ public class OpenAPSMAPlugin implements PluginBase, APSInterface {
|
||||||
|
|
||||||
|
|
||||||
DetermineBasalResult determineBasalResult = determineBasalAdapterJS.invoke();
|
DetermineBasalResult determineBasalResult = determineBasalAdapterJS.invoke();
|
||||||
|
// Fix bug determine basal
|
||||||
|
if (determineBasalResult.rate == 0d && determineBasalResult.duration == 0 && !MainApp.getConfigBuilder().isTempBasalInProgress()) determineBasalResult.changeRequested = false;
|
||||||
|
|
||||||
determineBasalResult.iob = iobTotal;
|
determineBasalResult.iob = iobTotal;
|
||||||
|
|
||||||
determineBasalAdapterJS.release();
|
determineBasalAdapterJS.release();
|
||||||
|
|
|
@ -202,7 +202,7 @@ public class OverviewFragment extends Fragment {
|
||||||
sHandler.post(new Runnable() {
|
sHandler.post(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
acceptTempLayout.setVisibility(View.GONE);
|
hideTempRecommendation();
|
||||||
PumpEnactResult applyResult = MainApp.getConfigBuilder().applyAPSRequest(finalLastRun.constraintsProcessed);
|
PumpEnactResult applyResult = MainApp.getConfigBuilder().applyAPSRequest(finalLastRun.constraintsProcessed);
|
||||||
if (applyResult.enacted) {
|
if (applyResult.enacted) {
|
||||||
finalLastRun.setByPump = applyResult;
|
finalLastRun.setByPump = applyResult;
|
||||||
|
@ -282,6 +282,17 @@ public class OverviewFragment extends Fragment {
|
||||||
updateGUIIfVisible();
|
updateGUIIfVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void hideTempRecommendation() {
|
||||||
|
Activity activity = getActivity();
|
||||||
|
if (activity != null)
|
||||||
|
activity.runOnUiThread(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
acceptTempLayout.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void updateGUIIfVisible() {
|
private void updateGUIIfVisible() {
|
||||||
Activity activity = getActivity();
|
Activity activity = getActivity();
|
||||||
if (activity != null)
|
if (activity != null)
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
tools:context="info.nightscout.androidaps.plugins.Overview.OverviewFragment">
|
tools:context="info.nightscout.androidaps.plugins.Overview.OverviewFragment">
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -198,7 +201,8 @@
|
||||||
android:textColor="@color/colorWizardButton" />
|
android:textColor="@color/colorWizardButton" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
Loading…
Reference in a new issue