WIP on moving parts of omnipod-eros to omnipod-common

This commit is contained in:
Bart Sopers 2021-02-19 21:19:40 +01:00
parent ecfabccffb
commit 87d4ba14cb
47 changed files with 1072 additions and 1047 deletions

View file

@ -33,7 +33,7 @@
tools:layout_editor_absoluteX="3dp" />
<LinearLayout
android:id="@+id/buttons"
android:id="@+id/buttons_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
@ -120,7 +120,7 @@
android:orientation="horizontal"
android:padding="4dp"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/buttons">
app:layout_constraintTop_toBottomOf="@+id/buttons_layout">
<Button
android:id="@+id/back_button"

View file

@ -18,6 +18,9 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
buildTypes {
release {

View file

@ -0,0 +1,20 @@
package info.nightscout.androidaps.plugins.pump.omnipod.common.dagger
import dagger.Module
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.PodActivationWizardActivity
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.PodDeactivationWizardActivity
@Module
@Suppress("unused")
abstract class OmnipodCommonModule {
// ACTIVITIES
@ActivityScope
@ContributesAndroidInjector(modules = [OmnipodWizardModule::class])
abstract fun contributesActivationWizardActivity(): PodActivationWizardActivity
@ActivityScope
@ContributesAndroidInjector(modules = [OmnipodWizardModule::class])
abstract fun contributesDeactivationWizardActivity(): PodDeactivationWizardActivity
}

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger
package info.nightscout.androidaps.plugins.pump.omnipod.common.dagger
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider

View file

@ -1,4 +1,4 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger
package info.nightscout.androidaps.plugins.pump.omnipod.common.dagger
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider

View file

@ -1,11 +1,11 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.definition;
package info.nightscout.androidaps.plugins.pump.omnipod.common.definition;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
import info.nightscout.androidaps.plugins.pump.omnipod.common.R;
/**
* Created by andy on 4.8.2019
*/
public enum OmnipodErosCommandType {
public enum OmnipodCommandType {
INITIALIZE_POD(R.string.omnipod_common_cmd_initialize_pod), // First step of Pod activation
INSERT_CANNULA(R.string.omnipod_common_cmd_insert_cannula), // Second step of Pod activation
DEACTIVATE_POD(R.string.omnipod_common_cmd_deactivate_pod), //
@ -18,7 +18,7 @@ public enum OmnipodErosCommandType {
GET_POD_STATUS(R.string.omnipod_common_cmd_get_pod_status), //
SET_TIME(R.string.omnipod_common_cmd_set_time), //
CONFIGURE_ALERTS(R.string.omnipod_common_cmd_configure_alerts), //
ACKNOWLEDGE_ALERTS(R.string.omnipod_common_cmd_acknowledge_alerts), //
ACKNOWLEDGE_ALERTS(R.string.omnipod_common_cmd_silence_alerts), //
READ_POD_PULSE_LOG(R.string.omnipod_common_cmd_read_pulse_log), //
SUSPEND_DELIVERY(R.string.omnipod_common_cmd_suspend_delivery),
RESUME_DELIVERY(R.string.omnipod_common_cmd_resume_delivery),
@ -26,7 +26,7 @@ public enum OmnipodErosCommandType {
private final int resourceId;
OmnipodErosCommandType(int resourceId) {
OmnipodCommandType(int resourceId) {
this.resourceId = resourceId;
}

View file

@ -21,7 +21,7 @@ class PodActivationWizardActivity : OmnipodWizardActivityBase() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.omnipod_pod_activation_wizard_activity)
setContentView(R.layout.omnipod_common_pod_activation_wizard_activity)
startDestination = savedInstanceState?.getInt(KEY_START_DESTINATION, R.id.fillPodInfoFragment)
?: if (podStateManager.activationProgress.isBefore(ActivationProgress.PRIMING_COMPLETED)) {
@ -37,7 +37,7 @@ class PodActivationWizardActivity : OmnipodWizardActivityBase() {
this.startDestination = startDestination
val navController = getNavController()
val navInflater = navController.navInflater
val graph = navInflater.inflate(R.navigation.omnipod_pod_activation_wizard_navigation_graph)
val graph = navInflater.inflate(R.navigation.omnipod_common_pod_activation_wizard_navigation_graph)
graph.startDestination = startDestination
navController.graph = graph
}

View file

@ -6,6 +6,7 @@ import androidx.annotation.StringRes
import androidx.fragment.app.viewModels
import androidx.lifecycle.ViewModelProvider
import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.common.dagger.OmnipodPluginQualifier
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.InitializePodActionViewModel
import javax.inject.Inject

View file

@ -6,6 +6,7 @@ import androidx.annotation.StringRes
import androidx.fragment.app.viewModels
import androidx.lifecycle.ViewModelProvider
import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.common.dagger.OmnipodPluginQualifier
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.viewmodel.InsertCannulaActionViewModel
import javax.inject.Inject

View file

@ -75,6 +75,6 @@ abstract class ActionFragmentBase : WizardFragmentBase() {
@LayoutRes
override fun getLayoutId(): Int {
return R.layout.omnipod_wizard_action_page_fragment
return R.layout.omnipod_common_wizard_action_page_fragment
}
}

View file

@ -20,6 +20,6 @@ abstract class InfoFragmentBase : WizardFragmentBase() {
@LayoutRes
override fun getLayoutId(): Int {
return R.layout.omnipod_wizard_info_page_fragment
return R.layout.omnipod_common_wizard_info_page_fragment
}
}

View file

@ -9,7 +9,7 @@ class PodDeactivationWizardActivity : OmnipodWizardActivityBase() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.omnipod_pod_deactivation_wizard_activity)
setContentView(R.layout.omnipod_common_pod_deactivation_wizard_activity)
}
override fun getTotalDefinedNumberOfSteps(): Int = 3

View file

@ -10,6 +10,7 @@ import androidx.fragment.app.viewModels
import androidx.lifecycle.ViewModelProvider
import androidx.navigation.fragment.findNavController
import info.nightscout.androidaps.plugins.pump.omnipod.common.R
import info.nightscout.androidaps.plugins.pump.omnipod.common.dagger.OmnipodPluginQualifier
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.common.fragment.ActionFragmentBase
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.viewmodel.DeactivatePodActionViewModel
import info.nightscout.androidaps.utils.extensions.toVisibility

View file

@ -0,0 +1,68 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button
android:id="@+id/button_refresh_status"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_refresh_pod_status"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/refresh" />
<Button
android:id="@+id/button_pod_management"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_pod_management"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_common_overview_button_pod_management" />
<Button
android:id="@+id/button_silence_alerts"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_silence_alerts"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_common_overview_button_silence_alerts" />
<Button
android:id="@+id/button_set_time"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_set_time"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_common_overview_button_set_time"
android:visibility="gone" />
<Button
android:id="@+id/button_resume_delivery"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_resume_delivery"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_common_overview_button_resume_delivery"
android:visibility="gone" />
<Button
android:id="@+id/button_suspend_delivery"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_suspend_delivery"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_common_overview_button_suspend_delivery"
android:visibility="gone" />
</merge>

View file

@ -0,0 +1,692 @@
<merge 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:layout_width="match_parent"
android:layout_height="match_parent">
<!-- Unique ID -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_pod_unique_id"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/pod_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- Pod Lot -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_lot_number"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/pod_lot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- Pod Tid -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_pod_sequence_number"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/pod_tid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- Pod fw version -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_firmware_version"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/firmware_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- Pod Time -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_time_on_pod"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/time_on_pod"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- Pod Expires -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_pod_expiry_date"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/pod_expiry_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- Pod Status -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_pod_status"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<com.joanzapata.iconify.widget.IconTextView
android:id="@+id/pod_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text=""
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<TextView
android:id="@+id/queue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=""
android:textAlignment="center" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_last_connection"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/last_connection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_last_bolus"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/last_bolus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_base_basal_rate"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/base_basal_rate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_temp_basal_rate"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/temp_basal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_reservoir"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/reservoir"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_total_delivered"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/total_delivered"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_errors"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/errors"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_pod_active_alerts"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/pod_active_alerts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:paddingTop="10dp"
android:rotationX="180"
android:rotationY="180"
app:drawableTopCompat="@drawable/ic_pod" />
</merge>

View file

@ -11,5 +11,5 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
app:navGraph="@navigation/omnipod_pod_deactivation_wizard_navigation_graph" />
app:navGraph="@navigation/omnipod_common_pod_deactivation_wizard_navigation_graph" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -7,7 +7,7 @@
<include
android:id="@+id/progress_indication_layout"
layout="@layout/omnipod_wizard_progress_indication" />
layout="@layout/omnipod_common_wizard_progress_indication" />
<TextView
android:id="@+id/fragment_title"
@ -30,5 +30,5 @@
<include
android:id="@+id/nav_buttons_layout"
layout="@layout/omnipod_wizard_nav_buttons" />
layout="@layout/omnipod_common_wizard_nav_buttons" />
</LinearLayout>

View file

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<ProgressBar
android:id="@+id/progress_indication"
@ -13,4 +10,4 @@
android:progress="0"
android:progressTint="@color/omnipod_wizard_progress_bar"
android:scaleY=".5" />
</LinearLayout>
</merge>

View file

@ -1,858 +0,0 @@
<RelativeLayout 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.OmnipodOverviewFragment">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/buttons"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingTop="2dp"
android:paddingBottom="5dp"
android:visibility="gone">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:gravity="center_vertical|center_horizontal"
android:text="@string/initializing"
android:textAppearance="?android:attr/textAppearanceSmall" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/rileylink_status"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<com.joanzapata.iconify.widget.IconTextView
android:id="@+id/riley_link_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="{fa-bluetooth-b}"
android:textColor="@android:color/white"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<!-- Pod Address -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_pod_unique_id"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/pod_address"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- Pod Lot -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_lot_number"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/pod_lot"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- Pod Tid -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_pod_sequence_number"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/pod_tid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- Pod fw version -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_firmware_version"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/firmware_version"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- Pod Time -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_time_on_pod"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/time_on_pod"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- Pod Expires -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_pod_expiry_date"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/pod_expiry_date"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<!-- Pod Status -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_pod_status"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<com.joanzapata.iconify.widget.IconTextView
android:id="@+id/pod_status"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text=""
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<TextView
android:id="@+id/queue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text=""
android:textAlignment="center" />
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_last_connection"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/last_connection"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_last_bolus"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/last_bolus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_base_basal_rate"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/base_basal_rate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_temp_basal_rate"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/temp_basal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_reservoir"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/reservoir"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_total_delivered"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/total_delivered"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_errors"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/errors"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:gravity="end"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:text="@string/omnipod_common_overview_pod_active_alerts"
android:textSize="14sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:gravity="center_horizontal"
android:paddingStart="2dp"
android:paddingEnd="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/pod_active_alerts"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="start"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:textColor="@android:color/white"
android:textSize="14sp" />
</LinearLayout>
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<TextView
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:paddingTop="10dp"
android:rotationX="180"
android:rotationY="180"
app:drawableTopCompat="@drawable/ic_pod" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/buttons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<Button
android:id="@+id/button_refresh_status"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_refresh_pod_status"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/refresh" />
<Button
android:id="@+id/button_pod_management"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_pod_management"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_common_overview_button_pod_management" />
<Button
android:id="@+id/button_acknowledge_active_alerts"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_acknowledge_alerts"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_common_overview_button_acknowledge_active_alerts" />
<Button
android:id="@+id/button_set_time"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_set_time"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_common_overview_button_set_time"
android:visibility="gone" />
<Button
android:id="@+id/button_resume_delivery"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_resume_delivery"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_common_overview_button_resume_delivery"
android:visibility="gone" />
<Button
android:id="@+id/button_suspend_delivery"
style="@style/ButtonSmallFontStyle"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:drawableTop="@drawable/ic_omnipod_overview_suspend_delivery"
android:drawablePadding="@dimen/omnipod_icon_button_drawable_padding"
android:text="@string/omnipod_common_overview_button_suspend_delivery"
android:visibility="gone" />
</LinearLayout>
</RelativeLayout>

View file

@ -11,7 +11,7 @@
<string name="key_omnipod_common_expiration_reminder_hours_before_shutdown" translatable="false">AAPS.Omnipod.expiration_reminder_hours_before_shutdown</string>
<string name="key_omnipod_common_low_reservoir_alert_enabled" translatable="false">AAPS.Omnipod.low_reservoir_alert_enabled</string>
<string name="key_omnipod_common_low_reservoir_alert_units" translatable="false">AAPS.Omnipod.low_reservoir_alert_units</string>
<string name="key_omnipod_common_automatically_acknowledge_alerts_enabled" translatable="false">AAPS.Omnipod.automatically_acknowledge_alerts_enabled</string>
<string name="key_omnipod_common_automatically_silence_alerts_enabled" translatable="false">AAPS.Omnipod.automatically_acknowledge_alerts_enabled</string>
<!-- Omnipod - Pod Management -->
<string name="omnipod_common_pod_management_title">Pod Management</string>
@ -34,7 +34,7 @@
<string name="omnipod_common_error_unsupported_custom_command">Unsupported custom command: %1$s</string>
<string name="omnipod_common_error_failed_to_refresh_status">Failed to refresh status</string>
<string name="omnipod_common_error_failed_to_refresh_status_on_startup">Failed to refresh status on startup</string>
<string name="omnipod_common_error_failed_to_acknowledge_alerts">Failed to acknowledge alerts</string>
<string name="omnipod_common_error_failed_to_silence_alerts">Failed to silence alerts</string>
<string name="omnipod_common_error_failed_to_suspend_delivery">Failed to suspend delivery</string>
<string name="omnipod_common_error_failed_to_set_time">Failed to set time</string>
<string name="omnipod_common_error_failed_to_resume_delivery">Failed to resume delivery</string>
@ -53,7 +53,7 @@
<string name="omnipod_common_confirmation_expiration_alerts_updated">Alert configuration has been updated in the Pod.</string>
<string name="omnipod_common_confirmation_time_on_pod_updated">The time on the Pod has been updated.</string>
<string name="omnipod_common_confirmation_suspended_delivery">All insulin delivery has been suspended.</string>
<string name="omnipod_common_confirmation_acknowledged_alerts">Active alerts have been acknowledged.</string>
<string name="omnipod_common_confirmation_silenced_alerts">Active alerts have been silenced.</string>
<string name="omnipod_common_confirmation_delivery_resumed">Insulin delivery has been resumed.</string>
<!-- Omnipod - Overview -->
@ -61,7 +61,7 @@
<string name="omnipod_common_overview_button_suspend_delivery">Suspend</string>
<string name="omnipod_common_overview_button_resume_delivery">Resume Delivery</string>
<string name="omnipod_common_overview_button_pod_management">Pod Mgmt</string>
<string name="omnipod_common_overview_button_acknowledge_active_alerts">Ack Alerts</string>
<string name="omnipod_common_overview_button_silence_alerts">Silence Alerts</string>
<string name="omnipod_common_overview_pod_status">Pod Status</string>
<string name="omnipod_common_overview_total_delivered">Total Delivered</string>
<string name="omnipod_common_overview_total_delivered_value">%1$.2f U</string>
@ -127,7 +127,7 @@
<string name="omnipod_common_preferences_expiration_reminder_hours_before_shutdown">Hours before shutdown</string>
<string name="omnipod_common_preferences_low_reservoir_alert_enabled">Low reservoir alert enabled</string>
<string name="omnipod_common_preferences_low_reservoir_alert_units">Number of units</string>
<string name="omnipod_common_preferences_automatically_acknowledge_alerts">Automatically acknowledge Pod alerts</string>
<string name="omnipod_common_preferences_automatically_silence_alerts">Automatically silence Pod alerts</string>
<string name="omnipod_common_preferences_category_other">Other</string>
<string name="omnipod_common_preferences_category_alerts">Alerts</string>
<string name="omnipod_common_preferences_category_confirmation_beeps">Confirmation Beeps</string>
@ -156,7 +156,7 @@
<string name="omnipod_common_cmd_get_pod_info">Get Pod Info</string>
<string name="omnipod_common_cmd_set_time">Set Time</string>
<string name="omnipod_common_cmd_configure_alerts">Configure Alerts</string>
<string name="omnipod_common_cmd_acknowledge_alerts">Acknowledge Alerts</string>
<string name="omnipod_common_cmd_silence_alerts">Silence Alerts</string>
<string name="omnipod_common_cmd_suspend_delivery">Suspend Delivery</string>
<string name="omnipod_common_cmd_resume_delivery">Resume Delivery</string>
<string name="omnipod_common_cmd_unknown_entry">Unknown Entry</string>

View file

@ -18,6 +18,9 @@ android {
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
buildTypes {
release {

View file

@ -61,8 +61,8 @@
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_common_automatically_acknowledge_alerts_enabled"
android:title="@string/omnipod_common_preferences_automatically_acknowledge_alerts" />
android:key="@string/key_omnipod_common_automatically_silence_alerts_enabled"
android:title="@string/omnipod_common_preferences_automatically_silence_alerts" />
</PreferenceCategory>

View file

@ -66,6 +66,7 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLin
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpInfo;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.service.RileyLinkServiceData;
import info.nightscout.androidaps.plugins.pump.common.utils.DateTimeUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType;
import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandAcknowledgeAlerts;
import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandDeactivatePod;
import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandHandleTimeChange;
@ -75,21 +76,21 @@ import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.Comm
import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandUpdateAlertConfiguration;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.data.ActiveBolus;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.data.RLHistoryItemOmnipod;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosCommandType;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosStorageKeys;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.action.service.ExpirationReminderBuilder;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.podinfo.PodInfoRecentPulseLog;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertConfiguration;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.AlertSet;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepConfigType;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.util.TimeUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodActiveAlertsChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodFaultEventChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodPumpValuesChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodTbrChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodUncertainTbrRecovered;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosActiveAlertsChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosFaultEventChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosPumpValuesChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosTbrChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosUncertainTbrRecovered;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandGetPodStatus;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandReadPulseLog;
@ -294,22 +295,22 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
.subscribe(event -> context.unbindService(serviceConnection), fabricPrivacy::logException)
);
disposables.add(rxBus
.toObservable(EventOmnipodTbrChanged.class)
.toObservable(EventOmnipodErosTbrChanged.class)
.observeOn(aapsSchedulers.getIo())
.subscribe(event -> handleCancelledTbr(), fabricPrivacy::logException)
);
disposables.add(rxBus
.toObservable(EventOmnipodUncertainTbrRecovered.class)
.toObservable(EventOmnipodErosUncertainTbrRecovered.class)
.observeOn(aapsSchedulers.getIo())
.subscribe(event -> handleUncertainTbrRecovery(), fabricPrivacy::logException)
);
disposables.add(rxBus
.toObservable(EventOmnipodActiveAlertsChanged.class)
.toObservable(EventOmnipodErosActiveAlertsChanged.class)
.observeOn(aapsSchedulers.getIo())
.subscribe(event -> handleActivePodAlerts(), fabricPrivacy::logException)
);
disposables.add(rxBus
.toObservable(EventOmnipodFaultEventChanged.class)
.toObservable(EventOmnipodErosFaultEventChanged.class)
.observeOn(aapsSchedulers.getIo())
.subscribe(event -> handlePodFaultEvent(), fabricPrivacy::logException)
);
@ -581,13 +582,13 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
}
private PumpEnactResult getPodStatus() {
return executeCommand(OmnipodErosCommandType.GET_POD_STATUS, aapsOmnipodErosManager::getPodStatus);
return executeCommand(OmnipodCommandType.GET_POD_STATUS, aapsOmnipodErosManager::getPodStatus);
}
@NonNull
@Override
public PumpEnactResult setNewBasalProfile(Profile profile) {
PumpEnactResult result = executeCommand(OmnipodErosCommandType.SET_BASAL_PROFILE, () -> aapsOmnipodErosManager.setBasalProfile(profile, true));
PumpEnactResult result = executeCommand(OmnipodCommandType.SET_BASAL_PROFILE, () -> aapsOmnipodErosManager.setBasalProfile(profile, true));
aapsLogger.info(LTag.PUMP, "Basal Profile was set: " + result.success);
@ -659,7 +660,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@Override
public void stopBolusDelivering() {
executeCommand(OmnipodErosCommandType.CANCEL_BOLUS, aapsOmnipodErosManager::cancelBolus);
executeCommand(OmnipodCommandType.CANCEL_BOLUS, aapsOmnipodErosManager::cancelBolus);
}
// if enforceNew is true, current temp basal is cancelled and new TBR set (duration is prolonged),
@ -689,7 +690,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
}
}
PumpEnactResult result = executeCommand(OmnipodErosCommandType.SET_TEMPORARY_BASAL, () -> aapsOmnipodErosManager.setTemporaryBasal(new TempBasalPair(absoluteRate, false, durationInMinutes)));
PumpEnactResult result = executeCommand(OmnipodCommandType.SET_TEMPORARY_BASAL, () -> aapsOmnipodErosManager.setTemporaryBasal(new TempBasalPair(absoluteRate, false, durationInMinutes)));
aapsLogger.info(LTag.PUMP, "setTempBasalAbsolute - setTBR. Response: " + result.success);
@ -710,7 +711,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
return new PumpEnactResult(getInjector()).success(true).enacted(false);
}
return executeCommand(OmnipodErosCommandType.CANCEL_TEMPORARY_BASAL, aapsOmnipodErosManager::cancelTemporaryBasal);
return executeCommand(OmnipodCommandType.CANCEL_TEMPORARY_BASAL, aapsOmnipodErosManager::cancelTemporaryBasal);
}
// TODO improve (i8n and more)
@ -839,7 +840,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
@Override
public PumpEnactResult executeCustomCommand(CustomCommand command) {
if (command instanceof CommandAcknowledgeAlerts) {
return executeCommand(OmnipodErosCommandType.ACKNOWLEDGE_ALERTS, aapsOmnipodErosManager::acknowledgeAlerts);
return executeCommand(OmnipodCommandType.ACKNOWLEDGE_ALERTS, aapsOmnipodErosManager::acknowledgeAlerts);
}
if (command instanceof CommandGetPodStatus) {
return getPodStatus();
@ -848,13 +849,13 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
return retrievePulseLog();
}
if (command instanceof CommandSuspendDelivery) {
return executeCommand(OmnipodErosCommandType.SUSPEND_DELIVERY, aapsOmnipodErosManager::suspendDelivery);
return executeCommand(OmnipodCommandType.SUSPEND_DELIVERY, aapsOmnipodErosManager::suspendDelivery);
}
if (command instanceof CommandResumeDelivery) {
return executeCommand(OmnipodErosCommandType.RESUME_DELIVERY, () -> aapsOmnipodErosManager.setBasalProfile(profileFunction.getProfile(), false));
return executeCommand(OmnipodCommandType.RESUME_DELIVERY, () -> aapsOmnipodErosManager.setBasalProfile(profileFunction.getProfile(), false));
}
if (command instanceof CommandDeactivatePod) {
return executeCommand(OmnipodErosCommandType.DEACTIVATE_POD, aapsOmnipodErosManager::deactivatePod);
return executeCommand(OmnipodCommandType.DEACTIVATE_POD, aapsOmnipodErosManager::deactivatePod);
}
if (command instanceof CommandHandleTimeChange) {
return handleTimeChange(((CommandHandleTimeChange) command).isRequestedByUser());
@ -863,7 +864,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
return updateAlertConfiguration();
}
if (command instanceof CommandPlayTestBeep) {
return executeCommand(OmnipodErosCommandType.PLAY_TEST_BEEP, () -> aapsOmnipodErosManager.playTestBeep(((CommandPlayTestBeep) command).getBeepType()));
return executeCommand(OmnipodCommandType.PLAY_TEST_BEEP, () -> aapsOmnipodErosManager.playTestBeep(BeepConfigType.BEEEP));
}
aapsLogger.warn(LTag.PUMP, "Unsupported custom command: " + command.getClass().getName());
@ -873,7 +874,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
private PumpEnactResult retrievePulseLog() {
PodInfoRecentPulseLog result;
try {
result = executeCommand(OmnipodErosCommandType.READ_POD_PULSE_LOG, aapsOmnipodErosManager::readPulseLog);
result = executeCommand(OmnipodCommandType.READ_POD_PULSE_LOG, aapsOmnipodErosManager::readPulseLog);
} catch (Exception ex) {
return new PumpEnactResult(getInjector()).success(false).enacted(false).comment(aapsOmnipodErosManager.translateException(ex));
}
@ -898,7 +899,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
.lowReservoir(lowReservoirAlertUnits != null, Optional.ofNullable(lowReservoirAlertUnits).orElse(0)) //
.build();
PumpEnactResult result = executeCommand(OmnipodErosCommandType.CONFIGURE_ALERTS, () -> aapsOmnipodErosManager.configureAlerts(alertConfigurations));
PumpEnactResult result = executeCommand(OmnipodCommandType.CONFIGURE_ALERTS, () -> aapsOmnipodErosManager.configureAlerts(alertConfigurations));
if (result.success) {
aapsLogger.info(LTag.PUMP, "Successfully configured alerts in Pod");
@ -923,7 +924,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
PumpEnactResult result;
if (requestedByUser || aapsOmnipodErosManager.isTimeChangeEventEnabled()) {
result = executeCommand(OmnipodErosCommandType.SET_TIME, () -> aapsOmnipodErosManager.setTime(!requestedByUser));
result = executeCommand(OmnipodCommandType.SET_TIME, () -> aapsOmnipodErosManager.setTime(!requestedByUser));
} else {
// Even if automatically changing the time is disabled, we still want to at least do a GetStatus request,
// in order to update the Pod's activation time, which we need for calculating the time on the Pod
@ -1093,7 +1094,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
}
@NonNull private PumpEnactResult deliverBolus(final DetailedBolusInfo detailedBolusInfo) {
PumpEnactResult result = executeCommand(OmnipodErosCommandType.SET_BOLUS, () -> aapsOmnipodErosManager.bolus(detailedBolusInfo));
PumpEnactResult result = executeCommand(OmnipodCommandType.SET_BOLUS, () -> aapsOmnipodErosManager.bolus(detailedBolusInfo));
if (result.success) {
incrementStatistics(detailedBolusInfo.isSMB ? OmnipodErosStorageKeys.Statistics.SMB_BOLUSES_DELIVERED
@ -1105,7 +1106,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
return result;
}
private <T> T executeCommand(OmnipodErosCommandType commandType, Supplier<T> supplier) {
private <T> T executeCommand(OmnipodCommandType commandType, Supplier<T> supplier) {
try {
aapsLogger.debug(LTag.PUMP, "Executing command: {}", commandType);
@ -1114,7 +1115,7 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements PumpInterfa
return supplier.get();
} finally {
rxBus.send(new EventRefreshOverview("Omnipod command: " + commandType.name(), false));
rxBus.send(new EventOmnipodPumpValuesChanged());
rxBus.send(new EventOmnipodErosPumpValuesChanged());
}
}

View file

@ -3,8 +3,6 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.dagger
import dagger.Module
import dagger.Provides
import dagger.android.ContributesAndroidInjector
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.activation.PodActivationWizardActivity
import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactivation.PodDeactivationWizardActivity
import info.nightscout.androidaps.plugins.pump.omnipod.eros.data.RLHistoryItemOmnipod
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsErosPodStateManager
@ -21,14 +19,6 @@ abstract class OmnipodErosModule {
abstract fun contributesPodManagementActivity(): ErosPodManagementActivity
@ContributesAndroidInjector abstract fun contributesPodHistoryActivity(): ErosPodHistoryActivity
@ActivityScope
@ContributesAndroidInjector(modules = [OmnipodWizardModule::class])
abstract fun contributesActivationWizardActivity(): PodActivationWizardActivity
@ActivityScope
@ContributesAndroidInjector(modules = [OmnipodWizardModule::class])
abstract fun contributesDeactivationWizardActivity(): PodDeactivationWizardActivity
// Service
@ContributesAndroidInjector
abstract fun omnipodCommunicationManagerProvider(): OmnipodRileyLinkCommunicationManager

View file

@ -7,15 +7,15 @@ import javax.inject.Inject;
import dagger.android.HasAndroidInjector;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.data.RLHistoryItem;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosCommandType;
import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType;
import info.nightscout.androidaps.utils.resources.ResourceHelper;
public class RLHistoryItemOmnipod extends RLHistoryItem {
@Inject ResourceHelper resourceHelper;
private final OmnipodErosCommandType omnipodCommandType;
private final OmnipodCommandType omnipodCommandType;
public RLHistoryItemOmnipod(HasAndroidInjector injector, OmnipodErosCommandType omnipodCommandType) {
public RLHistoryItemOmnipod(HasAndroidInjector injector, OmnipodCommandType omnipodCommandType) {
super(new LocalDateTime(), RLHistoryItemSource.OmnipodCommand, RileyLinkTargetDevice.Omnipod);
injector.androidInjector().inject(this);
this.omnipodCommandType = omnipodCommandType;

View file

@ -20,7 +20,7 @@ public class OmnipodErosStorageKeys {
public static final int NOTIFICATION_UNCERTAIN_TBR_SOUND_ENABLED = R.string.key_omnipod_eros_notification_uncertain_tbr_sound_enabled;
public static final int NOTIFICATION_UNCERTAIN_SMB_SOUND_ENABLED = R.string.key_omnipod_eros_notification_uncertain_smb_sound_enabled;
public static final int NOTIFICATION_UNCERTAIN_BOLUS_SOUND_ENABLED = R.string.key_omnipod_eros_notification_uncertain_bolus_sound_enabled;
public static final int AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED = R.string.key_omnipod_common_automatically_acknowledge_alerts_enabled;
public static final int AUTOMATICALLY_ACKNOWLEDGE_ALERTS_ENABLED = R.string.key_omnipod_common_automatically_silence_alerts_enabled;
public static final int RILEY_LINK_STATS_BUTTON_ENABLED = R.string.key_omnipod_eros_riley_link_stats_button_enabled;
public static final int SHOW_RILEY_LINK_BATTERY_LEVEL = R.string.key_riley_link_show_battery_level;
public static final int BATTERY_CHANGE_LOGGING_ENABLED = R.string.key_omnipod_eros_battery_change_logging_enabled;

View file

@ -35,7 +35,7 @@ public enum PodHistoryEntryType {
CANCEL_BOLUS(41, R.string.omnipod_common_cmd_cancel_bolus, PumpHistoryEntryGroup.Bolus),
CONFIGURE_ALERTS(50, R.string.omnipod_common_cmd_configure_alerts, PumpHistoryEntryGroup.Alarm),
ACKNOWLEDGE_ALERTS(51, R.string.omnipod_common_cmd_acknowledge_alerts, PumpHistoryEntryGroup.Alarm),
ACKNOWLEDGE_ALERTS(51, R.string.omnipod_common_cmd_silence_alerts, PumpHistoryEntryGroup.Alarm),
PLAY_TEST_BEEP(52, R.string.omnipod_common_cmd_play_test_beep, PumpHistoryEntryGroup.Alarm),
SUSPEND_DELIVERY(60, R.string.omnipod_common_cmd_suspend_delivery, PumpHistoryEntryGroup.Basal),

View file

@ -5,4 +5,4 @@ import info.nightscout.androidaps.events.Event
/**
* Created by andy on 04.06.2018.
*/
class EventOmnipodPumpValuesChanged : Event()
class EventOmnipodErosActiveAlertsChanged : Event()

View file

@ -5,4 +5,4 @@ import info.nightscout.androidaps.events.Event
/**
* Created by andy on 04.06.2018.
*/
class EventOmnipodActiveAlertsChanged : Event()
class EventOmnipodErosFaultEventChanged : Event()

View file

@ -5,4 +5,4 @@ import info.nightscout.androidaps.events.Event
/**
* Created by andy on 04.06.2018.
*/
class EventOmnipodFaultEventChanged : Event()
class EventOmnipodErosPumpValuesChanged : Event()

View file

@ -5,4 +5,4 @@ import info.nightscout.androidaps.events.Event
/**
* Created by andy on 04.06.2018.
*/
class EventOmnipodTbrChanged : Event()
class EventOmnipodErosTbrChanged : Event()

View file

@ -0,0 +1,8 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.event
import info.nightscout.androidaps.events.Event
/**
* Created by andy on 04.06.2018.
*/
class EventOmnipodErosUncertainTbrRecovered : Event()

View file

@ -1,8 +0,0 @@
package info.nightscout.androidaps.plugins.pump.omnipod.eros.event
import info.nightscout.androidaps.events.Event
/**
* Created by andy on 04.06.2018.
*/
class EventOmnipodUncertainTbrRecovered : Event()

View file

@ -9,10 +9,10 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNo
import info.nightscout.androidaps.plugins.general.overview.notifications.Notification;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosStorageKeys;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodActiveAlertsChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodFaultEventChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodTbrChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodUncertainTbrRecovered;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosActiveAlertsChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosFaultEventChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosTbrChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosUncertainTbrRecovered;
import info.nightscout.androidaps.utils.sharedPreferences.SP;
@Singleton
@ -38,19 +38,19 @@ public class AapsErosPodStateManager extends PodStateManager {
}
@Override protected void onUncertainTbrRecovered() {
rxBus.send(new EventOmnipodUncertainTbrRecovered());
rxBus.send(new EventOmnipodErosUncertainTbrRecovered());
}
@Override protected void onTbrChanged() {
rxBus.send(new EventOmnipodTbrChanged());
rxBus.send(new EventOmnipodErosTbrChanged());
}
@Override protected void onActiveAlertsChanged() {
rxBus.send(new EventOmnipodActiveAlertsChanged());
rxBus.send(new EventOmnipodErosActiveAlertsChanged());
}
@Override protected void onFaultEventChanged() {
rxBus.send(new EventOmnipodFaultEventChanged());
rxBus.send(new EventOmnipodErosFaultEventChanged());
}
@Override protected void onUpdatedFromResponse() {

View file

@ -41,9 +41,9 @@ import info.nightscout.androidaps.plugins.general.overview.notifications.Notific
import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpType;
import info.nightscout.androidaps.plugins.pump.common.utils.ByteUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.data.ActiveBolus;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosCommandType;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.OmnipodErosStorageKeys;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.PodHistoryEntryType;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.communication.message.response.StatusResponse;
@ -82,7 +82,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.Ril
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.RileyLinkUnreachableException;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.OmnipodManager;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodPumpValuesChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosPumpValuesChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.OmnipodAlertUtil;
@ -366,8 +366,8 @@ public class AapsOmnipodErosManager {
createSuspendedFakeTbrIfNotExists();
dismissNotification(Notification.OMNIPOD_POD_FAULT);
sendEvent(new EventOmnipodPumpValuesChanged());
sendEvent(new EventRefreshOverview("Omnipod command: " + OmnipodErosCommandType.DISCARD_POD, false));
sendEvent(new EventOmnipodErosPumpValuesChanged());
sendEvent(new EventRefreshOverview("Omnipod command: " + OmnipodCommandType.DISCARD_POD, false));
return new PumpEnactResult(injector).success(true).enacted(true);
}
@ -434,7 +434,7 @@ public class AapsOmnipodErosManager {
// Bolus is already updated in Pod state. If this was an SMB, it could be that
// the user is looking at the Pod tab right now, so send an extra event
// (this is normally done in OmnipodPumpPlugin)
sendEvent(new EventOmnipodPumpValuesChanged());
sendEvent(new EventOmnipodErosPumpValuesChanged());
// Wait for the bolus to finish
OmnipodManager.BolusDeliveryResult bolusDeliveryResult =

View file

@ -20,9 +20,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugi
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.databinding.OmnipodPodManagementBinding
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.BeepConfigType
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodPumpValuesChanged
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosPumpValuesChanged
import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandReadPulseLog
import info.nightscout.androidaps.queue.Callback
@ -94,7 +93,7 @@ class ErosPodManagementActivity : NoSplashAppCompatActivity() {
binding.buttonPlayTestBeep.isEnabled = false
binding.buttonPlayTestBeep.setText(R.string.omnipod_common_pod_management_button_playing_test_beep)
commandQueue.customCommand(CommandPlayTestBeep(BeepConfigType.BEEEP), object : Callback() {
commandQueue.customCommand(CommandPlayTestBeep(), object : Callback() {
override fun run() {
if (!result.success) {
displayErrorDialog(resourceHelper.gs(R.string.omnipod_common_warning), resourceHelper.gs(R.string.omnipod_common_two_strings_concatenated_by_colon, resourceHelper.gs(R.string.omnipod_common_error_failed_to_play_test_beep), result.comment), false)
@ -128,7 +127,7 @@ class ErosPodManagementActivity : NoSplashAppCompatActivity() {
.observeOn(aapsSchedulers.main)
.subscribe({ refreshButtons() }, fabricPrivacy::logException)
disposables += rxBus
.toObservable(EventOmnipodPumpValuesChanged::class.java)
.toObservable(EventOmnipodErosPumpValuesChanged::class.java)
.observeOn(aapsSchedulers.main)
.subscribe({ refreshButtons() }, fabricPrivacy::logException)
disposables += rxBus

View file

@ -28,13 +28,13 @@ import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.Comm
import info.nightscout.androidaps.plugins.pump.omnipod.common.queue.command.CommandSuspendDelivery
import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin
import info.nightscout.androidaps.plugins.pump.omnipod.eros.R
import info.nightscout.androidaps.plugins.pump.omnipod.eros.databinding.OmnipodOverviewBinding
import info.nightscout.androidaps.plugins.pump.omnipod.eros.databinding.OmnipodErosOverviewBinding
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.ActivationProgress
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.PodProgressStatus
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.manager.PodStateManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.util.TimeUtil
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodPumpValuesChanged
import info.nightscout.androidaps.plugins.pump.omnipod.eros.event.EventOmnipodErosPumpValuesChanged
import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager
import info.nightscout.androidaps.plugins.pump.omnipod.eros.queue.command.CommandGetPodStatus
import info.nightscout.androidaps.plugins.pump.omnipod.eros.util.AapsOmnipodUtil
@ -93,19 +93,21 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
}
}
private var _binding: OmnipodOverviewBinding? = null
private var _binding: OmnipodErosOverviewBinding? = null
// This property is only valid between onCreateView and
// onDestroyView.
private val binding get() = _binding!!
override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View =
OmnipodOverviewBinding.inflate(inflater, container, false).also { _binding = it }.root
OmnipodErosOverviewBinding.inflate(inflater, container!!).also {
_binding = it
}.root
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
binding.buttonPodManagement.setOnClickListener {
binding.buttons.buttonPodManagement.setOnClickListener {
if (omnipodErosPumpPlugin.rileyLinkService?.verifyConfiguration() == true) {
activity?.let { activity ->
context?.let { context ->
@ -120,34 +122,34 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
}
}
binding.buttonResumeDelivery.setOnClickListener {
binding.buttons.buttonResumeDelivery.setOnClickListener {
disablePodActionButtons()
commandQueue.customCommand(CommandResumeDelivery(),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_resume_delivery), true).messageOnSuccess(resourceHelper.gs(R.string.omnipod_common_confirmation_delivery_resumed)))
}
binding.buttonRefreshStatus.setOnClickListener {
binding.buttons.buttonRefreshStatus.setOnClickListener {
disablePodActionButtons()
commandQueue.customCommand(CommandGetPodStatus(),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_refresh_status), false))
}
binding.buttonAcknowledgeActiveAlerts.setOnClickListener {
binding.buttons.buttonSilenceAlerts.setOnClickListener {
disablePodActionButtons()
commandQueue.customCommand(CommandAcknowledgeAlerts(),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_acknowledge_alerts), false)
.messageOnSuccess(resourceHelper.gs(R.string.omnipod_common_confirmation_acknowledged_alerts))
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_silence_alerts), false)
.messageOnSuccess(resourceHelper.gs(R.string.omnipod_common_confirmation_silenced_alerts))
.actionOnSuccess { rxBus.send(EventDismissNotification(Notification.OMNIPOD_POD_ALERTS)) })
}
binding.buttonSuspendDelivery.setOnClickListener {
binding.buttons.buttonSuspendDelivery.setOnClickListener {
disablePodActionButtons()
commandQueue.customCommand(CommandSuspendDelivery(),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_suspend_delivery), true)
.messageOnSuccess(resourceHelper.gs(R.string.omnipod_common_confirmation_suspended_delivery)))
}
binding.buttonSetTime.setOnClickListener {
binding.buttons.buttonSetTime.setOnClickListener {
disablePodActionButtons()
commandQueue.customCommand(CommandHandleTimeChange(true),
DisplayResultDialogCallback(resourceHelper.gs(R.string.omnipod_common_error_failed_to_set_time), true)
@ -166,7 +168,7 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
updatePodActionButtons()
}, fabricPrivacy::logException)
disposables += rxBus
.toObservable(EventOmnipodPumpValuesChanged::class.java)
.toObservable(EventOmnipodErosPumpValuesChanged::class.java)
.observeOn(aapsSchedulers.main)
.subscribe({
updateOmnipodStatus()
@ -214,7 +216,7 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
val resourceId = rileyLinkServiceState.resourceId
val rileyLinkError = rileyLinkServiceData.rileyLinkError
binding.rileyLinkStatus.text =
binding.rileyLink.rileyLinkStatus.text =
when {
rileyLinkServiceState == RileyLinkServiceState.NotStarted -> resourceHelper.gs(resourceId)
rileyLinkServiceState.isConnecting -> "{fa-bluetooth-b spin} " + resourceHelper.gs(resourceId)
@ -222,7 +224,7 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
rileyLinkServiceState.isError && rileyLinkError != null -> "{fa-bluetooth-b} " + resourceHelper.gs(rileyLinkError.getResourceId(RileyLinkTargetDevice.Omnipod))
else -> "{fa-bluetooth-b} " + resourceHelper.gs(resourceId)
}
binding.rileyLinkStatus.setTextColor(if (rileyLinkServiceState.isError || rileyLinkError != null) Color.RED else Color.WHITE)
binding.rileyLink.rileyLinkStatus.setTextColor(if (rileyLinkServiceState.isError || rileyLinkError != null) Color.RED else Color.WHITE)
}
private fun updateOmnipodStatus() {
@ -240,41 +242,41 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
}
if (!podStateManager.hasPodState() || !podStateManager.isPodInitialized) {
binding.podAddress.text = if (podStateManager.hasPodState()) {
binding.podInfo.podAddress.text = if (podStateManager.hasPodState()) {
podStateManager.address.toString()
} else {
PLACEHOLDER
}
binding.podLot.text = PLACEHOLDER
binding.podTid.text = PLACEHOLDER
binding.firmwareVersion.text = PLACEHOLDER
binding.timeOnPod.text = PLACEHOLDER
binding.podExpiryDate.text = PLACEHOLDER
binding.podExpiryDate.setTextColor(Color.WHITE)
binding.baseBasalRate.text = PLACEHOLDER
binding.totalDelivered.text = PLACEHOLDER
binding.reservoir.text = PLACEHOLDER
binding.reservoir.setTextColor(Color.WHITE)
binding.podActiveAlerts.text = PLACEHOLDER
binding.podInfo.podLot.text = PLACEHOLDER
binding.podInfo.podTid.text = PLACEHOLDER
binding.podInfo.firmwareVersion.text = PLACEHOLDER
binding.podInfo.timeOnPod.text = PLACEHOLDER
binding.podInfo.podExpiryDate.text = PLACEHOLDER
binding.podInfo.podExpiryDate.setTextColor(Color.WHITE)
binding.podInfo.baseBasalRate.text = PLACEHOLDER
binding.podInfo.totalDelivered.text = PLACEHOLDER
binding.podInfo.reservoir.text = PLACEHOLDER
binding.podInfo.reservoir.setTextColor(Color.WHITE)
binding.podInfo.podActiveAlerts.text = PLACEHOLDER
} else {
binding.podAddress.text = podStateManager.address.toString()
binding.podLot.text = podStateManager.lot.toString()
binding.podTid.text = podStateManager.tid.toString()
binding.firmwareVersion.text = resourceHelper.gs(R.string.omnipod_eros_overview_firmware_version_value, podStateManager.pmVersion.toString(), podStateManager.piVersion.toString())
binding.podInfo.podAddress.text = podStateManager.address.toString()
binding.podInfo.podLot.text = podStateManager.lot.toString()
binding.podInfo.podTid.text = podStateManager.tid.toString()
binding.podInfo.firmwareVersion.text = resourceHelper.gs(R.string.omnipod_eros_overview_firmware_version_value, podStateManager.pmVersion.toString(), podStateManager.piVersion.toString())
binding.timeOnPod.text = readableZonedTime(podStateManager.time)
binding.timeOnPod.setTextColor(if (podStateManager.timeDeviatesMoreThan(OmnipodConstants.TIME_DEVIATION_THRESHOLD)) {
binding.podInfo.timeOnPod.text = readableZonedTime(podStateManager.time)
binding.podInfo.timeOnPod.setTextColor(if (podStateManager.timeDeviatesMoreThan(OmnipodConstants.TIME_DEVIATION_THRESHOLD)) {
Color.RED
} else {
Color.WHITE
})
val expiresAt = podStateManager.expiresAt
if (expiresAt == null) {
binding.podExpiryDate.text = PLACEHOLDER
binding.podExpiryDate.setTextColor(Color.WHITE)
binding.podInfo.podExpiryDate.text = PLACEHOLDER
binding.podInfo.podExpiryDate.setTextColor(Color.WHITE)
} else {
binding.podExpiryDate.text = readableZonedTime(expiresAt)
binding.podExpiryDate.setTextColor(if (DateTime.now().isAfter(expiresAt)) {
binding.podInfo.podExpiryDate.text = readableZonedTime(expiresAt)
binding.podInfo.podExpiryDate.setTextColor(if (DateTime.now().isAfter(expiresAt)) {
Color.RED
} else {
Color.WHITE
@ -287,14 +289,14 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
}
// base basal rate
binding.baseBasalRate.text = if (podStateManager.isPodActivationCompleted) {
binding.podInfo.baseBasalRate.text = if (podStateManager.isPodActivationCompleted) {
resourceHelper.gs(R.string.pump_basebasalrate, omnipodErosPumpPlugin.model().determineCorrectBasalSize(podStateManager.basalSchedule.rateAt(TimeUtil.toDuration(DateTime.now()))))
} else {
PLACEHOLDER
}
// total delivered
binding.totalDelivered.text = if (podStateManager.isPodActivationCompleted && podStateManager.totalInsulinDelivered != null) {
binding.podInfo.totalDelivered.text = if (podStateManager.isPodActivationCompleted && podStateManager.totalInsulinDelivered != null) {
resourceHelper.gs(R.string.omnipod_common_overview_total_delivered_value, podStateManager.totalInsulinDelivered - OmnipodConstants.POD_SETUP_UNITS)
} else {
PLACEHOLDER
@ -302,21 +304,21 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
// reservoir
if (podStateManager.reservoirLevel == null) {
binding.reservoir.text = resourceHelper.gs(R.string.omnipod_common_overview_reservoir_value_over50)
binding.reservoir.setTextColor(Color.WHITE)
binding.podInfo.reservoir.text = resourceHelper.gs(R.string.omnipod_common_overview_reservoir_value_over50)
binding.podInfo.reservoir.setTextColor(Color.WHITE)
} else {
val lowReservoirThreshold = (omnipodAlertUtil.lowReservoirAlertUnits
?: OmnipodConstants.DEFAULT_MAX_RESERVOIR_ALERT_THRESHOLD).toDouble()
binding.reservoir.text = resourceHelper.gs(R.string.omnipod_common_overview_reservoir_value, podStateManager.reservoirLevel)
binding.reservoir.setTextColor(if (podStateManager.reservoirLevel < lowReservoirThreshold) {
binding.podInfo.reservoir.text = resourceHelper.gs(R.string.omnipod_common_overview_reservoir_value, podStateManager.reservoirLevel)
binding.podInfo.reservoir.setTextColor(if (podStateManager.reservoirLevel < lowReservoirThreshold) {
Color.RED
} else {
Color.WHITE
})
}
binding.podActiveAlerts.text = if (podStateManager.hasActiveAlerts()) {
binding.podInfo.podActiveAlerts.text = if (podStateManager.hasActiveAlerts()) {
TextUtils.join(System.lineSeparator(), omnipodUtil.getTranslatedActiveAlerts(podStateManager))
} else {
PLACEHOLDER
@ -324,27 +326,27 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
}
if (errors.size == 0) {
binding.errors.text = PLACEHOLDER
binding.errors.setTextColor(Color.WHITE)
binding.podInfo.errors.text = PLACEHOLDER
binding.podInfo.errors.setTextColor(Color.WHITE)
} else {
binding.errors.text = StringUtils.join(errors, System.lineSeparator())
binding.errors.setTextColor(Color.RED)
binding.podInfo.errors.text = StringUtils.join(errors, System.lineSeparator())
binding.podInfo.errors.setTextColor(Color.RED)
}
}
private fun updateLastConnection() {
if (podStateManager.isPodInitialized && podStateManager.lastSuccessfulCommunication != null) {
binding.lastConnection.text = readableDuration(podStateManager.lastSuccessfulCommunication)
binding.podInfo.lastConnection.text = readableDuration(podStateManager.lastSuccessfulCommunication)
val lastConnectionColor =
if (omnipodErosPumpPlugin.isUnreachableAlertTimeoutExceeded(getPumpUnreachableTimeout().millis)) {
Color.RED
} else {
Color.WHITE
}
binding.lastConnection.setTextColor(lastConnectionColor)
binding.podInfo.lastConnection.setTextColor(lastConnectionColor)
} else {
binding.lastConnection.setTextColor(Color.WHITE)
binding.lastConnection.text = if (podStateManager.hasPodState() && podStateManager.lastSuccessfulCommunication != null) {
binding.podInfo.lastConnection.setTextColor(Color.WHITE)
binding.podInfo.lastConnection.text = if (podStateManager.hasPodState() && podStateManager.lastSuccessfulCommunication != null) {
readableDuration(podStateManager.lastSuccessfulCommunication)
} else {
PLACEHOLDER
@ -353,7 +355,7 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
}
private fun updatePodStatus() {
binding.podStatus.text = if (!podStateManager.hasPodState()) {
binding.podInfo.podStatus.text = if (!podStateManager.hasPodState()) {
resourceHelper.gs(R.string.omnipod_common_pod_status_no_active_pod)
} else if (!podStateManager.isPodActivationCompleted) {
if (!podStateManager.isPodInitialized) {
@ -392,7 +394,7 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
} else {
Color.WHITE
}
binding.podStatus.setTextColor(podStatusColor)
binding.podInfo.podStatus.setTextColor(podStatusColor)
}
private fun updateLastBolus() {
@ -407,20 +409,20 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
text += " (" + resourceHelper.gs(R.string.omnipod_eros_uncertain) + ")"
}
binding.lastBolus.text = text
binding.lastBolus.setTextColor(textColor)
binding.podInfo.lastBolus.text = text
binding.podInfo.lastBolus.setTextColor(textColor)
} else {
binding.lastBolus.text = PLACEHOLDER
binding.lastBolus.setTextColor(Color.WHITE)
binding.podInfo.lastBolus.text = PLACEHOLDER
binding.podInfo.lastBolus.setTextColor(Color.WHITE)
}
}
private fun updateTempBasal() {
if (podStateManager.isPodActivationCompleted && podStateManager.isTempBasalRunning) {
if (!podStateManager.hasTempBasal()) {
binding.tempBasal.text = "???"
binding.tempBasal.setTextColor(Color.RED)
binding.podInfo.tempBasal.text = "???"
binding.podInfo.tempBasal.setTextColor(Color.RED)
} else {
val now = DateTime.now()
@ -440,8 +442,8 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
text += " (" + resourceHelper.gs(R.string.omnipod_eros_uncertain) + ")"
}
binding.tempBasal.text = text
binding.tempBasal.setTextColor(textColor)
binding.podInfo.tempBasal.text = text
binding.podInfo.tempBasal.setTextColor(textColor)
}
} else {
var text = PLACEHOLDER
@ -454,75 +456,75 @@ class OmnipodErosOverviewFragment : DaggerFragment() {
text += " (" + resourceHelper.gs(R.string.omnipod_eros_uncertain) + ")"
}
binding.tempBasal.text = text
binding.tempBasal.setTextColor(textColor)
binding.podInfo.tempBasal.text = text
binding.podInfo.tempBasal.setTextColor(textColor)
}
}
private fun updateQueueStatus() {
if (isQueueEmpty()) {
binding.queue.visibility = View.GONE
binding.podInfo.queue.visibility = View.GONE
} else {
binding.queue.visibility = View.VISIBLE
binding.queue.text = commandQueue.spannedStatus().toString()
binding.podInfo.queue.visibility = View.VISIBLE
binding.podInfo.queue.text = commandQueue.spannedStatus().toString()
}
}
private fun updatePodActionButtons() {
updateRefreshStatusButton()
updateResumeDeliveryButton()
updateAcknowledgeAlertsButton()
updateSilenceAlertsButton()
updateSuspendDeliveryButton()
updateSetTimeButton()
}
private fun disablePodActionButtons() {
binding.buttonAcknowledgeActiveAlerts.isEnabled = false
binding.buttonResumeDelivery.isEnabled = false
binding.buttonSuspendDelivery.isEnabled = false
binding.buttonSetTime.isEnabled = false
binding.buttonRefreshStatus.isEnabled = false
binding.buttons.buttonSilenceAlerts.isEnabled = false
binding.buttons.buttonResumeDelivery.isEnabled = false
binding.buttons.buttonSuspendDelivery.isEnabled = false
binding.buttons.buttonSetTime.isEnabled = false
binding.buttons.buttonRefreshStatus.isEnabled = false
}
private fun updateRefreshStatusButton() {
binding.buttonRefreshStatus.isEnabled = podStateManager.isPodInitialized && podStateManager.activationProgress.isAtLeast(ActivationProgress.PAIRING_COMPLETED)
binding.buttons.buttonRefreshStatus.isEnabled = podStateManager.isPodInitialized && podStateManager.activationProgress.isAtLeast(ActivationProgress.PAIRING_COMPLETED)
&& rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
}
private fun updateResumeDeliveryButton() {
if (podStateManager.isPodRunning && (podStateManager.isSuspended || commandQueue.isCustomCommandInQueue(CommandResumeDelivery::class.java))) {
binding.buttonResumeDelivery.visibility = View.VISIBLE
binding.buttonResumeDelivery.isEnabled = rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
binding.buttons.buttonResumeDelivery.visibility = View.VISIBLE
binding.buttons.buttonResumeDelivery.isEnabled = rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
} else {
binding.buttonResumeDelivery.visibility = View.GONE
binding.buttons.buttonResumeDelivery.visibility = View.GONE
}
}
private fun updateAcknowledgeAlertsButton() {
private fun updateSilenceAlertsButton() {
if (!omnipodManager.isAutomaticallyAcknowledgeAlertsEnabled && podStateManager.isPodRunning && (podStateManager.hasActiveAlerts() || commandQueue.isCustomCommandInQueue(CommandAcknowledgeAlerts::class.java))) {
binding.buttonAcknowledgeActiveAlerts.visibility = View.VISIBLE
binding.buttonAcknowledgeActiveAlerts.isEnabled = rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
binding.buttons.buttonSilenceAlerts.visibility = View.VISIBLE
binding.buttons.buttonSilenceAlerts.isEnabled = rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
} else {
binding.buttonAcknowledgeActiveAlerts.visibility = View.GONE
binding.buttons.buttonSilenceAlerts.visibility = View.GONE
}
}
private fun updateSuspendDeliveryButton() {
// If the Pod is currently suspended, we show the Resume delivery button instead.
if (omnipodManager.isSuspendDeliveryButtonEnabled && podStateManager.isPodRunning && (!podStateManager.isSuspended || commandQueue.isCustomCommandInQueue(CommandSuspendDelivery::class.java))) {
binding.buttonSuspendDelivery.visibility = View.VISIBLE
binding.buttonSuspendDelivery.isEnabled = podStateManager.isPodRunning && !podStateManager.isSuspended && rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
binding.buttons.buttonSuspendDelivery.visibility = View.VISIBLE
binding.buttons.buttonSuspendDelivery.isEnabled = podStateManager.isPodRunning && !podStateManager.isSuspended && rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
} else {
binding.buttonSuspendDelivery.visibility = View.GONE
binding.buttons.buttonSuspendDelivery.visibility = View.GONE
}
}
private fun updateSetTimeButton() {
if (podStateManager.isPodRunning && (podStateManager.timeDeviatesMoreThan(Duration.standardMinutes(5)) || commandQueue.isCustomCommandInQueue(CommandHandleTimeChange::class.java))) {
binding.buttonSetTime.visibility = View.VISIBLE
binding.buttonSetTime.isEnabled = !podStateManager.isSuspended && rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
binding.buttons.buttonSetTime.visibility = View.VISIBLE
binding.buttons.buttonSetTime.isEnabled = !podStateManager.isSuspended && rileyLinkServiceData.rileyLinkServiceState.isReady && isQueueEmpty()
} else {
binding.buttonSetTime.visibility = View.GONE
binding.buttons.buttonSetTime.visibility = View.GONE
}
}

View file

@ -0,0 +1,52 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".ui.OmnipodErosOverviewFragment">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/buttons_layout"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<View
android:layout_width="fill_parent"
android:layout_height="2dip"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:layout_marginRight="20dp"
android:layout_marginBottom="5dp"
android:background="@color/list_delimiter" />
<include
android:id="@+id/riley_link"
layout="@layout/omnipod_eros_overview_riley_link_status" />
<include
android:id="@+id/pod_info"
layout="@layout/omnipod_common_overview_pod_info" />
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/buttons_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal">
<include
android:id="@+id/buttons"
layout="@layout/omnipod_common_overview_buttons" />
</LinearLayout>
</merge>

View file

@ -0,0 +1,53 @@
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:orientation="horizontal">
<TextView
android:gravity="end"
android:layout_height="wrap_content"
android:layout_weight="1.5"
android:layout_width="match_parent"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="@string/rileylink_status"
android:textSize="14sp" />
<TextView
android:gravity="center_horizontal"
android:layout_height="wrap_content"
android:layout_weight="0"
android:layout_width="5dp"
android:paddingEnd="2dp"
android:paddingStart="2dp"
android:text=":"
android:textSize="14sp"
tools:ignore="HardcodedText" />
<com.joanzapata.iconify.widget.IconTextView
android:gravity="start"
android:id="@+id/riley_link_status"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_width="match_parent"
android:paddingEnd="5dp"
android:paddingStart="5dp"
android:text="{fa-bluetooth-b}"
android:textColor="@android:color/white"
android:textSize="14sp"
tools:ignore="HardcodedText" />
</LinearLayout>
<View
android:background="@color/list_delimiter"
android:layout_height="2dip"
android:layout_marginBottom="5dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="5dp"
android:layout_width="fill_parent" />
</merge>

View file

@ -85,8 +85,8 @@
<SwitchPreference
android:defaultValue="false"
android:key="@string/key_omnipod_common_automatically_acknowledge_alerts_enabled"
android:title="@string/omnipod_common_preferences_automatically_acknowledge_alerts" />
android:key="@string/key_omnipod_common_automatically_silence_alerts_enabled"
android:title="@string/omnipod_common_preferences_automatically_silence_alerts" />
</PreferenceCategory>