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) {
|
||||||
return MainApp.sResources.getString(R.string.rate) + ": " + DecimalFormatter.to2Decimal(rate) + " U/h\n" +
|
if (rate == 0 && duration == 0)
|
||||||
MainApp.sResources.getString(R.string.duration) + ": " + DecimalFormatter.to0Decimal(duration) + " min\n" +
|
return MainApp.sResources.getString(R.string.canceltemp);
|
||||||
MainApp.sResources.getString(R.string.reason) + ": " + reason;
|
else
|
||||||
else
|
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.reason) + ": " + reason;
|
||||||
|
} 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,201 +4,205 @@
|
||||||
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
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent">
|
||||||
android:orientation="vertical">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/overview_bg"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="top|left"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:text="00.0"
|
|
||||||
android:textSize="80dp"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="top"
|
android:orientation="horizontal">
|
||||||
android:layout_marginTop="10dp"
|
|
||||||
android:gravity="center_vertical"
|
<TextView
|
||||||
android:orientation="vertical">
|
android:id="@+id/overview_bg"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="top|left"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:text="00.0"
|
||||||
|
android:textSize="80dp"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
android:layout_gravity="top"
|
||||||
|
android:layout_marginTop="10dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/overview_timeago"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/overview_apsmode"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:background="@drawable/loopmodeborder"
|
||||||
|
android:gravity="center_vertical|center_horizontal"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:paddingRight="5dp"
|
||||||
|
android:text="Medium Text"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/overview_timeago"
|
android:id="@+id/overview_delta"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/overview_apsmode"
|
android:id="@+id/overview_runningtemp"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginRight="10dp"
|
android:layout_marginLeft="10dp"
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:background="@drawable/loopmodeborder"
|
|
||||||
android:gravity="center_vertical|center_horizontal"
|
|
||||||
android:paddingLeft="5dp"
|
|
||||||
android:paddingRight="5dp"
|
|
||||||
android:text="Medium Text"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
</LinearLayout>
|
||||||
android:id="@+id/overview_delta"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/overview_runningtemp"
|
android:id="@+id/overview_iob"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="10dp"
|
android:layout_gravity="center_horizontal"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
android:layout_marginLeft="10dp"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
|
|
||||||
|
<com.jjoe64.graphview.GraphView
|
||||||
|
android:id="@+id/overview_bggraph"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="160dip" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/overview_accepttemplayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/overview_accepttempbutton"
|
||||||
|
style="?android:attr/buttonStyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="3dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:text="Accept new temp\n0.25U/h"
|
||||||
|
android:textColor="@color/colorAcceptTempButton" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/overview_canceltemplayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/overview_canceltemp"
|
||||||
|
style="?android:attr/buttonStyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="3dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:text="Cancel temp basal"
|
||||||
|
android:textColor="@color/colorCancelTempButton" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/overview_settemplayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/overview_settempbasal"
|
||||||
|
style="?android:attr/buttonStyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="3dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:text="@string/overview_tempbasal_button"
|
||||||
|
android:textColor="@color/colorSetTempButton" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/overview_extendedbolus"
|
||||||
|
style="?android:attr/buttonStyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="3dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:text="@string/overview_extendedbolus_button"
|
||||||
|
android:textColor="@color/colorSetExtendedButton" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/overview_treatment"
|
||||||
|
style="?android:attr/buttonStyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="3dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:text="@string/overview_bolus_label"
|
||||||
|
android:textColor="@color/colorTreatmentButton" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/overview_wizard"
|
||||||
|
style="?android:attr/buttonStyle"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginBottom="3dp"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:layout_weight="0.5"
|
||||||
|
android:text="@string/overview_calculator_label"
|
||||||
|
android:textColor="@color/colorWizardButton" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
</ScrollView>
|
||||||
android:id="@+id/overview_iob"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_gravity="center_horizontal"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
|
||||||
|
|
||||||
<com.jjoe64.graphview.GraphView
|
|
||||||
android:id="@+id/overview_bggraph"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="160dip" />
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/overview_accepttemplayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/overview_accepttempbutton"
|
|
||||||
style="?android:attr/buttonStyle"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="3dp"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginTop="3dp"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:text="Accept new temp\n0.25U/h"
|
|
||||||
android:textColor="@color/colorAcceptTempButton" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/overview_canceltemplayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/overview_canceltemp"
|
|
||||||
style="?android:attr/buttonStyle"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="3dp"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginTop="3dp"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:text="Cancel temp basal"
|
|
||||||
android:textColor="@color/colorCancelTempButton" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:id="@+id/overview_settemplayout"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/overview_settempbasal"
|
|
||||||
style="?android:attr/buttonStyle"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="3dp"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginTop="3dp"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:text="@string/overview_tempbasal_button"
|
|
||||||
android:textColor="@color/colorSetTempButton" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/overview_extendedbolus"
|
|
||||||
style="?android:attr/buttonStyle"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="3dp"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginTop="3dp"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:text="@string/overview_extendedbolus_button"
|
|
||||||
android:textColor="@color/colorSetExtendedButton" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
<LinearLayout
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:orientation="horizontal">
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/overview_treatment"
|
|
||||||
style="?android:attr/buttonStyle"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="3dp"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginTop="3dp"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:text="@string/overview_bolus_label"
|
|
||||||
android:textColor="@color/colorTreatmentButton" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
android:id="@+id/overview_wizard"
|
|
||||||
style="?android:attr/buttonStyle"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginBottom="3dp"
|
|
||||||
android:layout_marginLeft="10dp"
|
|
||||||
android:layout_marginRight="10dp"
|
|
||||||
android:layout_marginTop="3dp"
|
|
||||||
android:layout_weight="0.5"
|
|
||||||
android:text="@string/overview_calculator_label"
|
|
||||||
android:textColor="@color/colorWizardButton" />
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
Loading…
Reference in a new issue