From e363ac2c6a0706984ce4f8a9e05913bd6479e9d7 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 25 Oct 2023 10:07:14 +0200 Subject: [PATCH] fix showing EB tab in treatments --- .../app/aaps/core/interfaces/pump/defs/PumpDescription.kt | 2 +- .../main/kotlin/app/aaps/ui/activities/TreatmentsActivity.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/defs/PumpDescription.kt b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/defs/PumpDescription.kt index 6d65db1233..9f5a406abc 100644 --- a/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/defs/PumpDescription.kt +++ b/core/interfaces/src/main/kotlin/app/aaps/core/interfaces/pump/defs/PumpDescription.kt @@ -9,7 +9,7 @@ class PumpDescription() { var pumpType = PumpType.GENERIC_AAPS var isBolusCapable = false var bolusStep = 0.0 - var isExtendedBolusCapable = false + var isExtendedBolusCapable = true var extendedBolusStep = 0.0 var extendedBolusDurationStep = 0.0 var extendedBolusMaxDuration = 0.0 diff --git a/ui/src/main/kotlin/app/aaps/ui/activities/TreatmentsActivity.kt b/ui/src/main/kotlin/app/aaps/ui/activities/TreatmentsActivity.kt index 9bb17b428e..da0a568cec 100644 --- a/ui/src/main/kotlin/app/aaps/ui/activities/TreatmentsActivity.kt +++ b/ui/src/main/kotlin/app/aaps/ui/activities/TreatmentsActivity.kt @@ -34,8 +34,8 @@ class TreatmentsActivity : TranslatedDaggerAppCompatActivity() { setContentView(binding.root) // Use index, TabItems crashes with an id - val useFakeTempBasal = activePlugin.activePump.isFakingTempsByExtendedBoluses - binding.treatmentsTabs.getTabAt(1)?.view?.visibility = useFakeTempBasal.not().toVisibility() + val showEbTab = !activePlugin.activePump.isFakingTempsByExtendedBoluses && activePlugin.activePump.pumpDescription.isExtendedBolusCapable + binding.treatmentsTabs.getTabAt(1)?.view?.visibility = showEbTab.toVisibility() setFragment(TreatmentsBolusCarbsFragment()) setSupportActionBar(binding.toolbar)