improve statuslights layout
This commit is contained in:
parent
fba804b2cb
commit
c86edb94fd
|
@ -891,14 +891,12 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
|
|||
binding.statusLightsLayout.apply {
|
||||
cannulaOrPatch.setImageResource(if (isPatchPump) info.nightscout.core.main.R.drawable.ic_patch_pump_outline else R.drawable.ic_cp_age_cannula)
|
||||
cannulaOrPatch.contentDescription = rh.gs(if (isPatchPump) R.string.statuslights_patch_pump_age else R.string.statuslights_cannula_age)
|
||||
cannulaOrPatch.scaleX = if (isPatchPump) 1.4f else 2f
|
||||
cannulaOrPatch.scaleY = cannulaOrPatch.scaleX
|
||||
insulinAge.visibility = isPatchPump.not().toVisibility()
|
||||
batteryLayout.visibility = (!isPatchPump || pump.pumpDescription.useHardwareLink).toVisibility()
|
||||
pbAge.visibility = (pump.pumpDescription.isBatteryReplaceable || pump.isBatteryChangeLoggingEnabled()).toVisibility()
|
||||
val useBatteryLevel = (pump.model() == PumpType.OMNIPOD_EROS)
|
||||
|| (pump.model() != PumpType.ACCU_CHEK_COMBO && pump.model() != PumpType.OMNIPOD_DASH)
|
||||
batteryLevel.visibility = useBatteryLevel.toVisibility()
|
||||
pbLevel.visibility = useBatteryLevel.toVisibility()
|
||||
statusLightsLayout.visibility = (sp.getBoolean(R.string.key_show_statuslights, true) || config.NSCLIENT).toVisibility()
|
||||
}
|
||||
statusLightHandler.updateStatusLights(
|
||||
|
@ -909,7 +907,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList
|
|||
binding.statusLightsLayout.sensorAge,
|
||||
null,
|
||||
binding.statusLightsLayout.pbAge,
|
||||
binding.statusLightsLayout.batteryLevel
|
||||
binding.statusLightsLayout.pbLevel
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ interface SkinInterface {
|
|||
for (v in texts) v.setTextSize(COMPLEX_UNIT_PX, v.textSize * 1.3f)
|
||||
}
|
||||
binding.statusLightsLayout.apply {
|
||||
val texts = listOf(cannulaAge, insulinAge, reservoirLevel, sensorAge, pbAge, batteryLevel)
|
||||
val texts = listOf(cannulaAge, insulinAge, reservoirLevel, sensorAge, pbAge, pbLevel)
|
||||
for (v in texts) v.setTextSize(COMPLEX_UNIT_PX, v.textSize * 1.3f)
|
||||
}
|
||||
timeLayout.orientation = LinearLayout.HORIZONTAL
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
app:alignItems="stretch"
|
||||
app:flexDirection="row"
|
||||
app:flexWrap="wrap"
|
||||
app:justifyContent="center">
|
||||
app:justifyContent="space_around">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pump"
|
||||
|
|
|
@ -1,32 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.google.android.flexbox.FlexboxLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/status_lights_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:layout_marginBottom="3dp"
|
||||
android:orientation="horizontal"
|
||||
android:layout_marginTop="-3dp"
|
||||
android:layout_marginBottom="-3dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
android:baselineAligned="false">
|
||||
app:alignContent="stretch"
|
||||
app:alignItems="stretch"
|
||||
app:flexDirection="row"
|
||||
app:flexWrap="wrap"
|
||||
app:justifyContent="space_around">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:focusable="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:gravity="center"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/cannula_or_patch"
|
||||
android:layout_width="38dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:contentDescription="@string/statuslights_cannula_age"
|
||||
android:scaleX="2"
|
||||
android:scaleY="2"
|
||||
app:srcCompat="@drawable/ic_cp_age_cannula" />
|
||||
|
||||
<TextView
|
||||
|
@ -40,23 +40,20 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true"
|
||||
android:gravity="center_horizontal">
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:contentDescription="@string/a11y_insulin_label"
|
||||
android:scaleX="1.7"
|
||||
android:scaleY="1.7"
|
||||
app:srcCompat="@drawable/ic_cp_age_insulin" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/insulin_age"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lines="1"
|
||||
tools:text="12h" />
|
||||
|
||||
|
@ -73,18 +70,15 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true"
|
||||
android:gravity="center_horizontal"
|
||||
android:gravity="center"
|
||||
tools:ignore="UseCompoundDrawables">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_height="28dp"
|
||||
android:contentDescription="@string/sensor_label"
|
||||
android:scaleX="1.6"
|
||||
android:scaleY="1.6"
|
||||
app:srcCompat="@drawable/ic_cp_age_sensor" />
|
||||
|
||||
<TextView
|
||||
|
@ -99,31 +93,28 @@
|
|||
<LinearLayout
|
||||
android:id="@+id/battery_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:focusable="true"
|
||||
android:gravity="center_horizontal">
|
||||
android:gravity="center">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:contentDescription="@string/battery_label"
|
||||
android:scaleX="1.8"
|
||||
android:scaleY="1.8"
|
||||
app:srcCompat="@drawable/ic_cp_age_battery" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/pb_age"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lines="1"
|
||||
android:text="-"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/battery_level"
|
||||
android:id="@+id/pb_level"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:lines="1"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="0dp"
|
||||
|
@ -131,4 +122,4 @@
|
|||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</com.google.android.flexbox.FlexboxLayout>
|
||||
|
|
Loading…
Reference in a new issue