This commit is contained in:
Milos Kozak 2021-02-21 11:52:34 +01:00
commit ae9c7b4329
4 changed files with 250 additions and 169 deletions

View file

@ -290,7 +290,7 @@ class ProfileHelperActivity : NoSplashAppCompatActivity() {
} }
private fun setBackgroundColorOnSelected(tab: Int) { private fun setBackgroundColorOnSelected(tab: Int) {
binding.menu1.setBackgroundColor(resourceHelper.gc(if (tab == 1) R.color.defaultbackground else R.color.tabBgColorSelected)) binding.menu1.setBackgroundColor(resourceHelper.gc(if (tab == 1) R.color.defaultbackground else R.color.tempbasal))
binding.menu2.setBackgroundColor(resourceHelper.gc(if (tab == 0) R.color.defaultbackground else R.color.examinedProfile)) binding.menu2.setBackgroundColor(resourceHelper.gc(if (tab == 0) R.color.defaultbackground else R.color.examinedProfile))
} }
} }

View file

@ -82,6 +82,7 @@ class LocalProfileFragment : DaggerFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
// activate DIA tab // activate DIA tab
processVisibilityOnClick(binding.diaTab)
binding.diaPlaceholder.visibility = View.VISIBLE binding.diaPlaceholder.visibility = View.VISIBLE
// setup listeners // setup listeners
binding.diaTab.setOnClickListener { binding.diaTab.setOnClickListener {

View file

@ -10,7 +10,7 @@
<color name="devslopepos">#FFFFFF00</color> <color name="devslopepos">#FFFFFF00</color>
<color name="devslopeneg">#FFFF00FF</color> <color name="devslopeneg">#FFFF00FF</color>
<color name="actionsConfirm">#FFFF00</color> <color name="actionsConfirm">#FFFF00</color>
<color name="tabBgColorSelected">#FF33B5E5</color> <color name="tabBgColorSelected">#FF666666</color>
<color name="deviations">#FF0000</color> <color name="deviations">#FF0000</color>
<color name="cobAlert">#7484E2</color> <color name="cobAlert">#7484E2</color>
<color name="inrangebackground">#2800FF00</color> <color name="inrangebackground">#2800FF00</color>

View file

@ -1,195 +1,275 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView 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" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/omnipod_pod_management" android:id="@+id/omnipod_pod_management"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
tools:context=".ui.PodManagementActivity"> tools:context=".ui.PodManagementActivity">
<TextView <LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:layout_marginRight="10dp"
android:layout_weight="0.5"
android:gravity="center"
android:text="@string/omnipod_pod_management_title"
android:textAlignment="center"
android:textSize="12pt"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/waiting_for_rl_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:visibility="gone">
<ProgressBar
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="40dp" android:layout_height="wrap_content"
android:layout_marginLeft="25dp" android:orientation="vertical">
android:layout_marginTop="20dp"
android:layout_marginRight="25dp" />
<TextView <TextView
android:layout_width="match_parent" android:id="@+id/omnipod_pod_management_title"
android:layout_height="0dp" android:layout_width="match_parent"
android:layout_marginLeft="10dp" android:layout_height="wrap_content"
android:layout_marginTop="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="10dp" android:layout_marginTop="20dp"
android:layout_weight="0.5" android:layout_marginRight="10dp"
android:gravity="center"
android:text="@string/omnipod_pod_management_waiting_for_rileylink_connection"
android:textAlignment="center"
android:textSize="8pt" />
</LinearLayout>
<TextView android:gravity="center"
android:layout_width="match_parent" android:text="@string/omnipod_pod_management_title"
android:layout_height="match_parent" android:textAlignment="center"
android:layout_marginTop="15dp" android:textSize="12pt"
android:paddingStart="15dp" android:textStyle="bold" />
android:paddingEnd="15dp"
android:text="@string/omnipod_pod_management_heading_actions" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:id="@+id/waiting_for_rl_layout"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:orientation="horizontal" android:layout_height="wrap_content"
android:paddingStart="10dp" android:orientation="vertical"
android:paddingEnd="10dp"> android:visibility="gone">
<info.nightscout.androidaps.utils.ui.SingleClickButton <ProgressBar
android:id="@+id/button_activate_pod" android:layout_width="match_parent"
style="?android:attr/buttonStyle" android:layout_height="40dp"
android:layout_width="match_parent" android:layout_marginLeft="25dp"
android:layout_height="fill_parent" android:layout_marginTop="20dp"
android:layout_marginEnd="4dp" android:layout_marginRight="25dp" />
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_activate_pod" <TextView
android:text="@string/omnipod_pod_management_button_activate_pod" android:layout_width="match_parent"
android:textAllCaps="false" /> android:layout_height="0dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginRight="10dp"
android:layout_weight="0.5"
android:gravity="center"
android:text="@string/omnipod_pod_management_waiting_for_rileylink_connection"
android:textAlignment="center"
android:textSize="8pt" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:text="@string/omnipod_pod_management_heading_actions" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/Actions_Row_1"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/Actions_Row_1_horizontal_guideline"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0" />
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/button_activate_pod"
style="?android:attr/buttonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_pod_management_activate_pod"
android:text="@string/omnipod_pod_management_button_activate_pod"
android:textAllCaps="false"
android:visibility="visible"
app:layout_constrainedHeight="@+id/Actions_Row_1_horizontal_guideline"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/Actions_Col_1_Row_1_vertical_guideline"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/Actions_Col_1_Row_1_vertical_guideline"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/button_deactivate_pod"
style="?android:attr/buttonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_pod_management_deactivate_pod"
android:text="@string/omnipod_pod_management_button_deactivate_pod"
android:textAllCaps="false"
android:visibility="visible"
app:layout_constrainedHeight="@+id/Actions_Row_1_horizontal_guideline"
app:layout_constraintLeft_toRightOf="@+id/Actions_Col_1_Row_1_vertical_guideline"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/Actions_Row_2"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/Actions_Row_2_horizontal_guideline"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0" />
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/button_play_test_beep"
style="?android:attr/buttonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_pod_management_play_test_beep"
android:text="@string/omnipod_pod_management_button_play_test_beep"
android:textAllCaps="false"
android:visibility="visible"
app:layout_constrainedHeight="@+id/Actions_Row_2_horizontal_guideline"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/Actions_Col_1_Row_2_vertical_guideline"
app:layout_constraintTop_toTopOf="parent" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/Actions_Col_1_Row_2_vertical_guideline"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_constraintGuide_percent="0.5" />
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/button_discard_pod"
style="?android:attr/buttonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_pod_management_discard_pod"
android:text="@string/omnipod_pod_management_button_discard_pod"
android:textAllCaps="false"
android:visibility="gone"
app:layout_constrainedHeight="@+id/Actions_Row_2_horizontal_guideline"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintLeft_toRightOf="@+id/Actions_Col_1_Row_2_vertical_guideline"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
<info.nightscout.androidaps.utils.ui.SingleClickButton <TextView
android:id="@+id/button_deactivate_pod" android:layout_width="match_parent"
style="?android:attr/buttonStyle" android:layout_height="match_parent"
android:layout_width="match_parent" android:layout_marginTop="15dp"
android:layout_height="fill_parent" android:paddingStart="15dp"
android:layout_marginEnd="4dp" android:paddingEnd="15dp"
android:layout_weight="0.5" android:text="@string/omnipod_pod_management_heading_tools" />
android:drawableTop="@drawable/ic_pod_management_deactivate_pod"
android:text="@string/omnipod_pod_management_button_deactivate_pod"
android:textAllCaps="false" />
</LinearLayout>
<LinearLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:id="@+id/Tools_Row_1"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:orientation="horizontal" android:layout_height="wrap_content">
android:paddingStart="10dp"
android:paddingEnd="10dp">
<Button <androidx.constraintlayout.widget.Guideline
android:id="@+id/button_play_test_beep" android:id="@+id/Tools_Row_1_horizontal_guideline"
style="?android:attr/buttonStyle" android:layout_width="wrap_content"
android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_height="fill_parent" android:orientation="horizontal"
android:layout_marginEnd="4dp" app:layout_constraintGuide_percent="0" />
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_play_test_beep"
android:text="@string/omnipod_pod_management_button_play_test_beep"
android:textAllCaps="false" />
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/button_reset_rileylink_config"
style="?android:attr/buttonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_pod_activity_reset_rileylink_config"
android:text="@string/omnipod_pod_management_button_reset_riley_link_config"
android:textAllCaps="false"
android:visibility="visible"
app:layout_constrainedHeight="@+id/Tools_Row_1_horizontal_guideline"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/Tools_Col_1_vertical_guideline"
app:layout_constraintTop_toTopOf="parent" />
<info.nightscout.androidaps.utils.ui.SingleClickButton <androidx.constraintlayout.widget.Guideline
android:id="@+id/button_discard_pod" android:id="@+id/Tools_Col_1_vertical_guideline"
style="?android:attr/buttonStyle" android:layout_width="wrap_content"
android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_height="fill_parent" android:orientation="vertical"
android:layout_marginEnd="4dp" app:layout_constraintGuide_percent="0.5" />
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_discard_pod"
android:text="@string/omnipod_pod_management_button_discard_pod"
android:textAllCaps="false"
android:visibility="gone" />
</LinearLayout> <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/button_pod_history"
style="?android:attr/buttonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_pod_management_pod_history"
android:text="@string/omnipod_pod_management_button_pod_history"
android:textAllCaps="false"
android:visibility="visible"
app:layout_constrainedHeight="@+id/Tools_Row_1_horizontal_guideline"
app:layout_constraintLeft_toRightOf="@+id/Tools_Col_1_vertical_guideline"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView </androidx.constraintlayout.widget.ConstraintLayout>
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="15dp"
android:paddingStart="15dp"
android:paddingEnd="15dp"
android:text="@string/omnipod_pod_management_heading_tools" />
<LinearLayout <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingStart="10dp"
android:paddingEnd="10dp">
<info.nightscout.androidaps.utils.ui.SingleClickButton android:id="@+id/Tools_Row_2"
android:id="@+id/button_pod_history" android:layout_width="match_parent"
style="?android:attr/buttonStyle" android:layout_height="wrap_content">
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_marginEnd="4dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_pod_history"
android:text="@string/omnipod_pod_management_button_pod_history"
android:textAllCaps="false" />
<info.nightscout.androidaps.utils.ui.SingleClickButton <androidx.constraintlayout.widget.Guideline
android:id="@+id/button_rileylink_stats" android:id="@+id/Tools_Row_2_horizontal_guideline"
style="?android:attr/buttonStyle" android:layout_width="wrap_content"
android:layout_width="match_parent" android:layout_height="match_parent"
android:layout_height="fill_parent" android:orientation="horizontal"
android:layout_marginEnd="4dp" app:layout_constraintGuide_percent="0" />
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_management_rl_stats"
android:text="@string/omnipod_pod_management_button_riley_link_stats"
android:textAllCaps="false"
android:visibility="gone" />
</LinearLayout> <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/button_rileylink_stats"
style="?android:attr/buttonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_pod_management_rl_stats"
android:text="@string/omnipod_pod_management_button_riley_link_stats"
android:textAllCaps="false"
android:visibility="visible"
app:layout_constrainedHeight="@+id/Tools_Row_2_horizontal_guideline"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/Tools_Col_1_Row_2_vertical_guideline"
app:layout_constraintTop_toTopOf="parent" />
<LinearLayout <androidx.constraintlayout.widget.Guideline
android:layout_width="match_parent" android:id="@+id/Tools_Col_1_Row_2_vertical_guideline"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:orientation="horizontal" android:layout_height="match_parent"
android:paddingStart="10dp" android:orientation="vertical"
android:paddingEnd="10dp"> app:layout_constraintGuide_percent="0.5" />
<Button <info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/button_pulse_log" android:id="@+id/button_pulse_log"
style="?android:attr/buttonStyle" style="?android:attr/buttonStyle"
android:layout_width="match_parent" android:layout_width="0dp"
android:layout_height="fill_parent" android:layout_height="wrap_content"
android:layout_marginEnd="4dp" android:drawableTop="@drawable/ic_pod_management_pulse_log"
android:layout_weight="0.5" android:text="@string/omnipod_pod_management_button_read_pulse_log"
android:drawableTop="@drawable/ic_pod_management_pulse_log" android:textAllCaps="false"
android:text="@string/omnipod_pod_management_button_read_pulse_log" android:visibility="gone"
android:textAllCaps="false" app:layout_constrainedHeight="@+id/Tools_Row_2_horizontal_guideline"
android:visibility="gone" /> app:layout_constraintLeft_toRightOf="@+id/Tools_Col_1_Row_2_vertical_guideline"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<info.nightscout.androidaps.utils.ui.SingleClickButton </androidx.constraintlayout.widget.ConstraintLayout>
android:id="@+id/button_reset_rileylink_config" </LinearLayout>
style="?android:attr/buttonStyle" </ScrollView>
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_marginEnd="4dp"
android:layout_weight="0.5"
android:drawableTop="@drawable/ic_pod_activity_reset_rileylink_config"
android:text="@string/omnipod_pod_management_button_reset_riley_link_config"
android:textAllCaps="false" />
</LinearLayout>
</LinearLayout>