some formatting

This commit is contained in:
Roumen Georgiev 2018-05-31 16:47:58 +03:00
parent 39e704645b
commit da89ea1643
5 changed files with 150 additions and 88 deletions

View file

@ -49,6 +49,7 @@
android:theme="@style/Theme.AppCompat.Translucent" /> android:theme="@style/Theme.AppCompat.Translucent" />
<activity android:name=".AgreementActivity" /> <activity android:name=".AgreementActivity" />
<activity android:name=".plugins.PumpDanaR.activities.DanaRHistoryActivity" /> <activity android:name=".plugins.PumpDanaR.activities.DanaRHistoryActivity" />
<activity android:name=".plugins.PumpDanaR.activities.DanaRUserOptionsActivity" />
<activity android:name=".TDDStatsActivity" /> <activity android:name=".TDDStatsActivity" />
<activity android:name=".plugins.Overview.activities.QuickWizardListActivity"> <activity android:name=".plugins.Overview.activities.QuickWizardListActivity">
<intent-filter> <intent-filter>

View file

@ -1,14 +1,82 @@
package info.nightscout.androidaps.plugins.PumpDanaR.activities; package info.nightscout.androidaps.plugins.PumpDanaR.activities;
import android.app.Activity; 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.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.MainApp;
import info.nightscout.androidaps.R;
/** /**
* Created by Rumen Georgiev on 5/31/2018. * Created by Rumen Georgiev on 5/31/2018.
*/ */
public class DanaRUserOptionsActivity extends Activity { public class DanaRUserOptionsActivity extends Activity {
private static Logger log = LoggerFactory.getLogger(DanaRUserOptionsActivity.class); 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);
}
} }

View file

@ -10,12 +10,14 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<ScrollView <ScrollView
android:id="@+id/danar_user_options_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_above="@+id/danar_buttons" android:layout_above="@+id/danar_buttons"
android:fillViewport="true"> android:fillViewport="true">
<LinearLayout <LinearLayout
android:id="@+id/danar_user_options_top"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
@ -43,33 +45,21 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginEnd="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="5dp"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:paddingRight="5dp"
android:text="@string/danar_timedisplay"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp" />
<Switch <Switch
android:id="@+id/danar_timeformat" android:id="@+id/danar_timeformat"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:showText="true" android:showText="true"
android:text="@string/danar_timedisplay"
android:textOff="12h" android:textOff="12h"
android:textOn="24h" /> android:textOn="24h" />
@ -88,32 +78,22 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginEnd="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="5dp"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:paddingRight="5dp"
android:text="@string/danar_buttonscroll"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp" />
<Switch <Switch
android:id="@+id/danar_buttonscroll" android:id="@+id/danar_buttonscroll"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1"
android:text="@string/danar_buttonscroll"
android:textOff="@string/option_off"
android:textOn="@string/option_on" />
</LinearLayout> </LinearLayout>
@ -130,32 +110,22 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginEnd="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="5dp"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:paddingRight="5dp"
android:text="@string/danar_beep"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp" />
<Switch <Switch
android:id="@+id/danar_beep" android:id="@+id/danar_beep"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1"
android:text="@string/danar_beep"
android:textOff="@string/option_off"
android:textOn="@string/option_on" />
</LinearLayout> </LinearLayout>
@ -172,13 +142,19 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginEnd="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="5dp"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="end" android:gravity="left"
android:paddingRight="5dp" android:paddingRight="5dp"
android:text="@string/danar_pumpalarm" android:text="@string/danar_pumpalarm"
android:textSize="14sp" /> android:textSize="14sp" />
@ -194,9 +170,11 @@
android:textSize="14sp" /> android:textSize="14sp" />
<RadioGroup <RadioGroup
android:id="@+id/danar_pumpalarm"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"> android:layout_weight="1"
android:checkedButton="@+id/danar_pumpalarm_sound">
<RadioButton <RadioButton
android:id="@+id/danar_pumpalarm_sound" android:id="@+id/danar_pumpalarm_sound"
@ -234,13 +212,19 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginEnd="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="5dp"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="end" android:gravity="top"
android:paddingRight="5dp" android:paddingRight="5dp"
android:text="@string/danar_screentimeout" android:text="@string/danar_screentimeout"
android:textSize="14sp" /> android:textSize="14sp" />
@ -277,13 +261,19 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginEnd="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="5dp"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="end" android:gravity="top"
android:paddingRight="5dp" android:paddingRight="5dp"
android:text="@string/danar_backlight" android:text="@string/danar_backlight"
android:textSize="14sp" /> android:textSize="14sp" />
@ -320,33 +310,23 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginEnd="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="5dp"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="end"
android:paddingRight="5dp"
android:text="@string/danar_glucoseunits"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp" />
<Switch <Switch
android:id="@+id/danar_units" android:id="@+id/danar_units"
android:layout_width="match_parent" android:layout_width="fill_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:textOff="mg/dl" android:showText="true"
android:splitTrack="false"
android:text="@string/danar_glucoseunits"
android:textOff="@string/mgdl"
android:textOn="@string/mmol" /> android:textOn="@string/mmol" />
</LinearLayout> </LinearLayout>
@ -363,13 +343,19 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginEnd="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="5dp"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="end" android:gravity="left"
android:paddingRight="5dp" android:paddingRight="5dp"
android:text="@string/danar_shutdown" android:text="@string/danar_shutdown"
android:textSize="14sp" /> android:textSize="14sp" />
@ -406,13 +392,19 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginEnd="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="5dp"
android:layout_marginStart="20dp"
android:layout_marginTop="5dp"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:gravity="end" android:gravity="left"
android:paddingRight="5dp" android:paddingRight="5dp"
android:text="@string/danar_lowreservoir" android:text="@string/danar_lowreservoir"
android:textSize="14sp" /> android:textSize="14sp" />

View file

@ -1081,7 +1081,7 @@
<string name="setupwizard_aps_description">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.</string> <string name="setupwizard_aps_description">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.</string>
<string name="startobjective">Start your first objective</string> <string name="startobjective">Start your first objective</string>
<string name="danar_useroptions">Additional options</string> <string name="danar_useroptions">Additional options</string>
<string name="danar_timedisplay">Display time in 24h time format( not 12hr )</string> <string name="danar_timedisplay">Display time format( not 12hr )</string>
<string name="danar_buttonscroll">Button scroll</string> <string name="danar_buttonscroll">Button scroll</string>
<string name="danar_beep">Beep on button press</string> <string name="danar_beep">Beep on button press</string>
<string name="danar_pumpalarm">Alarm</string> <string name="danar_pumpalarm">Alarm</string>
@ -1094,4 +1094,6 @@
<string name="danar_shutdown">Shutdown</string> <string name="danar_shutdown">Shutdown</string>
<string name="danar_lowreservoir">Low reservoir</string> <string name="danar_lowreservoir">Low reservoir</string>
<string name="danar_saveuseroptions">Save options to pump</string> <string name="danar_saveuseroptions">Save options to pump</string>
<string name="option_on">On</string>
<string name="option_off">Off</string>
</resources> </resources>

View file

@ -23,7 +23,6 @@
android:defaultValue="false" android:defaultValue="false"
android:key="openapsama_useautosens" android:key="openapsama_useautosens"
android:title="@string/openapsama_useautosens" /> android:title="@string/openapsama_useautosens" />
<SwitchPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="@string/key_use_smb" android:key="@string/key_use_smb"