First version of Layout and interface

This commit is contained in:
Philoul 2020-10-17 11:00:38 +02:00
parent cbdee2b81b
commit bd3cba8a1a
4 changed files with 470 additions and 4 deletions

View file

@ -37,7 +37,7 @@ import info.nightscout.androidaps.utils.ui.UIRunnable
import io.reactivex.android.schedulers.AndroidSchedulers import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.CompositeDisposable import io.reactivex.disposables.CompositeDisposable
import kotlinx.android.synthetic.main.actions_fragment.* import kotlinx.android.synthetic.main.actions_fragment.*
import kotlinx.android.synthetic.main.careportal_stats_fragment.* import kotlinx.android.synthetic.main.careportal_stats_fragment2.*
import java.util.* import java.util.*
import javax.inject.Inject import javax.inject.Inject
@ -239,8 +239,10 @@ class ActionsFragment : DaggerFragment() {
actions_pumpbatterychange?.visibility = pump.pumpDescription.isBatteryReplaceable.toVisibility() actions_pumpbatterychange?.visibility = pump.pumpDescription.isBatteryReplaceable.toVisibility()
actions_temptarget?.visibility = (profile != null && config.APS).toVisibility() actions_temptarget?.visibility = (profile != null && config.APS).toVisibility()
actions_tddstats?.visibility = pump.pumpDescription.supportsTDDs.toVisibility() actions_tddstats?.visibility = pump.pumpDescription.supportsTDDs.toVisibility()
if (!config.NSCLIENT)
statusLightHandler.updateStatusLights(careportal_canulaage, careportal_insulinage, null, careportal_sensorage, careportal_pbage, null) statusLightHandler.updateStatusLights(careportal_canulaage, careportal_insulinage, careportal_reservoirlevel, careportal_sensorage, careportal_pbage, careportal_batterylevel)
else
statusLightHandler.updateStatusLights(careportal_canulaage, careportal_insulinage, null, careportal_sensorage, careportal_pbage, null)
checkPumpCustomActions() checkPumpCustomActions()
} }

View file

@ -128,7 +128,7 @@
<include <include
android:id="@+id/careportal_stats" android:id="@+id/careportal_stats"
layout="@layout/careportal_stats_fragment" layout="@layout/careportal_stats_fragment2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="10dp" /> android:layout_marginTop="10dp" />

View file

@ -0,0 +1,454 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
tools:context=".plugins.general.actions.ActionsFragment">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="25dp"
android:layout_weight="1"
android:gravity="center_vertical"
android:drawableLeft="@drawable/ic_cp_age_sensor"
android:paddingRight="5dp"
android:paddingStart="15dp"
android:text="@string/careportal_sensor_label"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:layout_width="wrap_content"
android:layout_height="25dp"
android:drawableLeft="@drawable/ic_cp_age_insulin"
android:gravity="center_vertical"
android:paddingStart="15dp"
android:paddingRight="5dp"
android:text="@string/careportal_insulin_label"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:layout_width="wrap_content"
android:layout_height="25dp"
android:drawableLeft="@drawable/ic_cp_age_canula"
android:gravity="center_vertical"
android:paddingStart="15dp"
android:paddingRight="5dp"
android:text="@string/careportal_canula_label"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:layout_width="wrap_content"
android:layout_height="25dp"
android:gravity="center_vertical"
android:drawableLeft="@drawable/ic_cp_age_battery"
android:paddingRight="5dp"
android:paddingStart="15dp"
android:text="@string/careportal_pb_label"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="5dp"
android:background="@color/listdelimiter" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:layout_weight="1"
android:paddingStart="5dp"
android:paddingRight="5dp"
android:text="@string/careportal_age_label"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:paddingRight="5dp"
android:text="@string/careportal_age_label"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:paddingRight="5dp"
android:text="@string/careportal_age_label"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:paddingRight="5dp"
android:text="@string/careportal_age_label"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="5dp"
android:background="@color/listdelimiter" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/careportal_sensorage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:id="@+id/careportal_insulinage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:id="@+id/careportal_canulaage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:id="@+id/careportal_pbage"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="5dp"
android:background="@color/listdelimiter" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="0"
android:orientation="vertical">
<TextView
android:id="@+id/careportal_senslevellabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:paddingRight="5dp"
android:text=""
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:id="@+id/careportal_inslevellabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:paddingRight="5dp"
android:text="@string/careportal_level_label"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:paddingRight="5dp"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:id="@+id/careportal_pblevellabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:paddingStart="5dp"
android:paddingRight="5dp"
android:text="@string/careportal_level_label"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="0dp"
android:layout_marginBottom="5dp"
android:background="@color/listdelimiter" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/careportal_sensorlevel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:layout_marginRight="20dp"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:id="@+id/careportal_reservoirlevel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:layout_marginRight="20dp"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:layout_marginRight="20dp"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="2dp"
android:background="@color/listdelimiter" />
<TextView
android:id="@+id/careportal_batterylevel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center_vertical"
android:layout_marginRight="20dp"
android:paddingLeft="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="0dp"
android:layout_marginTop="2dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/listdelimiter" />
</LinearLayout>
</LinearLayout>
</FrameLayout>

View file

@ -527,6 +527,10 @@
<string name="statuslights_sage_warning">Threshold warning sensor age [h]</string> <string name="statuslights_sage_warning">Threshold warning sensor age [h]</string>
<string name="key_statuslights_sage_critical" translatable="false">statuslights_sage_critical</string> <string name="key_statuslights_sage_critical" translatable="false">statuslights_sage_critical</string>
<string name="statuslights_sage_critical">Threshold critical sensor age [h]</string> <string name="statuslights_sage_critical">Threshold critical sensor age [h]</string>
<string name="key_statuslights_sbat_warning" translatable="false">statuslights_sbat_warning</string>
<string name="statuslights_sbat_warning">Threshold warning sensor battery level [%]</string>
<string name="key_statuslights_sbat_critical" translatable="false">statuslights_sbat_critical</string>
<string name="statuslights_sbat_critical">Threshold critical sensor battery level [%]</string>
<string name="key_statuslights_bage_warning" translatable="false">statuslights_bage_warning</string> <string name="key_statuslights_bage_warning" translatable="false">statuslights_bage_warning</string>
<string name="statuslights_bage_warning">Threshold warning battery age [h]</string> <string name="statuslights_bage_warning">Threshold warning battery age [h]</string>
<string name="key_statuslights_bage_critical" translatable="false">statuslights_bage_critical</string> <string name="key_statuslights_bage_critical" translatable="false">statuslights_bage_critical</string>
@ -565,6 +569,12 @@
<string name="careportal_insulinage_label">Insulin age</string> <string name="careportal_insulinage_label">Insulin age</string>
<string name="doprofileswitch">Do Profile Switch</string> <string name="doprofileswitch">Do Profile Switch</string>
<string name="careportal_pbage_label">Pump battery age</string> <string name="careportal_pbage_label">Pump battery age</string>
<string name="careportal_sensor_label">Sensor</string>
<string name="careportal_canula_label">Canula</string>
<string name="careportal_insulin_label">Insulin</string>
<string name="careportal_pb_label">Pump battery</string>
<string name="careportal_age_label">Age:</string>
<string name="careportal_level_label">Level:</string>
<string name="ns_alarmoptions">Alarm options</string> <string name="ns_alarmoptions">Alarm options</string>
<string name="key_ns_announcements" translatable="false">ns_announcements</string> <string name="key_ns_announcements" translatable="false">ns_announcements</string>
<string name="key_ns_alarms" translatable="false">ns_alarms</string> <string name="key_ns_alarms" translatable="false">ns_alarms</string>