diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 982682e035..fc9190475e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -49,6 +49,7 @@ android:theme="@style/Theme.AppCompat.Translucent" /> + 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 eb9cd05d82..ee5e39c4fb 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,14 +1,82 @@ package info.nightscout.androidaps.plugins.PumpDanaR.activities; import android.app.Activity; +import android.os.Bundle; +import android.os.Handler; +import android.os.HandlerThread; +import android.support.v7.widget.LinearLayoutManager; +import android.support.v7.widget.RecyclerView; +import android.support.v7.widget.SwitchCompat; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.RadioButton; +import android.widget.RadioGroup; +import android.widget.Spinner; +import android.widget.Switch; +import android.widget.TextView; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import info.nightscout.androidaps.MainApp; +import info.nightscout.androidaps.R; + /** * Created by Rumen Georgiev on 5/31/2018. */ public class DanaRUserOptionsActivity extends Activity { private static Logger log = LoggerFactory.getLogger(DanaRUserOptionsActivity.class); + + private Handler mHandler; + private static HandlerThread mHandlerThread; + LinearLayoutManager llm; + RecyclerView recyclerView; + + Switch timeFormat; + Switch buttonScroll; + Switch beep; + RadioGroup pumpAlarm; + RadioButton pumpAlarmSound; + RadioButton pumpAlarmVibrate; + RadioButton pumpAlarmBoth; + EditText screenTimeout; + EditText backlightTimeout; + EditText shutdown; + EditText lowReservoir; + + + @Override + protected void onResume() { + super.onResume(); + MainApp.bus().register(this); + } + + @Override + protected void onPause() { + super.onPause(); + MainApp.bus().unregister(this); + } + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.danar_user_options); + + timeFormat = (Switch) findViewById(R.id.danar_timeformat); + buttonScroll = (Switch) findViewById(R.id.danar_buttonscroll); + beep = (Switch) findViewById(R.id.danar_beep); + pumpAlarm = (RadioGroup) findViewById(R.id.danar_pumpalarm); + pumpAlarmSound = (RadioButton) findViewById(R.id.danar_pumpalarm_sound); + pumpAlarmVibrate = (RadioButton) findViewById(R.id.danar_pumpalarm_vibrate); + pumpAlarmBoth = (RadioButton) findViewById(R.id.danar_pumpalarm_both); + screenTimeout = (EditText) findViewById(R.id.danar_screentimeout); + backlightTimeout = (EditText) findViewById(R.id.danar_backlight); + shutdown = (EditText) findViewById(R.id.danar_shutdown); + lowReservoir = (EditText) findViewById(R.id.danar_lowreservoir); + + + + } } diff --git a/app/src/main/res/layout/danar_user_options.xml b/app/src/main/res/layout/danar_user_options.xml index 7d84cfa65c..b0affb9082 100644 --- a/app/src/main/res/layout/danar_user_options.xml +++ b/app/src/main/res/layout/danar_user_options.xml @@ -10,12 +10,14 @@ android:layout_height="match_parent"> @@ -43,33 +45,21 @@ - - - - @@ -88,32 +78,22 @@ - - - - + android:layout_weight="1" + android:text="@string/danar_buttonscroll" + android:textOff="@string/option_off" + android:textOn="@string/option_on" /> @@ -130,32 +110,22 @@ - - - - + android:layout_weight="1" + android:text="@string/danar_beep" + android:textOff="@string/option_off" + android:textOn="@string/option_on" /> @@ -172,13 +142,19 @@ @@ -194,9 +170,11 @@ android:textSize="14sp" /> + android:layout_weight="1" + android:checkedButton="@+id/danar_pumpalarm_sound"> @@ -277,13 +261,19 @@ @@ -320,33 +310,23 @@ - - - - @@ -363,13 +343,19 @@ @@ -406,13 +392,19 @@ diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 03e2dd671d..e41e04c964 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 in 24h time format( not 12hr ) + Display time format( not 12hr ) Button scroll Beep on button press Alarm @@ -1094,4 +1094,6 @@ Shutdown Low reservoir Save options to pump + On + Off diff --git a/app/src/main/res/xml/pref_openapssmb.xml b/app/src/main/res/xml/pref_openapssmb.xml index c2eee2bc62..d5db368eac 100644 --- a/app/src/main/res/xml/pref_openapssmb.xml +++ b/app/src/main/res/xml/pref_openapssmb.xml @@ -23,7 +23,6 @@ android:defaultValue="false" android:key="openapsama_useautosens" android:title="@string/openapsama_useautosens" /> -