From 47725ad5d56f66a446eb3d4512483289ee251b9a Mon Sep 17 00:00:00 2001 From: Philoul Date: Thu, 14 May 2020 12:42:33 +0200 Subject: [PATCH 1/2] Sensitivity Icon (50% alpha if autosens disable) --- .../androidaps/plugins/general/overview/OverviewFragment.kt | 4 ++++ app/src/main/res/layout/overview_info_layout.xml | 1 + 2 files changed, 5 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt index 227f426da9..b3703d2557 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt @@ -757,6 +757,10 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList overview_uploader?.setOnClickListener { activity?.let { OKDialog.show(it, resourceHelper.gs(R.string.uploader), nsDeviceStatus.extendedUploaderStatus) } } // Sensitivity + if(sp.getBoolean(R.string.key_openapsama_useautosens, false)) + overview_sensitivity_icon?.alpha=1F + else + overview_sensitivity_icon?.alpha=0.5F overview_sensitivity?.text = iobCobCalculatorPlugin.getLastAutosensData("Overview")?.let { autosensData -> String.format(Locale.ENGLISH, "%.0f%%", autosensData.autosensResult.ratio * 100) diff --git a/app/src/main/res/layout/overview_info_layout.xml b/app/src/main/res/layout/overview_info_layout.xml index 9f2cdd8c2f..1a2142dbbe 100644 --- a/app/src/main/res/layout/overview_info_layout.xml +++ b/app/src/main/res/layout/overview_info_layout.xml @@ -222,6 +222,7 @@ app:layout_constraintTop_toBottomOf="@+id/overview_bg"> Date: Thu, 14 May 2020 14:39:27 +0200 Subject: [PATCH 2/2] Sensitivity Icon end proposal with a new icon Svg file added in icons folder --- .../plugins/general/overview/OverviewFragment.kt | 10 ++++++---- .../main/res/drawable/ic_x_swap_vert_48px_green.xml | 10 ++++++++++ icons/x_swap_vert.svg | 12 ++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/ic_x_swap_vert_48px_green.xml create mode 100644 icons/x_swap_vert.svg diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt index b3703d2557..0b4f66be01 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt @@ -757,10 +757,12 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList overview_uploader?.setOnClickListener { activity?.let { OKDialog.show(it, resourceHelper.gs(R.string.uploader), nsDeviceStatus.extendedUploaderStatus) } } // Sensitivity - if(sp.getBoolean(R.string.key_openapsama_useautosens, false)) - overview_sensitivity_icon?.alpha=1F - else - overview_sensitivity_icon?.alpha=0.5F + if (sp.getBoolean(R.string.key_openapsama_useautosens, false)) { + overview_sensitivity_icon.setImageResource(R.drawable.ic_swap_vert_black_48dp_green) + }else { + overview_sensitivity_icon.setImageResource(R.drawable.ic_x_swap_vert_48px_green) + } + overview_sensitivity?.text = iobCobCalculatorPlugin.getLastAutosensData("Overview")?.let { autosensData -> String.format(Locale.ENGLISH, "%.0f%%", autosensData.autosensResult.ratio * 100) diff --git a/app/src/main/res/drawable/ic_x_swap_vert_48px_green.xml b/app/src/main/res/drawable/ic_x_swap_vert_48px_green.xml new file mode 100644 index 0000000000..b094d56057 --- /dev/null +++ b/app/src/main/res/drawable/ic_x_swap_vert_48px_green.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/icons/x_swap_vert.svg b/icons/x_swap_vert.svg new file mode 100644 index 0000000000..a09d1324a4 --- /dev/null +++ b/icons/x_swap_vert.svg @@ -0,0 +1,12 @@ + + + + + + + + +