QuickWizard

This commit is contained in:
Milos Kozak 2016-10-20 23:50:31 +02:00
parent 6bfaec375f
commit 6f8d828ec2
26 changed files with 959 additions and 39 deletions

View file

@ -58,7 +58,6 @@ android {
dependencies { dependencies {
compile fileTree(dir: 'libs', include: ['*.jar']) compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile('com.crashlytics.sdk.android:crashlytics:2.5.7@aar') { compile('com.crashlytics.sdk.android:crashlytics:2.5.7@aar') {
transitive = true; transitive = true;
} }
@ -76,4 +75,5 @@ dependencies {
compile 'com.jjoe64:graphview:4.0.1' compile 'com.jjoe64:graphview:4.0.1'
compile 'com.eclipsesource.j2v8:j2v8:3.1.6@aar' compile 'com.eclipsesource.j2v8:j2v8:3.1.6@aar'
compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.1' compile 'com.joanzapata.iconify:android-iconify-fontawesome:2.1.1'
testCompile 'junit:junit:4.12'
} }

View file

@ -27,12 +27,18 @@
<activity android:name=".MainActivity"> <activity android:name=".MainActivity">
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name=".PreferencesActivity" /> <activity android:name=".PreferencesActivity" />
<activity android:name=".AgreementActivity" /> <activity android:name=".AgreementActivity" />
<activity android:name=".plugins.DanaR.History.DanaRHistoryActivity" />
<activity android:name=".plugins.Overview.activities.QuickWizardListActivity">
<intent-filter>
<action android:name="info.nightscout.androidaps.plugins.Overview.activities.QuickWizardListActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver <receiver
android:name=".receivers.DataReceiver" android:name=".receivers.DataReceiver"
@ -77,7 +83,6 @@
android:name="io.fabric.ApiKey" android:name="io.fabric.ApiKey"
android:value="59d462666c664c57b29e1d79ea123e01f8057cfa" /> android:value="59d462666c664c57b29e1d79ea123e01f8057cfa" />
<activity android:name=".plugins.DanaR.History.DanaRHistoryActivity"></activity>
</application> </application>
</manifest> </manifest>

View file

@ -77,6 +77,7 @@ public class PreferencesActivity extends PreferenceActivity implements SharedPre
@Override @Override
public void onCreate(final Bundle savedInstanceState) { public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.pref_quickwizard);
addPreferencesFromResource(R.xml.pref_language); addPreferencesFromResource(R.xml.pref_language);
if (Config.CAREPORTALENABLED) if (Config.CAREPORTALENABLED)
addPreferencesFromResource(R.xml.pref_careportal); addPreferencesFromResource(R.xml.pref_careportal);

View file

@ -71,10 +71,6 @@ public class DanaRFragment extends Fragment implements FragmentBase {
} }
} }
public static DanaRFragment newInstance() {
return new DanaRFragment();
}
@Override @Override
public void onCreate(Bundle savedInstanceState) { public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);

View file

@ -19,7 +19,7 @@ public class MsgBolusStart extends MessageBase {
// HARDCODED LIMIT // HARDCODED LIMIT
amount = MainApp.getConfigBuilder().applyBolusConstraints(amount); amount = MainApp.getConfigBuilder().applyBolusConstraints(amount);
if (amount < 0) amount = 0d; if (amount < 0) amount = 0d;
if (amount > 17) amount = 17d; if (amount > 17) amount = 17d; // TODO: add to constraints too
AddParamInt((int) (amount * 100)); AddParamInt((int) (amount * 100));
} }

View file

@ -384,8 +384,6 @@ public class DeviceStatus {
public JSONObject iob = null; public JSONObject iob = null;
public String created_at = null; public String created_at = null;
public JSONObject lowsuspend = null;
public JSONObject mongoRecord () { public JSONObject mongoRecord () {
JSONObject record = new JSONObject(); JSONObject record = new JSONObject();
@ -399,7 +397,6 @@ public class DeviceStatus {
if (iob != null) openaps.put("iob", iob); if (iob != null) openaps.put("iob", iob);
record.put("openaps", openaps); record.put("openaps", openaps);
} }
if (lowsuspend != null) record.put("lowsuspend" , lowsuspend);
if (created_at != null) record.put("created_at" , created_at); if (created_at != null) record.put("created_at" , created_at);
} catch (JSONException e) { } catch (JSONException e) {
e.printStackTrace(); e.printStackTrace();

View file

@ -132,6 +132,10 @@ public class ObjectivesPlugin implements PluginBase, ConstraintsInterface {
public void initializeData() { public void initializeData() {
bgIsAvailableInNS = false;
pumpStatusIsAvailableInNS = false;
manualEnacts = 0;
objectives = new ArrayList<>(); objectives = new ArrayList<>();
objectives.add(new Objective(0, objectives.add(new Objective(0,
MainApp.sResources.getString(R.string.objectives_0_objective), MainApp.sResources.getString(R.string.objectives_0_objective),

View file

@ -0,0 +1,118 @@
package info.nightscout.androidaps.plugins.Overview.Dialogs;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Spinner;
import org.json.JSONException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.Overview.OverviewPlugin;
import info.nightscout.androidaps.plugins.Overview.QuickWizard;
import info.nightscout.androidaps.plugins.Overview.events.EventQuickWizardChange;
import info.nightscout.utils.DateUtil;
import info.nightscout.utils.SafeParse;
public class EditQuickWizardDialog extends DialogFragment implements View.OnClickListener {
QuickWizard.QuickWizardEntry entry = new QuickWizard().newEmptyItem();
QuickWizard quickWizard = ((OverviewPlugin) MainApp.getSpecificPlugin(OverviewPlugin.class)).quickWizard;
EditText buttonEdit;
EditText carbsEdit;
Spinner fromSpinner;
Spinner toSpinner;
Button okButton;
public EditQuickWizardDialog() {
}
public void setData(QuickWizard.QuickWizardEntry data) {
entry = data;
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
View view = inflater.inflate(R.layout.overview_editquickwizard_dialog, container, false);
buttonEdit = (EditText) view.findViewById(R.id.overview_editquickwizard_button_edit);
carbsEdit = (EditText) view.findViewById(R.id.overview_editquickwizard_carbs_edit);
fromSpinner = (Spinner) view.findViewById(R.id.overview_editquickwizard_from_spinner);
toSpinner = (Spinner) view.findViewById(R.id.overview_editquickwizard_to_spinner);
okButton = (Button) view.findViewById(R.id.overview_editquickwizard_ok_button);
okButton.setOnClickListener(this);
int posFrom = 0;
int posTo = 95;
ArrayList<CharSequence> timeList = new ArrayList<>();
DateFormat df = new SimpleDateFormat("HH:mm");
int pos = 0;
for (int t = 0; t < 24 * 60 * 60; t += 15 * 60) {
timeList.add(df.format(DateUtil.toDate(t)));
if (entry.validFrom() == t) posFrom = pos;
if (entry.validTo() == t) posTo = pos;
pos++;
}
timeList.add(df.format(DateUtil.toDate(24 * 60 * 60 - 60)));
ArrayAdapter<CharSequence> adapter = new ArrayAdapter<CharSequence>(getContext(),
android.R.layout.simple_spinner_item, timeList);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
fromSpinner.setAdapter(adapter);
toSpinner.setAdapter(adapter);
buttonEdit.setText(entry.buttonText());
carbsEdit.setText(entry.carbs().toString());
fromSpinner.setSelection(posFrom);
toSpinner.setSelection(posTo);
return view;
}
@Override
public void onResume() {
super.onResume();
if (getDialog() != null)
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.overview_editquickwizard_ok_button:
if (fromSpinner.getSelectedItem() == null) return;
if (toSpinner.getSelectedItem() == null) return;
try {
entry.storage.put("buttonText", buttonEdit.getText().toString());
entry.storage.put("carbs", SafeParse.stringToInt(carbsEdit.getText().toString()));
int validFromInt = DateUtil.toSeconds(fromSpinner.getSelectedItem().toString());
entry.storage.put("validFrom", validFromInt);
int validToInt = DateUtil.toSeconds(toSpinner.getSelectedItem().toString());
entry.storage.put("validTo", validToInt);
} catch (JSONException e) {
e.printStackTrace();
}
quickWizard.addOrUpdate(entry);
dismiss();
MainApp.bus().post(new EventQuickWizardChange());
break;
}
}
}

View file

@ -27,9 +27,12 @@ import com.jjoe64.graphview.series.LineGraphSeries;
import com.jjoe64.graphview.series.PointsGraphSeries; import com.jjoe64.graphview.series.PointsGraphSeries;
import com.squareup.otto.Subscribe; import com.squareup.otto.Subscribe;
import org.json.JSONException;
import org.json.JSONObject;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.text.DecimalFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
@ -51,6 +54,7 @@ import info.nightscout.androidaps.events.EventRefreshGui;
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.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.interfaces.PumpInterface;
import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin;
import info.nightscout.androidaps.plugins.Loop.LoopPlugin; import info.nightscout.androidaps.plugins.Loop.LoopPlugin;
import info.nightscout.androidaps.plugins.Loop.events.EventNewOpenLoopNotification; import info.nightscout.androidaps.plugins.Loop.events.EventNewOpenLoopNotification;
import info.nightscout.androidaps.plugins.Objectives.ObjectivesPlugin; import info.nightscout.androidaps.plugins.Objectives.ObjectivesPlugin;
@ -61,8 +65,11 @@ import info.nightscout.androidaps.plugins.Overview.Dialogs.NewTreatmentDialog;
import info.nightscout.androidaps.plugins.Overview.Dialogs.WizardDialog; import info.nightscout.androidaps.plugins.Overview.Dialogs.WizardDialog;
import info.nightscout.androidaps.plugins.Overview.GraphSeriesExtension.PointsWithLabelGraphSeries; import info.nightscout.androidaps.plugins.Overview.GraphSeriesExtension.PointsWithLabelGraphSeries;
import info.nightscout.client.data.NSProfile; import info.nightscout.client.data.NSProfile;
import info.nightscout.utils.BolusWizard;
import info.nightscout.utils.DateUtil;
import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DecimalFormatter;
import info.nightscout.utils.Round; import info.nightscout.utils.Round;
import info.nightscout.utils.SafeParse;
public class OverviewFragment extends Fragment { public class OverviewFragment extends Fragment {
@ -85,12 +92,14 @@ public class OverviewFragment extends Fragment {
LinearLayout cancelTempLayout; LinearLayout cancelTempLayout;
LinearLayout setTempLayout; LinearLayout setTempLayout;
LinearLayout acceptTempLayout; LinearLayout acceptTempLayout;
LinearLayout quickWizardLayout;
Button cancelTempButton; Button cancelTempButton;
Button treatmentButton; Button treatmentButton;
Button wizardButton; Button wizardButton;
Button setTempButton; Button setTempButton;
Button setExtenedButton; Button setExtenedButton;
Button acceptTempButton; Button acceptTempButton;
Button quickWizardButton;
Handler sLoopHandler = new Handler(); Handler sLoopHandler = new Handler();
Runnable sRefreshLoop = null; Runnable sRefreshLoop = null;
@ -107,10 +116,6 @@ public class OverviewFragment extends Fragment {
} }
} }
public static OverviewFragment newInstance() {
return new OverviewFragment();
}
@Override @Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) { Bundle savedInstanceState) {
@ -132,6 +137,8 @@ public class OverviewFragment extends Fragment {
cancelTempLayout = (LinearLayout) view.findViewById(R.id.overview_canceltemplayout); cancelTempLayout = (LinearLayout) view.findViewById(R.id.overview_canceltemplayout);
acceptTempButton = (Button) view.findViewById(R.id.overview_accepttempbutton); acceptTempButton = (Button) view.findViewById(R.id.overview_accepttempbutton);
acceptTempLayout = (LinearLayout) view.findViewById(R.id.overview_accepttemplayout); acceptTempLayout = (LinearLayout) view.findViewById(R.id.overview_accepttemplayout);
quickWizardButton = (Button) view.findViewById(R.id.overview_quickwizard);
quickWizardLayout = (LinearLayout) view.findViewById(R.id.overview_quickwizardlayout);
treatmentButton.setOnClickListener(new View.OnClickListener() { treatmentButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
@ -151,6 +158,13 @@ public class OverviewFragment extends Fragment {
} }
}); });
quickWizardButton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
processQuickWizard();
}
});
cancelTempButton.setOnClickListener(new View.OnClickListener() { cancelTempButton.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
@ -228,6 +242,100 @@ public class OverviewFragment extends Fragment {
return view; return view;
} }
void processQuickWizard() {
final BgReading lastBG = MainApp.getDbHelper().lastBg();
if (MainApp.getConfigBuilder() == null || ConfigBuilderPlugin.getActiveProfile() == null) // app not initialized yet
return;
final NSProfile profile = ConfigBuilderPlugin.getActiveProfile().getProfile();
QuickWizard.QuickWizardEntry quickWizardEntry = getPlugin().quickWizard.getActive();
if (quickWizardEntry != null && lastBG != null) {
quickWizardLayout.setVisibility(View.VISIBLE);
String text = MainApp.sResources.getString(R.string.bolus) + ": " + quickWizardEntry.buttonText();
BolusWizard wizard = new BolusWizard();
wizard.doCalc(profile.getDefaultProfile(), quickWizardEntry.carbs(), lastBG.valueToUnits(profile.getUnits()), 0d, true, true);
final JSONObject boluscalcJSON = new JSONObject();
try {
boluscalcJSON.put("eventTime", DateUtil.toISOString(new Date()));
boluscalcJSON.put("targetBGLow", wizard.targetBGLow);
boluscalcJSON.put("targetBGHigh", wizard.targetBGHigh);
boluscalcJSON.put("isf", wizard.sens);
boluscalcJSON.put("ic", wizard.ic);
boluscalcJSON.put("iob", -(wizard.insulingFromBolusIOB + wizard.insulingFromBasalsIOB));
boluscalcJSON.put("bolusiobused", true);
boluscalcJSON.put("basaliobused", true);
boluscalcJSON.put("bg", lastBG.valueToUnits(profile.getUnits()));
boluscalcJSON.put("insulinbg", wizard.insulinFromBG);
boluscalcJSON.put("insulinbgused", true);
boluscalcJSON.put("bgdiff", wizard.bgDiff);
boluscalcJSON.put("insulincarbs", wizard.insulinFromCarbs);
boluscalcJSON.put("carbs", quickWizardEntry.carbs());
boluscalcJSON.put("othercorrection", 0d);
boluscalcJSON.put("insulin", wizard.calculatedTotalInsulin);
} catch (JSONException e) {
e.printStackTrace();
}
if (wizard.calculatedTotalInsulin > 0d && quickWizardEntry.carbs() > 0d) {
DecimalFormat formatNumber2decimalplaces = new DecimalFormat("0.00");
String confirmMessage = getString(R.string.entertreatmentquestion);
Double insulinAfterConstraints = MainApp.getConfigBuilder().applyBolusConstraints(wizard.calculatedTotalInsulin);
Integer carbsAfterConstraints = MainApp.getConfigBuilder().applyCarbsConstraints(quickWizardEntry.carbs());
confirmMessage += "\n" + getString(R.string.bolus) + ": " + formatNumber2decimalplaces.format(insulinAfterConstraints) + "U";
confirmMessage += "\n" + getString(R.string.carbs) + ": " + carbsAfterConstraints + "g";
if (insulinAfterConstraints - wizard.calculatedTotalInsulin != 0 || carbsAfterConstraints != quickWizardEntry.carbs()) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror));
builder.setMessage(getString(R.string.constraints_violation) + "\n" + getString(R.string.changeyourinput));
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
return;
}
final Double finalInsulinAfterConstraints = insulinAfterConstraints;
final Integer finalCarbsAfterConstraints = carbsAfterConstraints;
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle(MainApp.sResources.getString(R.string.confirmation));
builder.setMessage(confirmMessage);
builder.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
if (finalInsulinAfterConstraints > 0 || finalCarbsAfterConstraints > 0) {
final ConfigBuilderPlugin pump = MainApp.getConfigBuilder();
sHandler.post(new Runnable() {
@Override
public void run() {
PumpEnactResult result = pump.deliverTreatmentFromBolusWizard(
getContext(),
finalInsulinAfterConstraints,
finalCarbsAfterConstraints,
lastBG.valueToUnits(profile.getUnits()),
"Manual",
0,
boluscalcJSON
);
if (!result.success) {
AlertDialog.Builder builder = new AlertDialog.Builder(getContext());
builder.setTitle(MainApp.sResources.getString(R.string.treatmentdeliveryerror));
builder.setMessage(result.comment);
builder.setPositiveButton(MainApp.sResources.getString(R.string.ok), null);
builder.show();
}
}
});
}
}
});
builder.setNegativeButton(getString(R.string.cancel), null);
builder.show();
}
}
}
@Override @Override
public void onPause() { public void onPause() {
super.onPause(); super.onPause();
@ -369,6 +477,20 @@ public class OverviewFragment extends Fragment {
String units = profile.getUnits(); String units = profile.getUnits();
// QuickWizard button
QuickWizard.QuickWizardEntry quickWizardEntry = getPlugin().quickWizard.getActive();
if (quickWizardEntry != null && lastBG != null) {
quickWizardLayout.setVisibility(View.VISIBLE);
String text = MainApp.sResources.getString(R.string.bolus) + ": " + quickWizardEntry.buttonText() + " " + DecimalFormatter.to0Decimal(quickWizardEntry.carbs()) + "g";
BolusWizard wizard = new BolusWizard();
wizard.doCalc(profile.getDefaultProfile(), quickWizardEntry.carbs(), lastBG.valueToUnits(profile.getUnits()), 0d, true, true);
text += " " + DecimalFormatter.to2Decimal(wizard.calculatedTotalInsulin) + "U";
quickWizardButton.setText(text);
if (wizard.calculatedTotalInsulin <= 0)
quickWizardLayout.setVisibility(View.GONE);
} else
quickWizardLayout.setVisibility(View.GONE);
// **** BG value **** // **** BG value ****
if (lastBG != null && bgView != null) { if (lastBG != null && bgView != null) {
bgView.setText(lastBG.valueToUnitsToString(profile.getUnits())); bgView.setText(lastBG.valueToUnitsToString(profile.getUnits()));

View file

@ -1,5 +1,11 @@
package info.nightscout.androidaps.plugins.Overview; package info.nightscout.androidaps.plugins.Overview;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import org.json.JSONArray;
import org.json.JSONException;
import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginBase;
@ -12,6 +18,18 @@ public class OverviewPlugin implements PluginBase {
public static Double bgTargetLow = 80d; public static Double bgTargetLow = 80d;
public static Double bgTargetHigh = 180d; public static Double bgTargetHigh = 180d;
public QuickWizard quickWizard = new QuickWizard();
public OverviewPlugin() {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
String storedData = preferences.getString("QuickWizard", "[]");
try {
quickWizard.setData(new JSONArray(storedData));
} catch (JSONException e) {
e.printStackTrace();
}
}
@Override @Override
public String getFragmentClass() { public String getFragmentClass() {
return OverviewFragment.class.getName(); return OverviewFragment.class.getName();

View file

@ -0,0 +1,172 @@
package info.nightscout.androidaps.plugins.Overview;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import info.nightscout.androidaps.MainApp;
import info.nightscout.client.data.NSProfile;
import info.nightscout.utils.DateUtil;
/**
* Created by mike on 12.10.2016.
*/
public class QuickWizard {
public class QuickWizardEntry {
public JSONObject storage;
public int position;
/*
{
buttonText: "Meal",
carbs: 36,
validFrom: 8 * 60 * 60, // seconds from midnight
validTo: 9 * 60 * 60, // seconds from midnight
}
*/
public QuickWizardEntry() {
String emptyData = "{\"buttonText\":\"\",\"carbs\":0,\"validFrom\":0,\"validTo\":86340}";
try {
storage = new JSONObject(emptyData);
} catch (JSONException e) {
e.printStackTrace();
}
position = -1;
}
public QuickWizardEntry(JSONObject entry, int position) {
storage = entry;
this.position = position;
}
public Boolean isActive() {
return NSProfile.secondsFromMidnight() >= validFrom() && NSProfile.secondsFromMidnight() <= validTo();
}
public String buttonText() {
try {
return storage.getString("buttonText");
} catch (JSONException e) {
e.printStackTrace();
}
return "";
}
public Integer carbs() {
try {
return storage.getInt("carbs");
} catch (JSONException e) {
e.printStackTrace();
}
return 0;
}
public Date validFromDate() {
return DateUtil.toDate(validFrom());
}
public Date validToDate() {
return DateUtil.toDate(validTo());
}
public Integer validFrom() {
try {
return storage.getInt("validFrom");
} catch (JSONException e) {
e.printStackTrace();
}
return 0;
}
public Integer validTo() {
try {
return storage.getInt("validTo");
} catch (JSONException e) {
e.printStackTrace();
}
return 0;
}
}
JSONArray storage = new JSONArray();
public void setData(JSONArray newData) {
storage = newData;
}
public void save() {
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(MainApp.instance().getApplicationContext());
SharedPreferences.Editor editor = preferences.edit();
editor.putString("QuickWizard", storage.toString());
editor.apply();
}
public int size() {
return storage.length();
}
public QuickWizardEntry get(int position) {
try {
return new QuickWizardEntry((JSONObject) storage.get(position), position);
} catch (JSONException e) {
e.printStackTrace();
}
return null;
}
public Boolean isActive() {
for (int i = 0; i < storage.length(); i++) {
try {
if (new QuickWizardEntry((JSONObject) storage.get(i), i).isActive()) return true;
} catch (JSONException e) {
e.printStackTrace();
}
}
return false;
}
public QuickWizardEntry getActive() {
for (int i = 0; i < storage.length(); i++) {
QuickWizardEntry entry;
try {
entry = new QuickWizardEntry((JSONObject) storage.get(i), i);
} catch (JSONException e) {
continue;
}
if (entry.isActive()) return entry;
}
return null;
}
public QuickWizardEntry newEmptyItem() {
return new QuickWizardEntry();
}
public void addOrUpdate(QuickWizardEntry newItem) {
if (newItem.position == -1)
storage.put(newItem.storage);
else {
try {
storage.put(newItem.position, newItem.storage);
} catch (JSONException e) {
e.printStackTrace();
}
}
save();
}
public void remove(int position) {
storage.remove(position);
save();
}
}

View file

@ -0,0 +1,176 @@
package info.nightscout.androidaps.plugins.Overview.activities;
import android.app.Activity;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.CardView;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.squareup.otto.Subscribe;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import info.nightscout.androidaps.AgreementActivity;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
import info.nightscout.androidaps.plugins.Overview.Dialogs.EditQuickWizardDialog;
import info.nightscout.androidaps.plugins.Overview.OverviewPlugin;
import info.nightscout.androidaps.plugins.Overview.QuickWizard;
import info.nightscout.androidaps.plugins.Overview.events.EventQuickWizardChange;
import info.nightscout.androidaps.plugins.TempBasals.TempBasalsFragment;
import info.nightscout.utils.DecimalFormatter;
public class QuickWizardListActivity extends AppCompatActivity implements View.OnClickListener {
RecyclerView recyclerView;
LinearLayoutManager llm;
Button adButton;
public static class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.QuickWizardEntryViewHolder> {
QuickWizard qvData;
FragmentManager fragmentManager;
RecyclerViewAdapter(QuickWizard data, FragmentManager fragmentManager) {
this.qvData = data;
this.fragmentManager = fragmentManager;
}
@Override
public QuickWizardEntryViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {
View v = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.overview_quickwizardlist_item, viewGroup, false);
QuickWizardEntryViewHolder quickWizardEntryViewHolder = new QuickWizardEntryViewHolder(v, fragmentManager, qvData);
return quickWizardEntryViewHolder;
}
@Override
public void onBindViewHolder(QuickWizardEntryViewHolder holder, int position) {
DateFormat df = new SimpleDateFormat("HH:mm");
holder.from.setText(df.format(qvData.get(position).validFromDate()));
holder.to.setText(df.format(qvData.get(position).validToDate()));
holder.buttonText.setText(qvData.get(position).buttonText());
holder.carbs.setText(DecimalFormatter.to0Decimal(qvData.get(position).carbs()) + " g");
}
@Override
public int getItemCount() {
return qvData.size();
}
@Override
public void onAttachedToRecyclerView(RecyclerView recyclerView) {
super.onAttachedToRecyclerView(recyclerView);
}
public static class QuickWizardEntryViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
CardView cv;
TextView buttonText;
TextView carbs;
TextView from;
TextView to;
Button editButton;
Button removeButton;
FragmentManager fragmentManager;
QuickWizard qvData;
QuickWizardEntryViewHolder(View itemView, FragmentManager fragmentManager, QuickWizard qvData) {
super(itemView);
cv = (CardView) itemView.findViewById(R.id.overview_quickwizard_cardview);
buttonText = (TextView) itemView.findViewById(R.id.overview_quickwizard_item_buttonText);
carbs = (TextView) itemView.findViewById(R.id.overview_quickwizard_item_carbs);
from = (TextView) itemView.findViewById(R.id.overview_quickwizard_item_from);
to = (TextView) itemView.findViewById(R.id.overview_quickwizard_item_to);
editButton = (Button) itemView.findViewById(R.id.overview_quickwizard_item_edit_button);
removeButton = (Button) itemView.findViewById(R.id.overview_quickwizard_item_remove_button);
editButton.setOnClickListener(this);
removeButton.setOnClickListener(this);
this.fragmentManager = fragmentManager;
this.qvData = qvData;
}
@Override
public void onClick(View v) {
int position = getAdapterPosition();
switch (v.getId()) {
case R.id.overview_quickwizard_item_edit_button:
FragmentManager manager = fragmentManager;
EditQuickWizardDialog editQuickWizardDialog = new EditQuickWizardDialog();
editQuickWizardDialog.setData(qvData.get(position));
editQuickWizardDialog.show(manager, "EditQuickWizardDialog");
break;
case R.id.overview_quickwizard_item_remove_button:
qvData.remove(position);
MainApp.bus().post(new EventQuickWizardChange());
break;
}
}
}
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.overview_quickwizardlist_activity);
recyclerView = (RecyclerView) findViewById(R.id.overview_quickwizardactivity_recyclerview);
recyclerView.setHasFixedSize(true);
llm = new LinearLayoutManager(this);
recyclerView.setLayoutManager(llm);
RecyclerViewAdapter adapter = new RecyclerViewAdapter(((OverviewPlugin) MainApp.getSpecificPlugin(OverviewPlugin.class)).quickWizard, getSupportFragmentManager());
recyclerView.setAdapter(adapter);
adButton = (Button) findViewById(R.id.overview_quickwizardactivity_add_button);
adButton.setOnClickListener(this);
}
@Override
protected void onResume() {
super.onResume();
MainApp.bus().register(this);
}
@Override
protected void onPause() {
super.onPause();
MainApp.bus().unregister(this);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.overview_quickwizardactivity_add_button:
FragmentManager manager = getSupportFragmentManager();
EditQuickWizardDialog editQuickWizardDialog = new EditQuickWizardDialog();
editQuickWizardDialog.show(manager, "EditQuickWizardDialog");
break;
}
}
@Subscribe
public void onStatusEvent(final EventQuickWizardChange ev) {
updateGUI();
}
public void updateGUI() {
Activity activity = this;
if (activity != null && recyclerView != null) {
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
RecyclerViewAdapter adapter = new RecyclerViewAdapter(((OverviewPlugin) MainApp.getSpecificPlugin(OverviewPlugin.class)).quickWizard, getSupportFragmentManager());
recyclerView.swapAdapter(adapter, false);
}
});
}
}
}

View file

@ -0,0 +1,8 @@
package info.nightscout.androidaps.plugins.Overview.events;
/**
* Created by mike on 20.10.2016.
*/
public class EventQuickWizardChange {
}

View file

@ -29,7 +29,7 @@ public class NSProfile {
this.activeProfile = activeProfile; this.activeProfile = activeProfile;
} }
JSONObject getDefaultProfile() { public JSONObject getDefaultProfile() {
String defaultProfileName = null; String defaultProfileName = null;
JSONObject store; JSONObject store;
JSONObject profile = null; JSONObject profile = null;

View file

@ -2,8 +2,12 @@ package info.nightscout.utils;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone; import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/** /**
* The Class DateUtil. A simple wrapper around SimpleDateFormat to ease the handling of iso date string &lt;-&gt; date obj * The Class DateUtil. A simple wrapper around SimpleDateFormat to ease the handling of iso date string &lt;-&gt; date obj
@ -54,4 +58,27 @@ public class DateUtil {
public static String toISOString(long date) { public static String toISOString(long date) {
return toISOString(new Date(date), FORMAT_DATE_ISO, TimeZone.getTimeZone("UTC")); return toISOString(new Date(date), FORMAT_DATE_ISO, TimeZone.getTimeZone("UTC"));
} }
public static Date toDate(Integer seconds) {
Calendar calendar = new GregorianCalendar();
calendar.set(Calendar.HOUR_OF_DAY, seconds / 60 / 60);
String a = calendar.getTime().toString();
calendar.set(Calendar.MINUTE, (seconds / 60) % 60);
String b = calendar.getTime().toString();
calendar.set(Calendar.SECOND, 0);
String c = calendar.getTime().toString();
return calendar.getTime();
}
public static int toSeconds(String hh_colon_mm) {
Pattern p = Pattern.compile("(\\d+):(\\d+)");
Matcher m = p.matcher(hh_colon_mm);
int retval = 0;
if (m.find()) {
retval = SafeParse.stringToInt(m.group(1)) * 60 * 60 + SafeParse.stringToInt(m.group(2)) * 60;
}
return retval;
}
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1,74 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="info.nightscout.androidaps.plugins.Overview.Dialogs.EditQuickWizardDialog">
<!-- TODO: Update blank fragment layout -->
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="15dp">
<TextView
android:text="@string/overview_editquickwizard_buttontext"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@android:style/TextAppearance.Material.Medium" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text"
android:ems="10"
android:id="@+id/overview_editquickwizard_button_edit" />
<TextView
android:text="@string/overview_editquickwizard_carbs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@android:style/TextAppearance.Material.Medium" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="numberDecimal"
android:ems="10"
android:id="@+id/overview_editquickwizard_carbs_edit" />
<TextView
android:text="@string/overview_editquickwizard_valid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@android:style/TextAppearance.Material.Medium" />
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/overview_editquickwizard_from_spinner"
android:layout_weight="1" />
<Spinner
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/overview_editquickwizard_to_spinner"
android:layout_weight="1" />
</LinearLayout>
<Button
android:text="@string/ok"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/overview_editquickwizard_ok_button"
android:layout_weight="1" />
</LinearLayout>
</FrameLayout>

View file

@ -201,6 +201,28 @@
android:textColor="@color/colorWizardButton" /> android:textColor="@color/colorWizardButton" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/overview_quickwizardlayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/overview_quickwizard"
style="?android:attr/buttonStyle"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="3dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp"
android:layout_weight="0.5"
android:text="Quick wizard"
android:textColor="@color/colorCancelTempButton"
android:drawableLeft="@drawable/bread" />
</LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView> </ScrollView>

View file

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/overview_quickwizardlist_activity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="info.nightscout.androidaps.plugins.Overview.activities.QuickWizardListActivity">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:text="@string/quickwizard"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textAppearance="@android:style/TextAppearance.DeviceDefault.Large"
android:textAlignment="center"
android:paddingBottom="15dp" />
<Button
android:text="@string/overview_editquickwizardlistactivity_add"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/overview_quickwizardactivity_add_button" />
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/overview_quickwizardactivity_recyclerview" />
</LinearLayout>
</RelativeLayout>

View file

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/overview_quickwizard_cardview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
card_view:cardBackgroundColor="@color/cardColorBackground"
card_view:cardCornerRadius="6dp"
card_view:cardUseCompatPadding="true"
card_view:contentPadding="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
card_view:srcCompat="@drawable/bread"
android:scaleType="fitStart"
android:cropToPadding="false"
android:adjustViewBounds="false" />
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:baselineAligned="true"
android:orientation="horizontal">
<TextView
android:id="@+id/overview_quickwizard_item_buttonText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="Sample button text"
android:textAppearance="@android:style/TextAppearance.Material.Medium"
android:textStyle="normal|bold"
android:textColor="@color/cardObjectiveText" />
<TextView
android:id="@+id/overview_quickwizard_item_carbs"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="36g"
android:textAppearance="@android:style/TextAppearance.Material.Medium"
android:textColor="@color/cardObjectiveText"
android:textStyle="normal|bold" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top"
android:paddingLeft="10dp"
android:paddingRight="5dp"
android:text="@string/overview_editquickwizard_valid"
android:textAppearance="@android:style/TextAppearance.Material.Medium" />
<TextView
android:id="@+id/overview_quickwizard_item_from"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingRight="10dp"
android:text="07:45"
android:textAppearance="@android:style/TextAppearance.Material.Medium"
android:textStyle="normal|bold" />
<TextView
android:text="-"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/overview_quickwizard_item_to"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:paddingLeft="10dp"
android:text="11:45"
android:textAppearance="@android:style/TextAppearance.Material.Medium"
android:textStyle="normal|bold" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal">
<Button
android:id="@+id/overview_quickwizard_item_edit_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/overview_quickwizard_item_edit_button" />
<Button
android:id="@+id/overview_quickwizard_item_remove_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/overview_quickwizard_item_remove_button" />
</LinearLayout>
</LinearLayout>
</android.support.v7.widget.CardView>

View file

@ -72,10 +72,7 @@
<string name="loop_constraintsprocessed_label">След приложени ограничения</string> <string name="loop_constraintsprocessed_label">След приложени ограничения</string>
<string name="loop_setbypump_label">Зададено на помпата</string> <string name="loop_setbypump_label">Зададено на помпата</string>
<string name="loopdisabled">Loop отказан от ограниченията</string> <string name="loopdisabled">Loop отказан от ограниченията</string>
<string name="lowsuspend">Low Suspend</string>
<string name="lowsuspend_low_title">Граница за ниска КЗ</string>
<string name="objectives_manualenacts">Manual enacts</string> <string name="objectives_manualenacts">Manual enacts</string>
<string name="lowsuspend_lowprojected">Low projected</string>
<string name="objectives_minimalduration">Минимална продължителност</string> <string name="objectives_minimalduration">Минимална продължителност</string>
<string name="nav_backup">Архивиране</string> <string name="nav_backup">Архивиране</string>
<string name="nav_exit">Изход</string> <string name="nav_exit">Изход</string>
@ -173,10 +170,6 @@
<string name="overview_tempbasal_button">Временен базал</string> <string name="overview_tempbasal_button">Временен базал</string>
<string name="nsprofileview_isf_label">ISF (Инс.чувствителност):</string> <string name="nsprofileview_isf_label">ISF (Инс.чувствителност):</string>
<string name="nsclientnotinstalled">NSClient не е инсталиран. Записът е загубен!</string> <string name="nsclientnotinstalled">NSClient не е инсталиран. Записът е загубен!</string>
<string name="lowsuspend_lowprojectedmessage">Прогнозирана ниска КЗ: Временен базал 0%</string>
<string name="lowsuspend_lowmessage">Опасно ниска КЗ: Временен базал 0%</string>
<string name="lowsuspend_cancelmessage">LowSuspend: Cancel low temp</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="openapsma">OpenAPS MA</string> <string name="openapsma">OpenAPS MA</string>

View file

@ -72,10 +72,7 @@
<string name="loop_constraintsprocessed_label">Po zpracování omezení</string> <string name="loop_constraintsprocessed_label">Po zpracování omezení</string>
<string name="loop_setbypump_label">Nastaveno pumpou</string> <string name="loop_setbypump_label">Nastaveno pumpou</string>
<string name="loopdisabled">SMYČKA ZAKÁZÁNA OMEZENÍM</string> <string name="loopdisabled">SMYČKA ZAKÁZÁNA OMEZENÍM</string>
<string name="lowsuspend">Low Suspend</string>
<string name="lowsuspend_low_title">Hodnota nízké glykémie</string>
<string name="objectives_manualenacts">Ručně spuštěno</string> <string name="objectives_manualenacts">Ručně spuštěno</string>
<string name="lowsuspend_lowprojected">Předpokládaná nízká glykémie</string>
<string name="minago">m zpět</string> <string name="minago">m zpět</string>
<string name="objectives_minimalduration">Minimální trvání</string> <string name="objectives_minimalduration">Minimální trvání</string>
<string name="nav_backup">Záloha</string> <string name="nav_backup">Záloha</string>
@ -175,10 +172,6 @@
<string name="overview_tempbasal_button">Dočasný bazál</string> <string name="overview_tempbasal_button">Dočasný bazál</string>
<string name="nsprofileview_isf_label">Citlivost:</string> <string name="nsprofileview_isf_label">Citlivost:</string>
<string name="nsclientnotinstalled">NSClient není nainstalován. Záznam je ztracen!</string> <string name="nsclientnotinstalled">NSClient není nainstalován. Záznam je ztracen!</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_cancelmessage">Low Suspend: Zrušení dočasného bazálu</string>
<string name="lowsuspend_low">Nízká glykémie</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>
@ -317,4 +310,13 @@
<string name="smscommunicator_tempbasalfailed">Spuštění dočasného bazálu selhalo</string> <string name="smscommunicator_tempbasalfailed">Spuštění dočasného bazálu selhalo</string>
<string name="smscommunicator_tempbasalset" formatted="false">Dočasný bazál %.2fU/h na %d minut spuštěn</string> <string name="smscommunicator_tempbasalset" formatted="false">Dočasný bazál %.2fU/h na %d minut spuštěn</string>
<string name="smscommunicator_unknowncommand">Neznámý příkaz nebo chybná odpověď</string> <string name="smscommunicator_unknowncommand">Neznámý příkaz nebo chybná odpověď</string>
<string name="overview_editquickwizard_buttontext">Text na tlačítku:</string>
<string name="overview_editquickwizard_carbs">Sacharidy:</string>
<string name="overview_editquickwizard_valid">Platné:</string>
<string name="overview_editquickwizardlistactivity_add">Přidat</string>
<string name="overview_quickwizard_item_edit_button">Upravit</string>
<string name="overview_quickwizard_item_remove_button">Odstranit</string>
<string name="overview_quickwizardentry"></string>
<string name="quickwizard">Rychlý bolus</string>
<string name="quickwizardsettings">Nastavení rychlých bolusů</string>
</resources> </resources>

View file

@ -169,16 +169,9 @@
<string name="constraints_violation">Constraints violation</string> <string name="constraints_violation">Constraints violation</string>
<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">Low</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_lowmessage">LOW: Temp basal 0%</string>
<string name="lowsuspend_lowprojected">Low projected</string>
<string name="lowsuspend_lowprojectedmessage">LOW PROJECTED: Temp basal 0%</string>
<string name="objectives_manualenacts">Manual enacts</string> <string name="objectives_manualenacts">Manual enacts</string>
<string name="carbsconstraintapplied">Carbs constraint applied</string> <string name="carbsconstraintapplied">Carbs constraint applied</string>
<string name="nav_resetdb">Reset Datenbanken</string> <string name="nav_resetdb">Reset Datenbanken</string>

View file

@ -289,7 +289,7 @@
<string name="overview_bolusprogress_stop">Stop</string> <string name="overview_bolusprogress_stop">Stop</string>
<string name="overview_bolusprogress_stoppressed">STOP PRESSED</string> <string name="overview_bolusprogress_stoppressed">STOP PRESSED</string>
<string name="waitingforpump">Waiting for pump</string> <string name="waitingforpump">Waiting for pump</string>
<string name="overview_bolusprogress_goingtodeliver" formatted="false">Going to deliver %.2fU</string> <string name="overview_bolusprogress_goingtodeliver" formatted="false">Going to deliver %.2fU</string>
<string name="objectives_0_objective">Setting up visualization and monitoring, and analyzing basals and ratios</string> <string name="objectives_0_objective">Setting up visualization and monitoring, and analyzing basals and ratios</string>
<string name="objectives_0_gate">Verify that BG is available in Nightscout, and pump insulin data is being uploaded</string> <string name="objectives_0_gate">Verify that BG is available in Nightscout, and pump insulin data is being uploaded</string>
<string name="objectives_1_objective">Starting on an open loop</string> <string name="objectives_1_objective">Starting on an open loop</string>
@ -320,4 +320,13 @@
<string name="smscommunicator_tempbasalcancelfailed">Canceling temp basal failed</string> <string name="smscommunicator_tempbasalcancelfailed">Canceling temp basal failed</string>
<string name="smscommunicator_unknowncommand">Uknonwn command or wrong reply</string> <string name="smscommunicator_unknowncommand">Uknonwn command or wrong reply</string>
<string name="quickwizard">QuickWizard</string>
<string name="quickwizardsettings">QuickWizard settings</string>
<string name="overview_editquickwizard_buttontext">Button text:</string>
<string name="overview_editquickwizard_carbs">Carbs:</string>
<string name="overview_editquickwizard_valid">Valid:</string>
<string name="overview_editquickwizardlistactivity_add">Add</string>
<string name="overview_quickwizard_item_edit_button">Edit</string>
<string name="overview_quickwizard_item_remove_button">Remove</string>
</resources> </resources>

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory
android:title="@string/quickwizard">
<Preference
android:key="quickwizard"
android:title="@string/quickwizardsettings">
<intent android:action="info.nightscout.androidaps.plugins.Overview.activities.QuickWizardListActivity"/>
</Preference>
</PreferenceCategory>
</PreferenceScreen>

View file

@ -5,7 +5,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:2.2.1' classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files