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) {
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))
}
}

View file

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

View file

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

View file

@ -1,19 +1,26 @@
<?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"
android:id="@+id/omnipod_pod_management"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.PodManagementActivity">
<TextView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/omnipod_pod_management_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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"
@ -49,76 +56,113 @@
<TextView
android:layout_width="match_parent"
android:layout_height="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" />
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/Actions_Row_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
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"
android:paddingStart="10dp"
android:paddingEnd="10dp">
app:layout_constraintGuide_percent="0" />
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/button_activate_pod"
style="?android:attr/buttonStyle"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_marginEnd="4dp"
android:layout_weight="0.5"
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: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="match_parent"
android:layout_height="fill_parent"
android:layout_marginEnd="4dp"
android:layout_weight="0.5"
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" />
</LinearLayout>
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" />
<LinearLayout
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/Actions_Row_2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingStart="10dp"
android:paddingEnd="10dp">
android:layout_height="wrap_content">
<Button
<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="match_parent"
android:layout_height="fill_parent"
android:layout_marginEnd="4dp"
android:layout_weight="0.5"
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: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="match_parent"
android:layout_height="fill_parent"
android:layout_marginEnd="4dp"
android:layout_weight="0.5"
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" />
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>
</LinearLayout>
<TextView
android:layout_width="match_parent"
@ -128,68 +172,104 @@
android:paddingEnd="15dp"
android:text="@string/omnipod_pod_management_heading_tools" />
<LinearLayout
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/Tools_Row_1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/Tools_Row_1_horizontal_guideline"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingStart="10dp"
android:paddingEnd="10dp">
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/button_pod_history"
style="?android:attr/buttonStyle"
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
android:id="@+id/button_rileylink_stats"
style="?android:attr/buttonStyle"
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_rl_stats"
android:text="@string/omnipod_pod_management_button_riley_link_stats"
android:textAllCaps="false"
android:visibility="gone" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingStart="10dp"
android:paddingEnd="10dp">
<Button
android:id="@+id/button_pulse_log"
style="?android:attr/buttonStyle"
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_pulse_log"
android:text="@string/omnipod_pod_management_button_read_pulse_log"
android:textAllCaps="false"
android:visibility="gone" />
app:layout_constraintGuide_percent="0" />
<info.nightscout.androidaps.utils.ui.SingleClickButton
android:id="@+id/button_reset_rileylink_config"
style="?android:attr/buttonStyle"
android:layout_width="match_parent"
android:layout_height="fill_parent"
android:layout_marginEnd="4dp"
android:layout_weight="0.5"
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: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" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/Tools_Col_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_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" />
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/Tools_Row_2"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/Tools_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_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" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/Tools_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_pulse_log"
style="?android:attr/buttonStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:drawableTop="@drawable/ic_pod_management_pulse_log"
android:text="@string/omnipod_pod_management_button_read_pulse_log"
android:textAllCaps="false"
android:visibility="gone"
app:layout_constrainedHeight="@+id/Tools_Row_2_horizontal_guideline"
app:layout_constraintLeft_toRightOf="@+id/Tools_Col_1_Row_2_vertical_guideline"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>
</ScrollView>