xml reformating, some code cleaning
This commit is contained in:
parent
3127870770
commit
f7715a3409
28 changed files with 431 additions and 205 deletions
|
@ -11,7 +11,8 @@ public class Config {
|
||||||
public static final boolean OPENAPSMAENABLED = APS && true;
|
public static final boolean OPENAPSMAENABLED = APS && true;
|
||||||
public static final boolean LOOPENABLED = APS && true;
|
public static final boolean LOOPENABLED = APS && true;
|
||||||
public static final boolean OBJECTIVESENABLED = APS && true;
|
public static final boolean OBJECTIVESENABLED = APS && true;
|
||||||
public static final boolean CAREPORTALENABLED = APS && true;
|
|
||||||
|
public static final boolean CAREPORTALENABLED = true;
|
||||||
|
|
||||||
public static final boolean DANAR = true;
|
public static final boolean DANAR = true;
|
||||||
|
|
||||||
|
|
|
@ -2,11 +2,14 @@ package info.nightscout.androidaps.data;
|
||||||
|
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.Spanned;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import info.nightscout.androidaps.MainApp;
|
import info.nightscout.androidaps.MainApp;
|
||||||
|
import info.nightscout.androidaps.R;
|
||||||
import info.nightscout.client.data.NSProfile;
|
import info.nightscout.client.data.NSProfile;
|
||||||
import info.nightscout.utils.Round;
|
import info.nightscout.utils.Round;
|
||||||
|
|
||||||
|
@ -30,22 +33,53 @@ public class PumpEnactResult extends Object implements Parcelable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
String ret = "Success: " + success;
|
String ret = MainApp.sResources.getString(R.string.success) + ": " + success;
|
||||||
if (enacted) {
|
if (enacted) {
|
||||||
if (isTempCancel) {
|
if (isTempCancel) {
|
||||||
ret += "\nEnacted: " + enacted + "\nComment: " + comment + "\n" +
|
ret += "\n" + MainApp.sResources.getString(R.string.enacted) + ": " + enacted;
|
||||||
"Temp cancel";
|
ret += "\n" + MainApp.sResources.getString(R.string.comment) + ": " + comment + "\n" +
|
||||||
|
MainApp.sResources.getString(R.string.tempcancel);
|
||||||
} else if (isPercent) {
|
} else if (isPercent) {
|
||||||
ret += "\nEnacted: " + enacted + "\nComment: " + comment + "\nDuration: " + duration + " min\nPercent: " + percent + "%";
|
ret += "\n" + MainApp.sResources.getString(R.string.enacted) + ": " + enacted;
|
||||||
|
ret += "\n" + MainApp.sResources.getString(R.string.comment) + ": " + comment;
|
||||||
|
ret += "\n" + MainApp.sResources.getString(R.string.duration) + ": " + duration + " min";
|
||||||
|
ret += "\n" + MainApp.sResources.getString(R.string.percent) + ": " + percent + "%";
|
||||||
} else {
|
} else {
|
||||||
ret += "\nEnacted: " + enacted + "\nComment: " + comment + "\nDuration: " + duration + " min\nAbsolute: " + absolute + " U/h";
|
ret += "\n" + MainApp.sResources.getString(R.string.enacted) + ": " + enacted;
|
||||||
|
ret += "\n" + MainApp.sResources.getString(R.string.comment) + ": " + comment;
|
||||||
|
ret += "\n" + MainApp.sResources.getString(R.string.duration) + ": " + duration + " min";
|
||||||
|
ret += "\n" + MainApp.sResources.getString(R.string.absolute) + ": " + absolute + " U/h";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
ret += "\nComment: " + comment;
|
ret += "\n" + MainApp.sResources.getString(R.string.comment) + ": " + comment;
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Spanned toSpanned() {
|
||||||
|
String ret = "<b>" + MainApp.sResources.getString(R.string.success) + "</b>: " + success;
|
||||||
|
if (enacted) {
|
||||||
|
if (isTempCancel) {
|
||||||
|
ret += "<br><b>" + MainApp.sResources.getString(R.string.enacted) + "</b>: " + enacted;
|
||||||
|
ret += "<br><b>" + MainApp.sResources.getString(R.string.comment) + "</b>: " + comment +
|
||||||
|
"<br>" + MainApp.sResources.getString(R.string.tempcancel);
|
||||||
|
} else if (isPercent) {
|
||||||
|
ret += "<br><b>" + MainApp.sResources.getString(R.string.enacted) + "</b>: " + enacted;
|
||||||
|
ret += "<br><b>" + MainApp.sResources.getString(R.string.comment) + "</b>: " + comment;
|
||||||
|
ret += "<br><b>" + MainApp.sResources.getString(R.string.duration) + "</b>: " + duration + " min";
|
||||||
|
ret += "<br><b>" + MainApp.sResources.getString(R.string.percent) + "</b>: " + percent + "%";
|
||||||
|
} else {
|
||||||
|
ret += "<br><b>" + MainApp.sResources.getString(R.string.enacted) + "</b>: " + enacted;
|
||||||
|
ret += "<br><b>" + MainApp.sResources.getString(R.string.comment) + "</b>: " + comment;
|
||||||
|
ret += "<br><b>" + MainApp.sResources.getString(R.string.duration) + "</b>: " + duration + " min";
|
||||||
|
ret += "<br><b>" + MainApp.sResources.getString(R.string.absolute) + "</b>: " + absolute + " U/h";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ret += "<br><b>" + MainApp.sResources.getString(R.string.comment) + "</b>: " + comment;
|
||||||
|
}
|
||||||
|
return Html.fromHtml(ret);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int describeContents() {
|
public int describeContents() {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -12,6 +12,8 @@ import android.database.sqlite.SQLiteDatabase;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.Spanned;
|
||||||
|
|
||||||
import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
|
import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
|
||||||
import com.j256.ormlite.dao.Dao;
|
import com.j256.ormlite.dao.Dao;
|
||||||
|
@ -31,6 +33,7 @@ import info.nightscout.androidaps.R;
|
||||||
import info.nightscout.androidaps.events.EventNewBG;
|
import info.nightscout.androidaps.events.EventNewBG;
|
||||||
import info.nightscout.androidaps.events.EventTempBasalChange;
|
import info.nightscout.androidaps.events.EventTempBasalChange;
|
||||||
import info.nightscout.androidaps.events.EventTreatmentChange;
|
import info.nightscout.androidaps.events.EventTreatmentChange;
|
||||||
|
import info.nightscout.utils.DecimalFormatter;
|
||||||
import info.nightscout.utils.Round;
|
import info.nightscout.utils.Round;
|
||||||
|
|
||||||
public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
|
@ -213,13 +216,15 @@ public class DatabaseHelper extends OrmLiteSqliteOpenHelper {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
Context context = MainApp.instance().getApplicationContext();
|
return MainApp.sResources.getString(R.string.glucose) + " " + DecimalFormatter.to0Decimal(glucose) + " mg/dl\n" +
|
||||||
DecimalFormat formatNumber0decimalplaces = new DecimalFormat("0");
|
MainApp.sResources.getString(R.string.delta) + " " + DecimalFormatter.to0Decimal(delta) + " mg/dl\n" +
|
||||||
DecimalFormat formatNumber2decimalplaces = new DecimalFormat("0.00");
|
MainApp.sResources.getString(R.string.avgdelta) + " " + DecimalFormatter.to2Decimal(avgdelta) + " mg/dl";
|
||||||
|
}
|
||||||
|
|
||||||
return context.getString(R.string.glucose) + " " + formatNumber0decimalplaces.format(glucose) + "\n" +
|
public Spanned toSpanned() {
|
||||||
context.getString(R.string.delta) + " " + formatNumber0decimalplaces.format(delta) + "\n" +
|
return Html.fromHtml("<b>" + MainApp.sResources.getString(R.string.glucose) + "</b>: " + DecimalFormatter.to0Decimal(glucose) + " mg/dl<br>" +
|
||||||
context.getString(R.string.avgdelta) + " " + formatNumber2decimalplaces.format(avgdelta);
|
"<b>" + MainApp.sResources.getString(R.string.delta) + "</b>: " + DecimalFormatter.to0Decimal(delta) + " mg/dl<br>" +
|
||||||
|
"<b>" + MainApp.sResources.getString(R.string.avgdelta) + "</b>: " + DecimalFormatter.to2Decimal(avgdelta) + " mg/dl");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -61,10 +61,12 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
ListView bgsourceListView;
|
ListView bgsourceListView;
|
||||||
ListView pumpListView;
|
ListView pumpListView;
|
||||||
ListView loopListView;
|
ListView loopListView;
|
||||||
|
TextView loopLabel;
|
||||||
ListView treatmentsListView;
|
ListView treatmentsListView;
|
||||||
ListView tempsListView;
|
ListView tempsListView;
|
||||||
ListView profileListView;
|
ListView profileListView;
|
||||||
ListView apsListView;
|
ListView apsListView;
|
||||||
|
TextView apsLabel;
|
||||||
ListView constraintsListView;
|
ListView constraintsListView;
|
||||||
ListView generalListView;
|
ListView generalListView;
|
||||||
TextView nsclientVerView;
|
TextView nsclientVerView;
|
||||||
|
@ -95,6 +97,8 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
|
|
||||||
ArrayList<PluginBase> pluginList;
|
ArrayList<PluginBase> pluginList;
|
||||||
|
|
||||||
|
// TODO: sorting
|
||||||
|
|
||||||
public ConfigBuilderFragment() {
|
public ConfigBuilderFragment() {
|
||||||
super();
|
super();
|
||||||
registerBus();
|
registerBus();
|
||||||
|
@ -126,10 +130,12 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
bgsourceListView = (ListView) view.findViewById(R.id.configbuilder_bgsourcelistview);
|
bgsourceListView = (ListView) view.findViewById(R.id.configbuilder_bgsourcelistview);
|
||||||
pumpListView = (ListView) view.findViewById(R.id.configbuilder_pumplistview);
|
pumpListView = (ListView) view.findViewById(R.id.configbuilder_pumplistview);
|
||||||
loopListView = (ListView) view.findViewById(R.id.configbuilder_looplistview);
|
loopListView = (ListView) view.findViewById(R.id.configbuilder_looplistview);
|
||||||
|
loopLabel = (TextView) view.findViewById(R.id.configbuilder_looplabel);
|
||||||
treatmentsListView = (ListView) view.findViewById(R.id.configbuilder_treatmentslistview);
|
treatmentsListView = (ListView) view.findViewById(R.id.configbuilder_treatmentslistview);
|
||||||
tempsListView = (ListView) view.findViewById(R.id.configbuilder_tempslistview);
|
tempsListView = (ListView) view.findViewById(R.id.configbuilder_tempslistview);
|
||||||
profileListView = (ListView) view.findViewById(R.id.configbuilder_profilelistview);
|
profileListView = (ListView) view.findViewById(R.id.configbuilder_profilelistview);
|
||||||
apsListView = (ListView) view.findViewById(R.id.configbuilder_apslistview);
|
apsListView = (ListView) view.findViewById(R.id.configbuilder_apslistview);
|
||||||
|
apsLabel = (TextView) view.findViewById(R.id.configbuilder_apslabel);
|
||||||
constraintsListView = (ListView) view.findViewById(R.id.configbuilder_constraintslistview);
|
constraintsListView = (ListView) view.findViewById(R.id.configbuilder_constraintslistview);
|
||||||
generalListView = (ListView) view.findViewById(R.id.configbuilder_generallistview);
|
generalListView = (ListView) view.findViewById(R.id.configbuilder_generallistview);
|
||||||
nsclientVerView = (TextView) view.findViewById(R.id.configbuilder_nsclientversion);
|
nsclientVerView = (TextView) view.findViewById(R.id.configbuilder_nsclientversion);
|
||||||
|
@ -144,7 +150,6 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
}
|
}
|
||||||
|
|
||||||
void setViews() {
|
void setViews() {
|
||||||
// TODO: hide empty categories
|
|
||||||
bgsourceDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainActivity.getSpecificPluginsList(PluginBase.BGSOURCE), PluginBase.BGSOURCE);
|
bgsourceDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainActivity.getSpecificPluginsList(PluginBase.BGSOURCE), PluginBase.BGSOURCE);
|
||||||
bgsourceListView.setAdapter(bgsourceDataAdapter);
|
bgsourceListView.setAdapter(bgsourceDataAdapter);
|
||||||
setListViewHeightBasedOnChildren(bgsourceListView);
|
setListViewHeightBasedOnChildren(bgsourceListView);
|
||||||
|
@ -154,6 +159,7 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
loopDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainActivity.getSpecificPluginsList(PluginBase.LOOP), PluginBase.LOOP);
|
loopDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainActivity.getSpecificPluginsList(PluginBase.LOOP), PluginBase.LOOP);
|
||||||
loopListView.setAdapter(loopDataAdapter);
|
loopListView.setAdapter(loopDataAdapter);
|
||||||
setListViewHeightBasedOnChildren(loopListView);
|
setListViewHeightBasedOnChildren(loopListView);
|
||||||
|
if (MainActivity.getSpecificPluginsList(PluginBase.LOOP).size() == 0) loopLabel.setVisibility(View.GONE);
|
||||||
treatmentsDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainActivity.getSpecificPluginsList(PluginBase.TREATMENT), PluginBase.TREATMENT);
|
treatmentsDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainActivity.getSpecificPluginsList(PluginBase.TREATMENT), PluginBase.TREATMENT);
|
||||||
treatmentsListView.setAdapter(treatmentsDataAdapter);
|
treatmentsListView.setAdapter(treatmentsDataAdapter);
|
||||||
setListViewHeightBasedOnChildren(treatmentsListView);
|
setListViewHeightBasedOnChildren(treatmentsListView);
|
||||||
|
@ -166,6 +172,7 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
apsDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainActivity.getSpecificPluginsList(PluginBase.APS), PluginBase.APS);
|
apsDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainActivity.getSpecificPluginsList(PluginBase.APS), PluginBase.APS);
|
||||||
apsListView.setAdapter(apsDataAdapter);
|
apsListView.setAdapter(apsDataAdapter);
|
||||||
setListViewHeightBasedOnChildren(apsListView);
|
setListViewHeightBasedOnChildren(apsListView);
|
||||||
|
if (MainActivity.getSpecificPluginsList(PluginBase.APS).size() == 0) apsLabel.setVisibility(View.GONE);
|
||||||
constraintsDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainActivity.getSpecificPluginsListByInterface(ConstraintsInterface.class), PluginBase.CONSTRAINTS);
|
constraintsDataAdapter = new PluginCustomAdapter(getContext(), R.layout.configbuilder_simpleitem, MainActivity.getSpecificPluginsListByInterface(ConstraintsInterface.class), PluginBase.CONSTRAINTS);
|
||||||
constraintsListView.setAdapter(constraintsDataAdapter);
|
constraintsListView.setAdapter(constraintsDataAdapter);
|
||||||
setListViewHeightBasedOnChildren(constraintsListView);
|
setListViewHeightBasedOnChildren(constraintsListView);
|
||||||
|
@ -670,7 +677,7 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
for (int type = 1; type < PluginBase.LAST; type++) {
|
for (int type = 1; type < PluginBase.LAST; type++) {
|
||||||
for (PluginBase p : pluginList) {
|
for (PluginBase p : pluginList) {
|
||||||
String settingEnabled = "ConfigBuilder_" + type + "_" + p.getName() + "_Enabled";
|
String settingEnabled = "ConfigBuilder_" + type + "_" + p.getName() + "_Enabled";
|
||||||
String settingVisible = "ConfigBuilder_" + p.getName() + "_Visible";
|
String settingVisible = "ConfigBuilder_" + type + "_" + p.getName() + "_Visible";
|
||||||
editor.putBoolean(settingEnabled, p.isEnabled(type));
|
editor.putBoolean(settingEnabled, p.isEnabled(type));
|
||||||
editor.putBoolean(settingVisible, p.isVisibleInTabs(type));
|
editor.putBoolean(settingVisible, p.isVisibleInTabs(type));
|
||||||
}
|
}
|
||||||
|
@ -687,7 +694,7 @@ public class ConfigBuilderFragment extends Fragment implements PluginBase, PumpI
|
||||||
for (int type = 1; type < PluginBase.LAST; type++) {
|
for (int type = 1; type < PluginBase.LAST; type++) {
|
||||||
for (PluginBase p : pluginList) {
|
for (PluginBase p : pluginList) {
|
||||||
String settingEnabled = "ConfigBuilder_" + type + "_" + p.getName() + "_Enabled";
|
String settingEnabled = "ConfigBuilder_" + type + "_" + p.getName() + "_Enabled";
|
||||||
String settingVisible = "ConfigBuilder_" + p.getName() + "_Visible";
|
String settingVisible = "ConfigBuilder_" + type + "_" + p.getName() + "_Visible";
|
||||||
if (SP.contains(settingEnabled))
|
if (SP.contains(settingEnabled))
|
||||||
p.setFragmentEnabled(type, SP.getBoolean(settingEnabled, true));
|
p.setFragmentEnabled(type, SP.getBoolean(settingEnabled, true));
|
||||||
if (SP.contains("ConfigBuilder" + p.getName() + "Visible"))
|
if (SP.contains("ConfigBuilder" + p.getName() + "Visible"))
|
||||||
|
|
|
@ -178,7 +178,7 @@ public class DanaConnection {
|
||||||
|
|
||||||
if (timeToConnectTimeSoFar / 60 > 15 || connectionAttemptCount > 180) {
|
if (timeToConnectTimeSoFar / 60 > 15 || connectionAttemptCount > 180) {
|
||||||
Intent alarmServiceIntent = new Intent(MainApp.instance().getApplicationContext(), AlertService.class);
|
Intent alarmServiceIntent = new Intent(MainApp.instance().getApplicationContext(), AlertService.class);
|
||||||
alarmServiceIntent.putExtra("alarmText", MainApp.sResources.getString(R.string.connectionerror)); //TODO: hardcoded string
|
alarmServiceIntent.putExtra("alarmText", MainApp.sResources.getString(R.string.connectionerror));
|
||||||
MainApp.instance().getApplicationContext().startService(alarmServiceIntent);
|
MainApp.instance().getApplicationContext().startService(alarmServiceIntent);
|
||||||
}
|
}
|
||||||
waitMsec(1000);
|
waitMsec(1000);
|
||||||
|
|
|
@ -3,6 +3,8 @@ package info.nightscout.androidaps.plugins.Loop;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Parcel;
|
import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.Spanned;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
@ -11,6 +13,7 @@ import java.text.DecimalFormat;
|
||||||
|
|
||||||
import info.nightscout.androidaps.MainApp;
|
import info.nightscout.androidaps.MainApp;
|
||||||
import info.nightscout.androidaps.R;
|
import info.nightscout.androidaps.R;
|
||||||
|
import info.nightscout.utils.DecimalFormatter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by mike on 09.06.2016.
|
* Created by mike on 09.06.2016.
|
||||||
|
@ -23,17 +26,21 @@ public class APSResult implements Parcelable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
Context context = MainApp.instance().getApplicationContext();
|
|
||||||
|
|
||||||
DecimalFormat formatNumber0decimalplaces = new DecimalFormat("0");
|
|
||||||
DecimalFormat formatNumber2decimalplaces = new DecimalFormat("0.00");
|
|
||||||
|
|
||||||
if (changeRequested)
|
if (changeRequested)
|
||||||
return context.getString(R.string.rate) + " " + formatNumber2decimalplaces.format(rate) + " U/h\n" +
|
return MainApp.sResources.getString(R.string.rate) + " " + DecimalFormatter.to2Decimal(rate) + " U/h\n" +
|
||||||
context.getString(R.string.duration) + " " + formatNumber0decimalplaces.format(duration) + " min\n" +
|
MainApp.sResources.getString(R.string.duration) + " " + DecimalFormatter.to0Decimal(duration) + " min\n" +
|
||||||
context.getString(R.string.reason) + " " + reason;
|
MainApp.sResources.getString(R.string.reason) + " " + reason;
|
||||||
else
|
else
|
||||||
return MainApp.instance().getApplicationContext().getString(R.string.nochangerequested);
|
return MainApp.sResources.getString(R.string.nochangerequested);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Spanned toSpanned() {
|
||||||
|
if (changeRequested)
|
||||||
|
return Html.fromHtml("<b>" + MainApp.sResources.getString(R.string.rate) + "</b>: " + DecimalFormatter.to2Decimal(rate) + " U/h<br>" +
|
||||||
|
"<b>" + MainApp.sResources.getString(R.string.duration) + "</b>: " + DecimalFormatter.to2Decimal(duration) + " min<br>" +
|
||||||
|
"<b>" + MainApp.sResources.getString(R.string.reason) + "</b>: " + reason);
|
||||||
|
else
|
||||||
|
return Html.fromHtml(MainApp.sResources.getString(R.string.nochangerequested));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -329,9 +329,9 @@ public class LoopFragment extends Fragment implements View.OnClickListener, Plug
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (lastRun != null) {
|
if (lastRun != null) {
|
||||||
requestView.setText(lastRun.request != null ? lastRun.request.toString() : "");
|
requestView.setText(lastRun.request != null ? lastRun.request.toSpanned() : "");
|
||||||
constraintsProcessedView.setText(lastRun.constraintsProcessed != null ? lastRun.constraintsProcessed.toString() : "");
|
constraintsProcessedView.setText(lastRun.constraintsProcessed != null ? lastRun.constraintsProcessed.toSpanned() : "");
|
||||||
setByPumpView.setText(lastRun.setByPump != null ? lastRun.setByPump.toString() : "");
|
setByPumpView.setText(lastRun.setByPump != null ? lastRun.setByPump.toSpanned() : "");
|
||||||
sourceView.setText(lastRun.source != null ? lastRun.source : "");
|
sourceView.setText(lastRun.source != null ? lastRun.source : "");
|
||||||
lastRunView.setText(lastRun.lastAPSRun != null && lastRun.lastAPSRun.getTime() != 0 ? lastRun.lastAPSRun.toLocaleString() : "");
|
lastRunView.setText(lastRun.lastAPSRun != null && lastRun.lastAPSRun.getTime() != 0 ? lastRun.lastAPSRun.toLocaleString() : "");
|
||||||
lastEnactView.setText(lastRun.lastEnact != null && lastRun.lastEnact.getTime() != 0 ? lastRun.lastEnact.toLocaleString() : "");
|
lastEnactView.setText(lastRun.lastEnact != null && lastRun.lastEnact.getTime() != 0 ? lastRun.lastEnact.toLocaleString() : "");
|
||||||
|
|
|
@ -7,6 +7,7 @@ import android.os.Parcel;
|
||||||
import android.os.Parcelable;
|
import android.os.Parcelable;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.text.Html;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
@ -29,6 +30,7 @@ import info.nightscout.androidaps.interfaces.APSInterface;
|
||||||
import info.nightscout.androidaps.plugins.Loop.APSResult;
|
import info.nightscout.androidaps.plugins.Loop.APSResult;
|
||||||
import info.nightscout.androidaps.interfaces.PluginBase;
|
import info.nightscout.androidaps.interfaces.PluginBase;
|
||||||
import info.nightscout.client.data.NSProfile;
|
import info.nightscout.client.data.NSProfile;
|
||||||
|
import info.nightscout.utils.DecimalFormatter;
|
||||||
import info.nightscout.utils.SafeParse;
|
import info.nightscout.utils.SafeParse;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -57,7 +59,6 @@ public class LowSuspendFragment extends Fragment implements View.OnClickListener
|
||||||
public Boolean lastLow = null;
|
public Boolean lastLow = null;
|
||||||
public Boolean lastLowProjected = null;
|
public Boolean lastLowProjected = null;
|
||||||
public Double lastMinBg = null;
|
public Double lastMinBg = null;
|
||||||
public String lastUnits = null;
|
|
||||||
public DatabaseHelper.GlucoseStatus lastGlucoseStatus = null;
|
public DatabaseHelper.GlucoseStatus lastGlucoseStatus = null;
|
||||||
public Date lastAPSRun = null;
|
public Date lastAPSRun = null;
|
||||||
public APSResult lastAPSResult = null;
|
public APSResult lastAPSResult = null;
|
||||||
|
@ -72,7 +73,6 @@ public class LowSuspendFragment extends Fragment implements View.OnClickListener
|
||||||
dest.writeInt(lastLow ? 1 : 0);
|
dest.writeInt(lastLow ? 1 : 0);
|
||||||
dest.writeInt(lastLowProjected ? 1 : 0);
|
dest.writeInt(lastLowProjected ? 1 : 0);
|
||||||
dest.writeDouble(lastMinBg);
|
dest.writeDouble(lastMinBg);
|
||||||
dest.writeString(lastUnits);
|
|
||||||
dest.writeParcelable(lastGlucoseStatus, 0);
|
dest.writeParcelable(lastGlucoseStatus, 0);
|
||||||
dest.writeLong(lastAPSRun.getTime());
|
dest.writeLong(lastAPSRun.getTime());
|
||||||
dest.writeParcelable(lastAPSResult, 0);
|
dest.writeParcelable(lastAPSResult, 0);
|
||||||
|
@ -92,7 +92,6 @@ public class LowSuspendFragment extends Fragment implements View.OnClickListener
|
||||||
lastLow = in.readInt() == 1;
|
lastLow = in.readInt() == 1;
|
||||||
lastLowProjected = in.readInt() == 1;
|
lastLowProjected = in.readInt() == 1;
|
||||||
lastMinBg = in.readDouble();
|
lastMinBg = in.readDouble();
|
||||||
lastUnits = in.readString();
|
|
||||||
lastGlucoseStatus = in.readParcelable(DatabaseHelper.GlucoseStatus.class.getClassLoader());
|
lastGlucoseStatus = in.readParcelable(DatabaseHelper.GlucoseStatus.class.getClassLoader());
|
||||||
lastAPSRun = new Date(in.readLong());
|
lastAPSRun = new Date(in.readLong());
|
||||||
lastAPSResult = in.readParcelable(APSResult.class.getClassLoader());
|
lastAPSResult = in.readParcelable(APSResult.class.getClassLoader());
|
||||||
|
@ -251,10 +250,10 @@ public class LowSuspendFragment extends Fragment implements View.OnClickListener
|
||||||
minBgDefault = "5";
|
minBgDefault = "5";
|
||||||
}
|
}
|
||||||
|
|
||||||
double minBg = NSProfile.toMgdl(SafeParse.stringToDouble(SP.getString("lowsuspend_lowthreshold", minBgDefault)), profile.getUnits());
|
double minBgMgdl = NSProfile.toMgdl(SafeParse.stringToDouble(SP.getString("lowsuspend_lowthreshold", minBgDefault)), profile.getUnits());
|
||||||
|
|
||||||
boolean lowProjected = (glucoseStatus.glucose + 6.0 * glucoseStatus.avgdelta) < minBg;
|
boolean lowProjected = (glucoseStatus.glucose + 6.0 * glucoseStatus.avgdelta) < minBgMgdl;
|
||||||
boolean low = glucoseStatus.glucose < minBg;
|
boolean low = glucoseStatus.glucose < minBgMgdl;
|
||||||
|
|
||||||
APSResult request = new APSResult();
|
APSResult request = new APSResult();
|
||||||
Double baseBasalRate = pump.getBaseBasalRate();
|
Double baseBasalRate = pump.getBaseBasalRate();
|
||||||
|
@ -293,11 +292,10 @@ public class LowSuspendFragment extends Fragment implements View.OnClickListener
|
||||||
}
|
}
|
||||||
|
|
||||||
lastRun = new LastRun();
|
lastRun = new LastRun();
|
||||||
lastRun.lastMinBg = minBg;
|
lastRun.lastMinBg = minBgMgdl;
|
||||||
lastRun.lastLow = low;
|
lastRun.lastLow = low;
|
||||||
lastRun.lastLowProjected = lowProjected;
|
lastRun.lastLowProjected = lowProjected;
|
||||||
lastRun.lastGlucoseStatus = glucoseStatus;
|
lastRun.lastGlucoseStatus = glucoseStatus;
|
||||||
lastRun.lastUnits = profile.getUnits();
|
|
||||||
lastRun.lastAPSResult = request;
|
lastRun.lastAPSResult = request;
|
||||||
lastRun.lastAPSRun = now;
|
lastRun.lastAPSRun = now;
|
||||||
updateGUI();
|
updateGUI();
|
||||||
|
@ -310,11 +308,10 @@ public class LowSuspendFragment extends Fragment implements View.OnClickListener
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (lastRun != null) {
|
if (lastRun != null) {
|
||||||
DecimalFormat formatNumber1decimalplaces = new DecimalFormat("0.0");
|
glucoseStatusView.setText(lastRun.lastGlucoseStatus.toSpanned());
|
||||||
glucoseStatusView.setText(lastRun.lastGlucoseStatus.toString());
|
minBgView.setText(DecimalFormatter.to1Decimal(lastRun.lastMinBg) + " mgdl");
|
||||||
minBgView.setText(formatNumber1decimalplaces.format(lastRun.lastMinBg) + " " + lastRun.lastUnits);
|
resultView.setText(Html.fromHtml("<b>" + getString(R.string.lowsuspend_low) + "</b>: " + lastRun.lastLow + "<br><b>" + getString(R.string.lowsuspend_lowprojected) + "</b>: " + lastRun.lastLowProjected));
|
||||||
resultView.setText(getString(R.string.lowsuspend_low) + " " + lastRun.lastLow + "\n" + getString(R.string.lowsuspend_lowprojected) + " " + lastRun.lastLowProjected);
|
requestView.setText(lastRun.lastAPSResult.toSpanned());
|
||||||
requestView.setText(lastRun.lastAPSResult.toString());
|
|
||||||
lastRunView.setText(lastRun.lastAPSRun.toLocaleString());
|
lastRunView.setText(lastRun.lastAPSRun.toLocaleString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import android.widget.Button;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
@ -35,6 +36,7 @@ import info.nightscout.androidaps.plugins.Loop.ScriptReader;
|
||||||
import info.nightscout.androidaps.plugins.Treatments.TreatmentsFragment;
|
import info.nightscout.androidaps.plugins.Treatments.TreatmentsFragment;
|
||||||
import info.nightscout.client.data.NSProfile;
|
import info.nightscout.client.data.NSProfile;
|
||||||
import info.nightscout.utils.DateUtil;
|
import info.nightscout.utils.DateUtil;
|
||||||
|
import info.nightscout.utils.JSONFormatter;
|
||||||
import info.nightscout.utils.Round;
|
import info.nightscout.utils.Round;
|
||||||
import info.nightscout.utils.SafeParse;
|
import info.nightscout.utils.SafeParse;
|
||||||
|
|
||||||
|
@ -304,13 +306,13 @@ public class OpenAPSMAFragment extends Fragment implements View.OnClickListener,
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (lastRun != null) {
|
if (lastRun != null) {
|
||||||
glucoseStatusView.setText(lastRun.lastDetermineBasalAdapterJS.getGlucoseStatusParam());
|
glucoseStatusView.setText(JSONFormatter.format(lastRun.lastDetermineBasalAdapterJS.getGlucoseStatusParam()));
|
||||||
currentTempView.setText(lastRun.lastDetermineBasalAdapterJS.getCurrentTempParam());
|
currentTempView.setText(JSONFormatter.format(lastRun.lastDetermineBasalAdapterJS.getCurrentTempParam()));
|
||||||
iobDataView.setText(lastRun.lastDetermineBasalAdapterJS.getIobDataParam());
|
iobDataView.setText(JSONFormatter.format(lastRun.lastDetermineBasalAdapterJS.getIobDataParam()));
|
||||||
profileView.setText(lastRun.lastDetermineBasalAdapterJS.getProfileParam());
|
profileView.setText(JSONFormatter.format(lastRun.lastDetermineBasalAdapterJS.getProfileParam()));
|
||||||
mealDataView.setText(lastRun.lastDetermineBasalAdapterJS.getMealDataParam());
|
mealDataView.setText(JSONFormatter.format(lastRun.lastDetermineBasalAdapterJS.getMealDataParam()));
|
||||||
resultView.setText(lastRun.lastAPSResult.json.toString());
|
resultView.setText(JSONFormatter.format(lastRun.lastAPSResult.json));
|
||||||
requestView.setText(lastRun.lastAPSResult.toString());
|
requestView.setText(lastRun.lastAPSResult.toSpanned());
|
||||||
lastRunView.setText(lastRun.lastAPSRun.toLocaleString());
|
lastRunView.setText(lastRun.lastAPSRun.toLocaleString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import android.graphics.DashPathEffect;
|
||||||
import android.graphics.Paint;
|
import android.graphics.Paint;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
|
import android.os.HandlerThread;
|
||||||
import android.support.v4.app.Fragment;
|
import android.support.v4.app.Fragment;
|
||||||
import android.support.v4.app.FragmentManager;
|
import android.support.v4.app.FragmentManager;
|
||||||
import android.support.v7.app.AlertDialog;
|
import android.support.v7.app.AlertDialog;
|
||||||
|
@ -88,11 +89,17 @@ public class OverviewFragment extends Fragment implements PluginBase {
|
||||||
Handler loopHandler = new Handler();
|
Handler loopHandler = new Handler();
|
||||||
Runnable refreshLoop = null;
|
Runnable refreshLoop = null;
|
||||||
|
|
||||||
|
Handler mHandler;
|
||||||
|
public static HandlerThread mHandlerThread;
|
||||||
|
|
||||||
public Double bgTargetLow = 80d;
|
public Double bgTargetLow = 80d;
|
||||||
public Double bgTargetHigh = 180d;
|
public Double bgTargetHigh = 180d;
|
||||||
|
|
||||||
public OverviewFragment() {
|
public OverviewFragment() {
|
||||||
super();
|
super();
|
||||||
|
mHandlerThread = new HandlerThread(OverviewFragment.class.getSimpleName());
|
||||||
|
mHandlerThread.start();
|
||||||
|
mHandler = new Handler(mHandlerThread.getLooper());
|
||||||
registerBus();
|
registerBus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,10 +210,15 @@ public class OverviewFragment extends Fragment implements PluginBase {
|
||||||
cancelTempButton.setOnClickListener(new View.OnClickListener() {
|
cancelTempButton.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
PumpInterface pump = MainApp.getConfigBuilder().getActivePump();
|
final PumpInterface pump = MainApp.getConfigBuilder().getActivePump();
|
||||||
if (pump.isTempBasalInProgress()) {
|
if (pump.isTempBasalInProgress()) {
|
||||||
pump.cancelTempBasal();
|
mHandler.post(new Runnable() {
|
||||||
MainApp.bus().post(new EventTempBasalChange());
|
@Override
|
||||||
|
public void run() {
|
||||||
|
pump.cancelTempBasal();
|
||||||
|
MainApp.bus().post(new EventTempBasalChange());
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -240,19 +252,24 @@ public class OverviewFragment extends Fragment implements PluginBase {
|
||||||
builder.setMessage(getContext().getString(R.string.setbasalquestion) + "\n" + finalLastRun.constraintsProcessed);
|
builder.setMessage(getContext().getString(R.string.setbasalquestion) + "\n" + finalLastRun.constraintsProcessed);
|
||||||
builder.setPositiveButton(getContext().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
builder.setPositiveButton(getContext().getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||||
public void onClick(DialogInterface dialog, int id) {
|
public void onClick(DialogInterface dialog, int id) {
|
||||||
PumpEnactResult applyResult = MainApp.getConfigBuilder().applyAPSRequest(finalLastRun.constraintsProcessed);
|
mHandler.post(new Runnable() {
|
||||||
if (applyResult.enacted) {
|
@Override
|
||||||
finalLastRun.setByPump = applyResult;
|
public void run() {
|
||||||
finalLastRun.lastEnact = new Date();
|
PumpEnactResult applyResult = MainApp.getConfigBuilder().applyAPSRequest(finalLastRun.constraintsProcessed);
|
||||||
finalLastRun.lastOpenModeAccept = new Date();
|
if (applyResult.enacted) {
|
||||||
MainApp.getConfigBuilder().uploadDeviceStatus();
|
finalLastRun.setByPump = applyResult;
|
||||||
ObjectivesFragment objectivesFragment = (ObjectivesFragment) MainActivity.getSpecificPlugin(ObjectivesFragment.class);
|
finalLastRun.lastEnact = new Date();
|
||||||
if (objectivesFragment != null) {
|
finalLastRun.lastOpenModeAccept = new Date();
|
||||||
objectivesFragment.manualEnacts++;
|
MainApp.getConfigBuilder().uploadDeviceStatus();
|
||||||
objectivesFragment.saveProgress();
|
ObjectivesFragment objectivesFragment = (ObjectivesFragment) MainActivity.getSpecificPlugin(ObjectivesFragment.class);
|
||||||
|
if (objectivesFragment != null) {
|
||||||
|
objectivesFragment.manualEnacts++;
|
||||||
|
objectivesFragment.saveProgress();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
updateGUI();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
updateGUI();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
builder.setNegativeButton(getContext().getString(R.string.cancel), null);
|
builder.setNegativeButton(getContext().getString(R.string.cancel), null);
|
||||||
|
|
|
@ -417,7 +417,7 @@ public class TempBasalsFragment extends Fragment implements PluginBase, TempBasa
|
||||||
public void run() {
|
public void run() {
|
||||||
recyclerView.swapAdapter(new RecyclerViewAdapter(getMergedList()), false);
|
recyclerView.swapAdapter(new RecyclerViewAdapter(getMergedList()), false);
|
||||||
if (lastCalculation != null) {
|
if (lastCalculation != null) {
|
||||||
String totalText = formatNumber2decimalplaces.format(lastCalculation.basaliob) + "U";
|
String totalText = formatNumber2decimalplaces.format(lastCalculation.basaliob) + " U";
|
||||||
tempBasalTotalView.setText(totalText);
|
tempBasalTotalView.setText(totalText);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.Button;
|
import android.widget.Button;
|
||||||
|
import android.widget.LinearLayout;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.j256.ormlite.dao.Dao;
|
import com.j256.ormlite.dao.Dao;
|
||||||
|
@ -215,6 +216,10 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
|
||||||
Iob iob = treatments.get(position).iobCalc(new Date(), profile.getDia());
|
Iob iob = treatments.get(position).iobCalc(new Date(), profile.getDia());
|
||||||
holder.iob.setText(formatNumber2decimalplaces.format(iob.iobContrib) + " U");
|
holder.iob.setText(formatNumber2decimalplaces.format(iob.iobContrib) + " U");
|
||||||
holder.activity.setText(formatNumber3decimalplaces.format(iob.activityContrib) + " U");
|
holder.activity.setText(formatNumber3decimalplaces.format(iob.activityContrib) + " U");
|
||||||
|
if (iob.iobContrib != 0)
|
||||||
|
holder.dateLinearLayout.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.colorAffectingIOB));
|
||||||
|
else
|
||||||
|
holder.dateLinearLayout.setBackgroundColor(MainApp.instance().getResources().getColor(R.color.cardColorBackground));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -234,6 +239,7 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
|
||||||
TextView carbs;
|
TextView carbs;
|
||||||
TextView iob;
|
TextView iob;
|
||||||
TextView activity;
|
TextView activity;
|
||||||
|
LinearLayout dateLinearLayout;
|
||||||
|
|
||||||
TreatmentsViewHolder(View itemView) {
|
TreatmentsViewHolder(View itemView) {
|
||||||
super(itemView);
|
super(itemView);
|
||||||
|
@ -243,6 +249,7 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
|
||||||
carbs = (TextView) itemView.findViewById(R.id.treatments_carbs);
|
carbs = (TextView) itemView.findViewById(R.id.treatments_carbs);
|
||||||
iob = (TextView) itemView.findViewById(R.id.treatments_iob);
|
iob = (TextView) itemView.findViewById(R.id.treatments_iob);
|
||||||
activity = (TextView) itemView.findViewById(R.id.treatments_activity);
|
activity = (TextView) itemView.findViewById(R.id.treatments_activity);
|
||||||
|
dateLinearLayout = (LinearLayout) itemView.findViewById(R.id.treatments_datelinearlayout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -333,9 +340,9 @@ public class TreatmentsFragment extends Fragment implements View.OnClickListener
|
||||||
public void run() {
|
public void run() {
|
||||||
recyclerView.swapAdapter(new RecyclerViewAdapter(treatments), false);
|
recyclerView.swapAdapter(new RecyclerViewAdapter(treatments), false);
|
||||||
if (lastCalculation != null)
|
if (lastCalculation != null)
|
||||||
iobTotal.setText(formatNumber2decimalplaces.format(lastCalculation.iob));
|
iobTotal.setText(formatNumber2decimalplaces.format(lastCalculation.iob) + " U");
|
||||||
if (lastCalculation != null)
|
if (lastCalculation != null)
|
||||||
activityTotal.setText(formatNumber3decimalplaces.format(lastCalculation.activity));
|
activityTotal.setText(formatNumber3decimalplaces.format(lastCalculation.activity) + " U");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
package info.nightscout.utils;
|
||||||
|
|
||||||
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mike on 11.07.2016.
|
||||||
|
*/
|
||||||
|
public class DecimalFormatter {
|
||||||
|
private static DecimalFormat format0dec = new DecimalFormat("0");
|
||||||
|
private static DecimalFormat format1dec = new DecimalFormat("0.0");
|
||||||
|
private static DecimalFormat format2dec = new DecimalFormat("0.00");
|
||||||
|
private static DecimalFormat format3dec = new DecimalFormat("0.000");
|
||||||
|
|
||||||
|
public static String to0Decimal(double value) {
|
||||||
|
return format0dec.format(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String to1Decimal(double value) {
|
||||||
|
return format1dec.format(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String to2Decimal(double value) {
|
||||||
|
return format2dec.format(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String to3Decimal(double value) {
|
||||||
|
return format3dec.format(value);
|
||||||
|
}
|
||||||
|
}
|
101
app/src/main/java/info/nightscout/utils/JsonFormatter.java
Normal file
101
app/src/main/java/info/nightscout/utils/JsonFormatter.java
Normal file
|
@ -0,0 +1,101 @@
|
||||||
|
package info.nightscout.utils;
|
||||||
|
|
||||||
|
import android.text.Html;
|
||||||
|
import android.text.Spanned;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by mike on 11.07.2016.
|
||||||
|
*/
|
||||||
|
public class JSONFormatter {
|
||||||
|
|
||||||
|
public static Spanned format(final String jsonString) {
|
||||||
|
final JsonVisitor visitor = new JsonVisitor(4, ' ');
|
||||||
|
try {
|
||||||
|
return Html.fromHtml(visitor.visit(new JSONObject(jsonString), 0));
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return Html.fromHtml("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Spanned format(final JSONObject object) {
|
||||||
|
final JsonVisitor visitor = new JsonVisitor(4, ' ');
|
||||||
|
try {
|
||||||
|
return Html.fromHtml(visitor.visit(object, 0));
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return Html.fromHtml("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class JsonVisitor {
|
||||||
|
private final int indentationSize;
|
||||||
|
private final char indentationChar;
|
||||||
|
|
||||||
|
public JsonVisitor(final int indentationSize, final char indentationChar) {
|
||||||
|
this.indentationSize = indentationSize;
|
||||||
|
this.indentationChar = indentationChar;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String visit(final JSONArray array, final int indent) throws JSONException {
|
||||||
|
String ret = "";
|
||||||
|
final int length = array.length();
|
||||||
|
if (length == 0) {
|
||||||
|
} else {
|
||||||
|
ret += write("[", indent);
|
||||||
|
for (int i = 0; i < length; i++) {
|
||||||
|
ret += visit(array.get(i), indent + 1);
|
||||||
|
}
|
||||||
|
ret += write("]", indent);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String visit(final JSONObject obj, final int indent) throws JSONException {
|
||||||
|
String ret = "";
|
||||||
|
final int length = obj.length();
|
||||||
|
if (length == 0) {
|
||||||
|
} else {
|
||||||
|
final Iterator<String> keys = obj.keys();
|
||||||
|
while (keys.hasNext()) {
|
||||||
|
final String key = keys.next();
|
||||||
|
ret += write("<b>" + key + "</b>: ", indent + 1);
|
||||||
|
ret += visit(obj.get(key), 0);
|
||||||
|
ret += "<br>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String visit(final Object object, final int indent) throws JSONException {
|
||||||
|
String ret = "";
|
||||||
|
if (object instanceof JSONArray) {
|
||||||
|
ret += visit((JSONArray) object, indent);
|
||||||
|
} else if (object instanceof JSONObject) {
|
||||||
|
ret += visit((JSONObject) object, indent);
|
||||||
|
} else {
|
||||||
|
if (object instanceof String) {
|
||||||
|
ret += write("\"" + (String) object + "\"", indent);
|
||||||
|
} else {
|
||||||
|
ret += write(String.valueOf(object), indent);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String write(final String data, final int indent) {
|
||||||
|
String ret = "";
|
||||||
|
for (int i = 0; i < (indent * indentationSize); i++) {
|
||||||
|
ret += indentationChar;
|
||||||
|
}
|
||||||
|
ret += data;
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -583,7 +583,6 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:width="100dp"
|
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
android:text="@string/careportal_newnstreatment_eventtime_label"
|
android:text="@string/careportal_newnstreatment_eventtime_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
|
|
@ -21,13 +21,13 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:text="@string/configbuilder_nsclientversion_label" />
|
android:text="@string/configbuilder_nsclientversion_label" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:id="@+id/configbuilder_nsclientversion"
|
android:id="@+id/configbuilder_nsclientversion"
|
||||||
android:layout_marginLeft="10dp" />
|
android:layout_marginLeft="10dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -41,13 +41,13 @@
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:text="@string/configbuilder_nightscoutversion_label" />
|
android:text="@string/configbuilder_nightscoutversion_label" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:id="@+id/configbuilder_nightscoutversion"
|
android:id="@+id/configbuilder_nightscoutversion"
|
||||||
android:layout_marginLeft="10dp" />
|
android:layout_marginLeft="10dp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -57,7 +57,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:text="@string/configbuilder_bgsource"
|
android:text="@string/configbuilder_bgsource"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
|
@ -74,7 +74,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:text="@string/configbuilder_pump"
|
android:text="@string/configbuilder_pump"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
|
@ -87,11 +87,12 @@
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/configbuilder_apslabel"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:text="@string/configbuilder_aps"
|
android:text="@string/configbuilder_aps"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
|
@ -104,11 +105,12 @@
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/configbuilder_looplabel"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:text="@string/configbuilder_loop"
|
android:text="@string/configbuilder_loop"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
|
@ -124,7 +126,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:text="@string/configbuilder_profile"
|
android:text="@string/configbuilder_profile"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
|
@ -140,7 +142,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:text="@string/configbuilder_treatments"
|
android:text="@string/configbuilder_treatments"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
|
@ -156,7 +158,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:text="@string/configbuilder_tempbasals"
|
android:text="@string/configbuilder_tempbasals"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
|
@ -173,7 +175,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:text="@string/configbuilder_constraints"
|
android:text="@string/configbuilder_constraints"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
|
@ -189,7 +191,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginLeft="5dp"
|
android:layout_marginLeft="5dp"
|
||||||
android:text="@string/configbuilder_general"
|
android:text="@string/configbuilder_general"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
|
|
|
@ -33,8 +33,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_lastrun_label"
|
android:text="@string/openapsma_lastrun_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/loop_lastrun"
|
android:id="@+id/loop_lastrun"
|
||||||
|
@ -47,8 +46,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_lastenact_label"
|
android:text="@string/openapsma_lastenact_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/loop_lastenact"
|
android:id="@+id/loop_lastenact"
|
||||||
|
@ -71,8 +69,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/loop_aps_label"
|
android:text="@string/loop_aps_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/loop_source"
|
android:id="@+id/loop_source"
|
||||||
|
@ -101,8 +98,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/loop_constraintsprocessed_label"
|
android:text="@string/loop_constraintsprocessed_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/loop_constraintsprocessed"
|
android:id="@+id/loop_constraintsprocessed"
|
||||||
|
@ -124,8 +120,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/loop_setbypump_label"
|
android:text="@string/loop_setbypump_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/loop_setbypump"
|
android:id="@+id/loop_setbypump"
|
||||||
|
|
|
@ -32,8 +32,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_lastrun_label"
|
android:text="@string/openapsma_lastrun_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/lowsuspend_lastrun"
|
android:id="@+id/lowsuspend_lastrun"
|
||||||
|
@ -54,15 +53,14 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_inputparameters_label"
|
android:text="@string/openapsma_inputparameters_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_glucosestatus_label"
|
android:text="@string/openapsma_glucosestatus_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_marginLeft="5dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/lowsuspend_glucosestatus"
|
android:id="@+id/lowsuspend_glucosestatus"
|
||||||
|
@ -76,7 +74,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_minbg_label"
|
android:text="@string/openapsma_minbg_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_marginLeft="5dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/lowsuspend_minbg"
|
android:id="@+id/lowsuspend_minbg"
|
||||||
|
@ -99,8 +97,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_result_label"
|
android:text="@string/openapsma_result_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/lowsuspend_result"
|
android:id="@+id/lowsuspend_result"
|
||||||
|
@ -122,8 +119,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_request_label"
|
android:text="@string/openapsma_request_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/lowsuspend_request"
|
android:id="@+id/lowsuspend_request"
|
||||||
|
|
|
@ -40,8 +40,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_lastrun_label"
|
android:text="@string/openapsma_lastrun_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/openapsma_lastrun"
|
android:id="@+id/openapsma_lastrun"
|
||||||
|
@ -62,15 +61,14 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_inputparameters_label"
|
android:text="@string/openapsma_inputparameters_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_glucosestatus_label"
|
android:text="@string/openapsma_glucosestatus_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_marginLeft="5dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/openapsma_glucosestatus"
|
android:id="@+id/openapsma_glucosestatus"
|
||||||
|
@ -84,7 +82,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_currenttemp_label"
|
android:text="@string/openapsma_currenttemp_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_marginLeft="5dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/openapsma_currenttemp"
|
android:id="@+id/openapsma_currenttemp"
|
||||||
|
@ -98,7 +96,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_iobdata_label"
|
android:text="@string/openapsma_iobdata_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_marginLeft="5dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/openapsma_iobdata"
|
android:id="@+id/openapsma_iobdata"
|
||||||
|
@ -112,7 +110,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_profile_label"
|
android:text="@string/openapsma_profile_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_marginLeft="5dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/openapsma_profile"
|
android:id="@+id/openapsma_profile"
|
||||||
|
@ -126,7 +124,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_mealdata_label"
|
android:text="@string/openapsma_mealdata_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_marginLeft="5dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/openapsma_mealdata"
|
android:id="@+id/openapsma_mealdata"
|
||||||
|
@ -148,8 +146,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_result_label"
|
android:text="@string/openapsma_result_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/openapsma_result"
|
android:id="@+id/openapsma_result"
|
||||||
|
@ -172,8 +169,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/openapsma_request_label"
|
android:text="@string/openapsma_request_label"
|
||||||
android:textAppearance="?android:attr/textAppearanceLarge"
|
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||||
android:layout_gravity="center_horizontal" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/openapsma_request"
|
android:id="@+id/openapsma_request"
|
||||||
|
|
|
@ -5,31 +5,31 @@
|
||||||
tools:context="info.nightscout.androidaps.plugins.TempBasals.TempBasalsFragment">
|
tools:context="info.nightscout.androidaps.plugins.TempBasals.TempBasalsFragment">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
|
||||||
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:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:paddingTop="10dp">
|
android:paddingTop="10dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tempbasals_iobtotal_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:text="@string/tempbasals_iobtotal_label_string"
|
|
||||||
android:id="@+id/tempbasals_iobtotal_label"
|
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
|
android:text="@string/tempbasals_iobtotal_label_string"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tempbasals_totaltempiob"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/tempbasals_totaltempiob"
|
android:paddingLeft="10dp"
|
||||||
android:paddingLeft="10dp" />
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -16,11 +16,22 @@
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/tempbasals_datelinearlayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:baselineAligned="true"
|
android:baselineAligned="true"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal">
|
||||||
android:id="@+id/tempbasals_datelinearlayout">
|
|
||||||
|
|
||||||
|
<com.joanzapata.iconify.widget.IconTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:gravity="center_vertical|right"
|
||||||
|
android:paddingLeft="5dp"
|
||||||
|
android:paddingRight="5dp"
|
||||||
|
android:text="{fa-clock-o}"
|
||||||
|
android:textColor="@color/cardItemLabel" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tempbasals_date"
|
android:id="@+id/tempbasals_date"
|
||||||
|
@ -29,7 +40,7 @@
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:text="1.1.2000 18:00"
|
android:text="1.1.2000 18:00"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textColor="@color/cardObjectiveText" />
|
android:textColor="@color/cardItemLabel" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tempbasals_absolute"
|
android:id="@+id/tempbasals_absolute"
|
||||||
|
@ -38,7 +49,7 @@
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:text="0.25 U"
|
android:text="0.25 U"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textColor="@color/cardObjectiveText" />
|
android:textColor="@color/cardItemLabel" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tempbasals_percent"
|
android:id="@+id/tempbasals_percent"
|
||||||
|
@ -47,7 +58,7 @@
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:text="150%"
|
android:text="150%"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textColor="@color/cardObjectiveText" />
|
android:textColor="@color/cardItemLabel" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tempbasals_duration"
|
android:id="@+id/tempbasals_duration"
|
||||||
|
@ -56,17 +67,17 @@
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:text="30 min"
|
android:text="30 min"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textColor="@color/cardObjectiveText" />
|
android:textColor="@color/cardItemLabel" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/tempbasals_extendedflag"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="E"
|
|
||||||
android:id="@+id/tempbasals_extendedflag"
|
|
||||||
android:textColor="@color/colorSetExtendedButton"
|
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:paddingRight="5dp" />
|
android:paddingRight="5dp"
|
||||||
|
android:text="E"
|
||||||
|
android:textColor="@color/colorSetExtendedButton" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -81,19 +92,20 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
android:paddingRight="5dp"
|
android:paddingRight="5dp"
|
||||||
android:text="@string/tempbasals_realduration_label_string"
|
android:text="@string/tempbasals_realduration_label_string"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:textStyle="bold"
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
android:paddingLeft="10dp" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tempbasals_realduration"
|
android:id="@+id/tempbasals_realduration"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingRight="10dp"
|
||||||
android:text="10 min"
|
android:text="10 min"
|
||||||
android:paddingRight="10dp" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tempbasals_netratio_label"
|
android:id="@+id/tempbasals_netratio_label"
|
||||||
|
@ -102,16 +114,16 @@
|
||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
android:paddingRight="5dp"
|
android:paddingRight="5dp"
|
||||||
android:text="@string/tempbasals_netratio_label_string"
|
android:text="@string/tempbasals_netratio_label_string"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tempbasals_netratio"
|
android:id="@+id/tempbasals_netratio"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingRight="10dp"
|
||||||
android:text="0.05 U/h"
|
android:text="0.05 U/h"
|
||||||
android:paddingRight="10dp" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tempbasals_netinsulin_label"
|
android:id="@+id/tempbasals_netinsulin_label"
|
||||||
|
@ -120,22 +132,23 @@
|
||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
android:paddingRight="5dp"
|
android:paddingRight="5dp"
|
||||||
android:text="@string/tempbasals_netinsulin_label_string"
|
android:text="@string/tempbasals_netinsulin_label_string"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tempbasals_netinsulin"
|
android:id="@+id/tempbasals_netinsulin"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
|
android:paddingRight="10dp"
|
||||||
android:text="0.05 U"
|
android:text="0.05 U"
|
||||||
android:paddingRight="10dp" />
|
android:textStyle="bold" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tempbasals_iob_label"
|
android:id="@+id/tempbasals_iob_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -144,8 +157,7 @@
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:paddingRight="10dp"
|
android:paddingRight="10dp"
|
||||||
android:text="@string/tempbasals_iob_label_string"
|
android:text="@string/tempbasals_iob_label_string"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tempbasals_iob"
|
android:id="@+id/tempbasals_iob"
|
||||||
|
@ -153,7 +165,8 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginRight="30dp"
|
||||||
android:text="0.12 U" />
|
android:text="0.12 U"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
|
@ -5,31 +5,31 @@
|
||||||
tools:context=".plugins.Treatments.TreatmentsFragment">
|
tools:context=".plugins.Treatments.TreatmentsFragment">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:orientation="vertical"
|
|
||||||
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:orientation="horizontal"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:paddingBottom="10dp"
|
android:paddingBottom="10dp"
|
||||||
android:paddingTop="10dp">
|
android:paddingTop="10dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/treatments_iobtotal_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:text="@string/treatments_iobtotal_label_string"
|
|
||||||
android:id="@+id/treatments_iobtotal_label"
|
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
|
android:text="@string/treatments_iobtotal_label_string"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
android:id="@+id/treatments_iobtotal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:id="@+id/treatments_iobtotal"
|
android:paddingLeft="10dp"
|
||||||
android:paddingLeft="10dp" />
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/treatments_iobactivitytotal_label"
|
android:id="@+id/treatments_iobactivitytotal_label"
|
||||||
|
@ -37,23 +37,24 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:text="@string/treatments_iobactivitytotal_label_string"
|
android:text="@string/treatments_iobactivitytotal_label_string"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/treatments_iobactivitytotal"
|
android:id="@+id/treatments_iobactivitytotal"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="10dp" />
|
android:paddingLeft="10dp"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@string/nav_refreshtreatments"
|
|
||||||
android:id="@+id/treatments_reshreshfromnightscout"
|
android:id="@+id/treatments_reshreshfromnightscout"
|
||||||
style="?android:attr/buttonStyle"
|
style="?android:attr/buttonStyle"
|
||||||
android:layout_gravity="center_horizontal" />
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
|
android:text="@string/nav_refreshtreatments" />
|
||||||
|
|
||||||
<android.support.v7.widget.RecyclerView
|
<android.support.v7.widget.RecyclerView
|
||||||
android:id="@+id/treatments_recyclerview"
|
android:id="@+id/treatments_recyclerview"
|
||||||
|
@ -61,6 +62,7 @@
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
</android.support.v7.widget.RecyclerView>
|
</android.support.v7.widget.RecyclerView>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
</FrameLayout>
|
</FrameLayout>
|
||||||
|
|
|
@ -16,19 +16,31 @@
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
android:id="@+id/treatments_datelinearlayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:baselineAligned="true"
|
android:baselineAligned="true"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<com.joanzapata.iconify.widget.IconTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:gravity="center_vertical|right"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:text="{fa-clock-o}"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
|
android:textColor="@color/cardItemLabel" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/treatments_date"
|
android:id="@+id/treatments_date"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="5dp"
|
||||||
android:text="1.1.2000 18:00"
|
android:text="1.1.2000 18:00"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:textColor="@color/cardObjectiveText" />
|
android:textColor="@color/cardItemLabel"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
@ -45,9 +57,7 @@
|
||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:paddingRight="10dp"
|
android:paddingRight="10dp"
|
||||||
android:text="@string/treatments_insulin_label_string"
|
android:text="@string/treatments_insulin_label_string" />
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/treatments_insulin"
|
android:id="@+id/treatments_insulin"
|
||||||
|
@ -55,7 +65,8 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginRight="30dp"
|
||||||
android:text="1.1 U" />
|
android:text="1.1 U"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/treatments_carbs_label"
|
android:id="@+id/treatments_carbs_label"
|
||||||
|
@ -64,9 +75,7 @@
|
||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:paddingRight="10dp"
|
android:paddingRight="10dp"
|
||||||
android:text="@string/treatments_carbs_label_string"
|
android:text="@string/treatments_carbs_label_string" />
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/treatments_carbs"
|
android:id="@+id/treatments_carbs"
|
||||||
|
@ -74,13 +83,15 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginRight="30dp"
|
||||||
android:text="48 g" />
|
android:text="48 g"
|
||||||
|
android:textStyle="bold" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/treatments_iob_label"
|
android:id="@+id/treatments_iob_label"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -88,9 +99,7 @@
|
||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:paddingRight="10dp"
|
android:paddingRight="10dp"
|
||||||
android:text="@string/treatments_iob_label_string"
|
android:text="@string/treatments_iob_label_string" />
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/treatments_iob"
|
android:id="@+id/treatments_iob"
|
||||||
|
@ -98,7 +107,8 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginRight="30dp"
|
||||||
android:text="0.12 U" />
|
android:text="0.12 U"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/treatments_activity_label"
|
android:id="@+id/treatments_activity_label"
|
||||||
|
@ -107,9 +117,7 @@
|
||||||
android:layout_gravity="top"
|
android:layout_gravity="top"
|
||||||
android:paddingLeft="10dp"
|
android:paddingLeft="10dp"
|
||||||
android:paddingRight="10dp"
|
android:paddingRight="10dp"
|
||||||
android:text="@string/treatments_activity_string"
|
android:text="@string/treatments_activity_string" />
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
|
||||||
android:textStyle="bold" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/treatments_activity"
|
android:id="@+id/treatments_activity"
|
||||||
|
@ -117,7 +125,8 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_marginRight="30dp"
|
android:layout_marginRight="30dp"
|
||||||
android:text="0.002 U" />
|
android:text="0.002 U"
|
||||||
|
android:textStyle="bold" />
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
<string name="cs_lang">Czech</string>
|
<string name="cs_lang">Czech</string>
|
||||||
<string name="days">дни</string>
|
<string name="days">дни</string>
|
||||||
<string name="delta">Изменение:</string>
|
<string name="delta">Изменение:</string>
|
||||||
<string name="duration">Продължителност:</string>
|
<string name="duration">Продължителност</string>
|
||||||
<string name="en_lang">English</string>
|
<string name="en_lang">English</string>
|
||||||
<string name="entertreatmentquestion">Въведи ново treatment:</string>
|
<string name="entertreatmentquestion">Въведи ново treatment:</string>
|
||||||
<string name="glucose">КЗ:</string>
|
<string name="glucose">КЗ:</string>
|
||||||
|
@ -76,7 +76,7 @@
|
||||||
<string name="lowsuspend">Low Suspend</string>
|
<string name="lowsuspend">Low Suspend</string>
|
||||||
<string name="lowsuspend_low_title">Граница за ниска КЗ</string>
|
<string name="lowsuspend_low_title">Граница за ниска КЗ</string>
|
||||||
<string name="manualenacts">Manual enacts</string>
|
<string name="manualenacts">Manual enacts</string>
|
||||||
<string name="lowsuspend_lowprojected">Low projected:</string>
|
<string name="lowsuspend_lowprojected">Low projected</string>
|
||||||
<string name="maxbasal_summary">Макс. ед./час на временен базал може да бъде до:</string>
|
<string name="maxbasal_summary">Макс. ед./час на временен базал може да бъде до:</string>
|
||||||
<string name="maxbasal_title">Макс. базал</string>
|
<string name="maxbasal_title">Макс. базал</string>
|
||||||
<string name="maxbasaliob_summary">Макс. стойност на не-болус IOB зададена от OpenAPS</string>
|
<string name="maxbasaliob_summary">Макс. стойност на не-болус IOB зададена от OpenAPS</string>
|
||||||
|
@ -131,8 +131,8 @@
|
||||||
<string name="overview_bolus_label">Болус</string>
|
<string name="overview_bolus_label">Болус</string>
|
||||||
<string name="profileviewer">NS профил</string>
|
<string name="profileviewer">NS профил</string>
|
||||||
<string name="pumpstatusavailableinns">Статус на помпа в NS</string>
|
<string name="pumpstatusavailableinns">Статус на помпа в NS</string>
|
||||||
<string name="rate">Стойност:</string>
|
<string name="rate">Стойност</string>
|
||||||
<string name="reason">Основание:</string>
|
<string name="reason">Основание</string>
|
||||||
<string name="refreshfromnightscout">Искате ли да обновите treatments от Nightscout</string>
|
<string name="refreshfromnightscout">Искате ли да обновите treatments от Nightscout</string>
|
||||||
<string name="safety">Безопасност</string>
|
<string name="safety">Безопасност</string>
|
||||||
<string name="safety_useextended_summary">Използвай удължен болус за високите стойности (над 200%)</string>
|
<string name="safety_useextended_summary">Използвай удължен болус за високите стойности (над 200%)</string>
|
||||||
|
@ -185,7 +185,7 @@
|
||||||
<string name="lowsuspend_lowprojectedmessage">Прогнозирана ниска КЗ: Временен базал0%</string>
|
<string name="lowsuspend_lowprojectedmessage">Прогнозирана ниска КЗ: Временен базал0%</string>
|
||||||
<string name="lowsuspend_lowmessage">Опасно ниска КЗ: Временен базал 0%</string>
|
<string name="lowsuspend_lowmessage">Опасно ниска КЗ: Временен базал 0%</string>
|
||||||
<string name="lowsuspend_cancelmessage">LowSuspend: Cancel low temp</string>
|
<string name="lowsuspend_cancelmessage">LowSuspend: Cancel low temp</string>
|
||||||
<string name="lowsuspend_low">Low Suspend:</string>
|
<string name="lowsuspend_low">Low Suspend</string>
|
||||||
<string name="careportal_newnstreatment_eventtype">Тип събитие</string>
|
<string name="careportal_newnstreatment_eventtype">Тип събитие</string>
|
||||||
<string name="careportal_newnstreatment_glucosetype">КЗ тип</string>
|
<string name="careportal_newnstreatment_glucosetype">КЗ тип</string>
|
||||||
<string name="title_activity_main">AndroidAPS</string>
|
<string name="title_activity_main">AndroidAPS</string>
|
||||||
|
|
|
@ -62,11 +62,11 @@
|
||||||
<string name="constraints_violation">Mimo povolený rozsah</string>
|
<string name="constraints_violation">Mimo povolený rozsah</string>
|
||||||
<string name="cs_lang">Čeština</string>
|
<string name="cs_lang">Čeština</string>
|
||||||
<string name="days">dnů</string>
|
<string name="days">dnů</string>
|
||||||
<string name="delta">Rozdíl:</string>
|
<string name="delta">Rozdíl</string>
|
||||||
<string name="duration">Trvání</string>
|
<string name="duration">Trvání</string>
|
||||||
<string name="en_lang">English</string>
|
<string name="en_lang">English</string>
|
||||||
<string name="entertreatmentquestion">Zadej nové ošetření</string>
|
<string name="entertreatmentquestion">Zadej nové ošetření</string>
|
||||||
<string name="glucose">Glykémie:</string>
|
<string name="glucose">Glykémie</string>
|
||||||
<string name="loop">Smyčka</string>
|
<string name="loop">Smyčka</string>
|
||||||
<string name="loop_aps_label">APS</string>
|
<string name="loop_aps_label">APS</string>
|
||||||
<string name="loop_constraintsprocessed_label">Po zpracování omezení</string>
|
<string name="loop_constraintsprocessed_label">Po zpracování omezení</string>
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
<string name="lowsuspend">Low Suspend</string>
|
<string name="lowsuspend">Low Suspend</string>
|
||||||
<string name="lowsuspend_low_title">Hodnota nízké glykémie</string>
|
<string name="lowsuspend_low_title">Hodnota nízké glykémie</string>
|
||||||
<string name="manualenacts">Ručně spuštěno</string>
|
<string name="manualenacts">Ručně spuštěno</string>
|
||||||
<string name="lowsuspend_lowprojected">Předpokládaná nízká glykémie:</string>
|
<string name="lowsuspend_lowprojected">Předpokládaná nízká glykémie</string>
|
||||||
<string name="minago">min zpět</string>
|
<string name="minago">min zpět</string>
|
||||||
<string name="minimalduration">Minimální trvání</string>
|
<string name="minimalduration">Minimální trvání</string>
|
||||||
<string name="nav_backup">Záloha</string>
|
<string name="nav_backup">Záloha</string>
|
||||||
|
@ -126,8 +126,8 @@
|
||||||
<string name="overview_bolus_label">Bolus</string>
|
<string name="overview_bolus_label">Bolus</string>
|
||||||
<string name="profileviewer">NS profil</string>
|
<string name="profileviewer">NS profil</string>
|
||||||
<string name="pumpstatusavailableinns">Stav pumpy dostupný v NS</string>
|
<string name="pumpstatusavailableinns">Stav pumpy dostupný v NS</string>
|
||||||
<string name="rate">Hodnota:</string>
|
<string name="rate">Hodnota</string>
|
||||||
<string name="reason">Zdůvodnění:</string>
|
<string name="reason">Zdůvodnění</string>
|
||||||
<string name="refreshfromnightscout">Opravdu aktualizovat ošetření z NS</string>
|
<string name="refreshfromnightscout">Opravdu aktualizovat ošetření z NS</string>
|
||||||
<string name="safety">Bezpečnost</string>
|
<string name="safety">Bezpečnost</string>
|
||||||
<string name="danar_useextended_title">Použít kombo bolusy pro >200%</string>
|
<string name="danar_useextended_title">Použít kombo bolusy pro >200%</string>
|
||||||
|
@ -178,7 +178,7 @@
|
||||||
<string name="lowsuspend_lowprojectedmessage">Předpokládaná nízká glykémie: Dočasný bazál 0%</string>
|
<string name="lowsuspend_lowprojectedmessage">Předpokládaná nízká glykémie: Dočasný bazál 0%</string>
|
||||||
<string name="lowsuspend_lowmessage">Nízká glykémie: Dočasný bazál 0%</string>
|
<string name="lowsuspend_lowmessage">Nízká glykémie: Dočasný bazál 0%</string>
|
||||||
<string name="lowsuspend_cancelmessage">Low Suspend: Zrušení dočasného bazálu</string>
|
<string name="lowsuspend_cancelmessage">Low Suspend: Zrušení dočasného bazálu</string>
|
||||||
<string name="lowsuspend_low">Low Suspend:</string>
|
<string name="lowsuspend_low">Low Suspend</string>
|
||||||
<string name="careportal_newnstreatment_eventtype">Typ události</string>
|
<string name="careportal_newnstreatment_eventtype">Typ události</string>
|
||||||
<string name="careportal_newnstreatment_glucosetype">Zadání glykémie</string>
|
<string name="careportal_newnstreatment_glucosetype">Zadání glykémie</string>
|
||||||
<string name="openapsma">OpenAPS MA</string>
|
<string name="openapsma">OpenAPS MA</string>
|
||||||
|
|
|
@ -56,11 +56,11 @@
|
||||||
<string name="configbuilder_nightscoutversion_label">Nightscout Version:</string>
|
<string name="configbuilder_nightscoutversion_label">Nightscout Version:</string>
|
||||||
<string name="configbuilder_nsclientversion_label">NSClient Version:</string>
|
<string name="configbuilder_nsclientversion_label">NSClient Version:</string>
|
||||||
<string name="configbuilder_tempbasals">Temp Basals</string>
|
<string name="configbuilder_tempbasals">Temp Basals</string>
|
||||||
<string name="delta">Delta:</string>
|
<string name="delta">Delta</string>
|
||||||
<string name="duration">Dauer:</string>
|
<string name="duration">Dauer</string>
|
||||||
<string name="en_lang">English</string>
|
<string name="en_lang">English</string>
|
||||||
<string name="loop_aps_label">APS</string>
|
<string name="loop_aps_label">APS</string>
|
||||||
<string name="glucose">Glukose:</string>
|
<string name="glucose">Glukose</string>
|
||||||
<string name="nav_backup">Backup</string>
|
<string name="nav_backup">Backup</string>
|
||||||
<string name="nav_preferences">Einstellungen</string>
|
<string name="nav_preferences">Einstellungen</string>
|
||||||
<string name="nsclient">NSClient</string>
|
<string name="nsclient">NSClient</string>
|
||||||
|
@ -81,8 +81,8 @@
|
||||||
<string name="overview_bolus_label">Bolus</string>
|
<string name="overview_bolus_label">Bolus</string>
|
||||||
<string name="overview_calculator_label">Rechner</string>
|
<string name="overview_calculator_label">Rechner</string>
|
||||||
<string name="overview_tempbasal_button">TempBasal</string>
|
<string name="overview_tempbasal_button">TempBasal</string>
|
||||||
<string name="rate">Rate:</string>
|
<string name="rate">Rate</string>
|
||||||
<string name="reason">Grund:</string>
|
<string name="reason">Grund</string>
|
||||||
<string name="safety">Sicherheit:</string>
|
<string name="safety">Sicherheit:</string>
|
||||||
<string name="send">SEND</string>
|
<string name="send">SEND</string>
|
||||||
<string name="treatments_activity_string">Aktivität:</string>
|
<string name="treatments_activity_string">Aktivität:</string>
|
||||||
|
@ -149,7 +149,7 @@
|
||||||
<string name="nochangerequested">No change requested</string>
|
<string name="nochangerequested">No change requested</string>
|
||||||
<string name="noapsselected">NO APS SELECTED OR PROVIDED RESULT</string>
|
<string name="noapsselected">NO APS SELECTED OR PROVIDED RESULT</string>
|
||||||
<string name="nav_test_alert">Test Alarm</string>
|
<string name="nav_test_alert">Test Alarm</string>
|
||||||
<string name="avgdelta">Avg. delta:</string>
|
<string name="avgdelta">Avg. delta</string>
|
||||||
<string name="bolusconstraintapplied">Bolus constraint applied</string>
|
<string name="bolusconstraintapplied">Bolus constraint applied</string>
|
||||||
<string name="careportal_announcement">Ankündigung</string>
|
<string name="careportal_announcement">Ankündigung</string>
|
||||||
<string name="careportal_bgcheck">BZ Check</string>
|
<string name="careportal_bgcheck">BZ Check</string>
|
||||||
|
@ -170,14 +170,14 @@
|
||||||
<string name="cs_lang">Czech</string>
|
<string name="cs_lang">Czech</string>
|
||||||
<string name="loop_setbypump_label">Gesetzt durch Pumpe</string>
|
<string name="loop_setbypump_label">Gesetzt durch Pumpe</string>
|
||||||
<string name="lowsuspend">Low Suspend</string>
|
<string name="lowsuspend">Low Suspend</string>
|
||||||
<string name="lowsuspend_low">Low Suspend:</string>
|
<string name="lowsuspend_low">Low Suspend</string>
|
||||||
<string name="lowsuspend_cancelmessage">LowSuspend: Cancel low temp</string>
|
<string name="lowsuspend_cancelmessage">LowSuspend: Cancel low temp</string>
|
||||||
<string name="loopdisabled">LOOP DISABLED BY CONSTRAINTS</string>
|
<string name="loopdisabled">LOOP DISABLED BY CONSTRAINTS</string>
|
||||||
<string name="loop_constraintsprocessed_label">After processed constraints</string>
|
<string name="loop_constraintsprocessed_label">After processed constraints</string>
|
||||||
<string name="loop">Loop</string>
|
<string name="loop">Loop</string>
|
||||||
<string name="lowsuspend_low_title">Low BG threshold</string>
|
<string name="lowsuspend_low_title">Low BG threshold</string>
|
||||||
<string name="lowsuspend_lowmessage">LOW: Temp basal 0%</string>
|
<string name="lowsuspend_lowmessage">LOW: Temp basal 0%</string>
|
||||||
<string name="lowsuspend_lowprojected">Low projected:</string>
|
<string name="lowsuspend_lowprojected">Low projected</string>
|
||||||
<string name="lowsuspend_lowprojectedmessage">LOW PROJECTED: Temp basal 0%</string>
|
<string name="lowsuspend_lowprojectedmessage">LOW PROJECTED: Temp basal 0%</string>
|
||||||
<string name="manualenacts">Manual enacts</string>
|
<string name="manualenacts">Manual enacts</string>
|
||||||
<string name="carbsconstraintapplied">Carbs constraint applied</string>
|
<string name="carbsconstraintapplied">Carbs constraint applied</string>
|
||||||
|
|
|
@ -21,5 +21,6 @@
|
||||||
<color name="colorNotEnded">#190084</color>
|
<color name="colorNotEnded">#190084</color>
|
||||||
|
|
||||||
<color name="colorPumpLabel">#FF478EFF</color>
|
<color name="colorPumpLabel">#FF478EFF</color>
|
||||||
|
<color name="cardItemLabel">#779ECB</color>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -71,14 +71,14 @@
|
||||||
<string name="lowsuspend_lowmessage">LOW: Temp basal 0%</string>
|
<string name="lowsuspend_lowmessage">LOW: Temp basal 0%</string>
|
||||||
<string name="lowsuspend_lowprojectedmessage">LOW PROJECTED: Temp basal 0%</string>
|
<string name="lowsuspend_lowprojectedmessage">LOW PROJECTED: Temp basal 0%</string>
|
||||||
<string name="lowsuspend_cancelmessage">LowSuspend: Cancel low temp</string>
|
<string name="lowsuspend_cancelmessage">LowSuspend: Cancel low temp</string>
|
||||||
<string name="lowsuspend_low">Low Suspend:</string>
|
<string name="lowsuspend_low">Low Suspend</string>
|
||||||
<string name="lowsuspend_lowprojected">Low projected:</string>
|
<string name="lowsuspend_lowprojected">Low projected</string>
|
||||||
<string name="rate">Rate:</string>
|
<string name="rate">Rate</string>
|
||||||
<string name="duration">Duration:</string>
|
<string name="duration">Duration</string>
|
||||||
<string name="reason">Reason:</string>
|
<string name="reason">Reason</string>
|
||||||
<string name="glucose">Glucose:</string>
|
<string name="glucose">Glucose</string>
|
||||||
<string name="delta">Delta:</string>
|
<string name="delta">Delta</string>
|
||||||
<string name="avgdelta">Avg. delta:</string>
|
<string name="avgdelta">Avg. delta</string>
|
||||||
<string name="minago">min ago</string>
|
<string name="minago">min ago</string>
|
||||||
|
|
||||||
<string name="configbuilder">Config Builder</string>
|
<string name="configbuilder">Config Builder</string>
|
||||||
|
@ -236,5 +236,11 @@
|
||||||
<string name="danar_valuenotsetproperly">Value not set properly</string>
|
<string name="danar_valuenotsetproperly">Value not set properly</string>
|
||||||
<string name="reloadprofile">Reload profile</string>
|
<string name="reloadprofile">Reload profile</string>
|
||||||
<string name="danar_viewprofile">View profile</string>
|
<string name="danar_viewprofile">View profile</string>
|
||||||
|
<string name="tempcancel">Temp cancel</string>
|
||||||
|
<string name="enacted">Enacted</string>
|
||||||
|
<string name="comment">Comment</string>
|
||||||
|
<string name="success">Success</string>
|
||||||
|
<string name="percent">Percent</string>
|
||||||
|
<string name="absolute">Absolute</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue