From 41af503104123a3f9320d9e11bbaf7b5207918d6 Mon Sep 17 00:00:00 2001 From: Roumen Georgiev Date: Thu, 31 May 2018 17:10:09 +0300 Subject: [PATCH] filling in some data --- .../activities/DanaRUserOptionsActivity.java | 35 +++++++++++++++++++ app/src/main/res/values/strings.xml | 2 +- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRUserOptionsActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRUserOptionsActivity.java index ee5e39c4fb..76ae1557e4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRUserOptionsActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRUserOptionsActivity.java @@ -1,5 +1,6 @@ package info.nightscout.androidaps.plugins.PumpDanaR.activities; +import android.annotation.SuppressLint; import android.app.Activity; import android.os.Bundle; import android.os.Handler; @@ -7,6 +8,7 @@ import android.os.HandlerThread; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.SwitchCompat; +import android.text.Spanned; import android.view.View; import android.widget.Button; import android.widget.EditText; @@ -21,6 +23,16 @@ import org.slf4j.LoggerFactory; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; +import info.nightscout.androidaps.db.ExtendedBolus; +import info.nightscout.androidaps.interfaces.PluginType; +import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; +import info.nightscout.androidaps.plugins.PumpDanaR.DanaRPump; +import info.nightscout.androidaps.plugins.PumpDanaRKorean.DanaRKoreanPlugin; +import info.nightscout.androidaps.plugins.PumpDanaRS.DanaRSPlugin; +import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; +import info.nightscout.utils.DateUtil; +import info.nightscout.utils.DecimalFormatter; +import info.nightscout.utils.SetWarnColor; /** * Created by Rumen Georgiev on 5/31/2018. @@ -41,6 +53,7 @@ public class DanaRUserOptionsActivity extends Activity { RadioButton pumpAlarmSound; RadioButton pumpAlarmVibrate; RadioButton pumpAlarmBoth; + Switch pumpUnits; EditText screenTimeout; EditText backlightTimeout; EditText shutdown; @@ -73,10 +86,32 @@ public class DanaRUserOptionsActivity extends Activity { pumpAlarmBoth = (RadioButton) findViewById(R.id.danar_pumpalarm_both); screenTimeout = (EditText) findViewById(R.id.danar_screentimeout); backlightTimeout = (EditText) findViewById(R.id.danar_backlight); + pumpUnits = (Switch) findViewById(R.id.danar_units); shutdown = (EditText) findViewById(R.id.danar_shutdown); lowReservoir = (EditText) findViewById(R.id.danar_lowreservoir); + boolean isKorean = MainApp.getSpecificPlugin(DanaRKoreanPlugin.class) != null && MainApp.getSpecificPlugin(DanaRKoreanPlugin.class).isEnabled(PluginType.PUMP); + boolean isRS = MainApp.getSpecificPlugin(DanaRSPlugin.class) != null && MainApp.getSpecificPlugin(DanaRSPlugin.class).isEnabled(PluginType.PUMP); + Activity activity = this; + if (activity != null) + activity.runOnUiThread(new Runnable() { + @SuppressLint("SetTextI18n") + @Override + public void run() { + DanaRPump pump = DanaRPump.getInstance(); + if (pump.getUnits() != null) { + if(pump.getUnits() == "mmol") { + pumpUnits.setChecked(true); + } + } + if (pump.timeDisplayType != 0) { + timeFormat.setChecked(true); + } + + } + }); + } } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index e41e04c964..fb4f85744a 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1081,7 +1081,7 @@ Select one from availables algorithms. They are sorted from oldest to newest. Newer algorithm is usualy more powerfull and more aggresive. Thus if you are new looper you may probably start with AMA and not with latest one. Do not forget to read the OpenAPS documentation and configure it before use. Start your first objective Additional options - Display time format( not 12hr ) + Display time format Button scroll Beep on button press Alarm