From 2b610e16e4dfb55be4421ca5b14d732f4e636ab8 Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Fri, 24 Jun 2022 21:47:54 +0100 Subject: [PATCH 01/38] - started changes for rewind/stop --- .../plugins/pump/medtronic/data/MedtronicHistoryData.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt index 752d7e187b..941aee3bb4 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt @@ -796,6 +796,9 @@ class MedtronicHistoryData @Inject constructor( } } + val suspendList = getFilteredItems(newHistory, // + setOf(PumpHistoryEntryType.SuspendPump)) + // see if rewind items, need to fix any of current tempBasalProcessDTO items (bug 1724) if (rewindList.isNotEmpty()) { for (rewindEntry in rewindList) { From 700a5685cf70a149dfe0685c96d8b876d38af990 Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Sat, 25 Jun 2022 19:32:06 +0100 Subject: [PATCH 02/38] - extending solution --- .../medtronic/data/MedtronicHistoryData.kt | 42 ++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt index 941aee3bb4..142a321375 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt @@ -799,7 +799,11 @@ class MedtronicHistoryData @Inject constructor( val suspendList = getFilteredItems(newHistory, // setOf(PumpHistoryEntryType.SuspendPump)) - // see if rewind items, need to fix any of current tempBasalProcessDTO items (bug 1724) + val stopList : MutableList = mutableListOf() + stopList.addAll(suspendList); + stopList.addAll(rewindList); + + // TODO remove see if rewind items, need to fix any of current tempBasalProcessDTO items (bug 1724) if (rewindList.isNotEmpty()) { for (rewindEntry in rewindList) { for (tempBasalProcessDTO in processList) { @@ -816,9 +820,45 @@ class MedtronicHistoryData @Inject constructor( } } + // see if have rewind/stop items that need to fix any of current tempBasalProcessDTO items (bug 1724) + if (stopList.isNotEmpty()) { + for (tempBasalProcessDTO in processList) { + if (tempBasalProcessDTO.itemTwo==null) { + val endTime: Long = DateTimeUtil.getATDWithAddedMinutes(tempBasalProcessDTO.itemOne.atechDateTime, tempBasalProcessDTO.itemOneTbr!!.durationMinutes) + + val findNearestEntry = findNearestEntry(tempBasalProcessDTO.itemOne.atechDateTime, endTime, stopList); + + if (findNearestEntry!=null) { + tempBasalProcessDTO.itemTwo = findNearestEntry + stopList.remove(findNearestEntry) + } + } + } + } + return processList } + fun findNearestEntry(startTime: Long, endTime: Long, list: MutableList) : PumpHistoryEntry? { + val outList: MutableList = mutableListOf() + + for (pumpHistoryEntry in list) { + if ((pumpHistoryEntry.atechDateTime > startTime) && + (pumpHistoryEntry.atechDateTime < endTime)) { + outList.add(pumpHistoryEntry) + } + } + + if (outList.size == 0) { + return null + } else if (outList.size==1) { + return outList[0] + } else { + // TODO + return null + } + } + fun isTBRActive(dbEntry: PumpDbEntryTBR): Boolean { return isTBRActive( startTimestamp = dbEntry.date, From 0599e813275615024cb55194d1f186886c71e3de Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 22 Jul 2022 19:21:01 +0200 Subject: [PATCH 03/38] 3.1.0.2-dev-a --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 32e522bc68..c24cc57c18 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -105,7 +105,7 @@ android { defaultConfig { multiDexEnabled true versionCode 1500 - version "3.1.0.2" + version "3.1.0.2-dev-a" buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"' buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"' From 0734b4c6207855b43e0e4f4c4a811e95738f9b39 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 22 Jul 2022 22:59:21 +0200 Subject: [PATCH 04/38] Insight: fix NPE --- .../connection_service/InsightConnectionService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/connection_service/InsightConnectionService.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/connection_service/InsightConnectionService.java index d4f70297e5..760852ff1c 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/connection_service/InsightConnectionService.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/connection_service/InsightConnectionService.java @@ -264,10 +264,10 @@ public class InsightConnectionService extends DaggerService implements Connectio super.onCreate(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S || ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED) { bluetoothAdapter = ((BluetoothManager) getApplicationContext().getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter(); - pairingDataStorage = new PairingDataStorage(this); - state = pairingDataStorage.isPaired() ? InsightState.DISCONNECTED : InsightState.NOT_PAIRED; - wakeLock = ((PowerManager) getSystemService(POWER_SERVICE)).newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "AndroidAPS:InsightConnectionService"); } + pairingDataStorage = new PairingDataStorage(this); + state = pairingDataStorage.isPaired() ? InsightState.DISCONNECTED : InsightState.NOT_PAIRED; + wakeLock = ((PowerManager) getSystemService(POWER_SERVICE)).newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "AndroidAPS:InsightConnectionService"); } private void setState(InsightState state) { From 1c9749ee26794c4e55f528ab0323af208be1bae0 Mon Sep 17 00:00:00 2001 From: osodebailar Date: Sat, 23 Jul 2022 13:52:55 +0200 Subject: [PATCH 05/38] fix insight textcolor on white theme --- insight/src/main/res/layout/bluetooth_device.xml | 1 - insight/src/main/res/layout/local_insight_status_item.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/insight/src/main/res/layout/bluetooth_device.xml b/insight/src/main/res/layout/bluetooth_device.xml index 9287922b46..1e6f3e7121 100644 --- a/insight/src/main/res/layout/bluetooth_device.xml +++ b/insight/src/main/res/layout/bluetooth_device.xml @@ -7,6 +7,5 @@ android:gravity="center_vertical" android:paddingStart="16dp" android:paddingEnd="0dp" - android:textColor="#FFFFFF" android:textSize="20sp" tools:text="Test" /> diff --git a/insight/src/main/res/layout/local_insight_status_item.xml b/insight/src/main/res/layout/local_insight_status_item.xml index 987d71b50e..31eb51d0a6 100644 --- a/insight/src/main/res/layout/local_insight_status_item.xml +++ b/insight/src/main/res/layout/local_insight_status_item.xml @@ -34,7 +34,6 @@ android:gravity="start" android:paddingStart="5dp" android:paddingEnd="0dp" - android:textColor="@android:color/white" android:textSize="14sp" /> From 2e40b17973f8202cb307ada3d355ee6bf1f28515 Mon Sep 17 00:00:00 2001 From: Andy Rozman Date: Sun, 24 Jul 2022 12:42:33 +0100 Subject: [PATCH 06/38] - reverting change done for 1724 (code is still there just commented). I need to rework this, and reuse the code, just on different position) --- .../medtronic/data/MedtronicHistoryData.kt | 79 ++++++++++--------- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt index d54a3ca2e5..6f17edbe0c 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/data/MedtronicHistoryData.kt @@ -797,45 +797,46 @@ class MedtronicHistoryData @Inject constructor( } } - val suspendList = getFilteredItems(newHistory, // - setOf(PumpHistoryEntryType.SuspendPump)) - - val stopList : MutableList = mutableListOf() - stopList.addAll(suspendList); - stopList.addAll(rewindList); - - // TODO remove see if rewind items, need to fix any of current tempBasalProcessDTO items (bug 1724) - if (rewindList.isNotEmpty()) { - for (rewindEntry in rewindList) { - for (tempBasalProcessDTO in processList) { - if (tempBasalProcessDTO.itemTwo==null) { - val endTime: Long = DateTimeUtil.getATDWithAddedMinutes(tempBasalProcessDTO.itemOne.atechDateTime, tempBasalProcessDTO.itemOneTbr!!.durationMinutes) - - if ((rewindEntry.atechDateTime > tempBasalProcessDTO.itemOne.atechDateTime) && - (rewindEntry.atechDateTime < endTime)) { - tempBasalProcessDTO.itemTwo = rewindEntry - continue - } - } - } - } - } - - // see if have rewind/stop items that need to fix any of current tempBasalProcessDTO items (bug 1724) - if (stopList.isNotEmpty()) { - for (tempBasalProcessDTO in processList) { - if (tempBasalProcessDTO.itemTwo==null) { - val endTime: Long = DateTimeUtil.getATDWithAddedMinutes(tempBasalProcessDTO.itemOne.atechDateTime, tempBasalProcessDTO.itemOneTbr!!.durationMinutes) - - val findNearestEntry = findNearestEntry(tempBasalProcessDTO.itemOne.atechDateTime, endTime, stopList); - - if (findNearestEntry!=null) { - tempBasalProcessDTO.itemTwo = findNearestEntry - stopList.remove(findNearestEntry) - } - } - } - } + // TODO this solution needs to be overworked, commenting out for now + // val suspendList = getFilteredItems(newHistory, // + // setOf(PumpHistoryEntryType.SuspendPump)) + // + // val stopList : MutableList = mutableListOf() + // stopList.addAll(suspendList); + // stopList.addAll(rewindList); + // + // // TODO remove see if rewind items, need to fix any of current tempBasalProcessDTO items (bug 1724) + // if (rewindList.isNotEmpty()) { + // for (rewindEntry in rewindList) { + // for (tempBasalProcessDTO in processList) { + // if (tempBasalProcessDTO.itemTwo==null) { + // val endTime: Long = DateTimeUtil.getATDWithAddedMinutes(tempBasalProcessDTO.itemOne.atechDateTime, tempBasalProcessDTO.itemOneTbr!!.durationMinutes) + // + // if ((rewindEntry.atechDateTime > tempBasalProcessDTO.itemOne.atechDateTime) && + // (rewindEntry.atechDateTime < endTime)) { + // tempBasalProcessDTO.itemTwo = rewindEntry + // continue + // } + // } + // } + // } + // } + // + // // see if have rewind/stop items that need to fix any of current tempBasalProcessDTO items (bug 1724) + // if (stopList.isNotEmpty()) { + // for (tempBasalProcessDTO in processList) { + // if (tempBasalProcessDTO.itemTwo==null) { + // val endTime: Long = DateTimeUtil.getATDWithAddedMinutes(tempBasalProcessDTO.itemOne.atechDateTime, tempBasalProcessDTO.itemOneTbr!!.durationMinutes) + // + // val findNearestEntry = findNearestEntry(tempBasalProcessDTO.itemOne.atechDateTime, endTime, stopList); + // + // if (findNearestEntry!=null) { + // tempBasalProcessDTO.itemTwo = findNearestEntry + // stopList.remove(findNearestEntry) + // } + // } + // } + // } return processList } From 2887cd5577fb8bd4edd8a1d874efcbf3c90b64ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 08:08:22 +0000 Subject: [PATCH 07/38] chore(deps): bump dagger_version from 2.42 to 2.43 Bumps `dagger_version` from 2.42 to 2.43. Updates `dagger-compiler` from 2.42 to 2.43 - [Release notes](https://github.com/google/dagger/releases) - [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43) Updates `dagger-android-processor` from 2.42 to 2.43 - [Release notes](https://github.com/google/dagger/releases) - [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43) Updates `dagger` from 2.42 to 2.43 - [Release notes](https://github.com/google/dagger/releases) - [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43) Updates `dagger-android` from 2.42 to 2.43 - [Release notes](https://github.com/google/dagger/releases) - [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43) Updates `dagger-android-support` from 2.42 to 2.43 - [Release notes](https://github.com/google/dagger/releases) - [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43) --- updated-dependencies: - dependency-name: com.google.dagger:dagger-compiler dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.google.dagger:dagger-android-processor dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.google.dagger:dagger dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.google.dagger:dagger-android dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.google.dagger:dagger-android-support dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5aafa2b9ae..bf5c7c1663 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { rxkotlin_version = '3.0.1' room_version = '2.4.2' lifecycle_version = '2.5.0' - dagger_version = '2.42' + dagger_version = '2.43' coroutines_version = '1.6.4' activity_version = '1.4.0' fragmentktx_version = '1.4.1' From abbc73ddcfec04fc18f7d7cb5288b7132fee2fb4 Mon Sep 17 00:00:00 2001 From: Dave Carlson Date: Mon, 25 Jul 2022 19:37:04 -0700 Subject: [PATCH 08/38] [omnipod-eros] moot basal set before pod basal activation --- .../omnipod/eros/manager/AapsOmnipodErosManager.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java index faa58d345d..5ede4b8932 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/manager/AapsOmnipodErosManager.java @@ -291,6 +291,15 @@ public class AapsOmnipodErosManager { return new PumpEnactResult(injector).success(false).enacted(false).comment(note); } + // #1963 return synthetic success if pre-activation + // to allow profile switch prior to pod activation + // otherwise a catch-22 + if (podStateManager.getActivationProgress().isBefore(ActivationProgress.BASAL_INITIALIZED)) { + // TODO: i18n string + return new PumpEnactResult(injector).success(true).enacted(false).comment("pre" + + "-activation basal change moot"); + } + PodHistoryEntryType historyEntryType = podStateManager.isSuspended() ? PodHistoryEntryType.RESUME_DELIVERY : PodHistoryEntryType.SET_BASAL_SCHEDULE; try { From f9bebfccbaf58eef77959495d5cecaf9138fd898 Mon Sep 17 00:00:00 2001 From: Philoul Date: Tue, 26 Jul 2022 22:31:52 +0200 Subject: [PATCH 09/38] Dash Bolus delivered ptogress dialog --- insight/build.gradle | 1 + .../androidaps/plugins/pump/insight/LocalInsightPlugin.java | 6 +++--- .../plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt | 4 ++-- pump-common/src/main/res/values/strings.xml | 1 + 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/insight/build.gradle b/insight/build.gradle index 623c52532a..5e69a77ba6 100644 --- a/insight/build.gradle +++ b/insight/build.gradle @@ -25,6 +25,7 @@ android { dependencies { implementation project(':core') implementation project(':shared') + implementation project(':pump-common') api "androidx.room:room-ktx:$room_version" api "androidx.room:room-runtime:$room_version" diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java index 517d1c7ec4..503b68e53f 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightPlugin.java @@ -590,7 +590,7 @@ public class LocalInsightPlugin extends PumpPluginBase implements Pump, Constrai EventOverviewBolusProgress.Treatment t = new EventOverviewBolusProgress.Treatment(0, 0, detailedBolusInfo.getBolusType() == DetailedBolusInfo.BolusType.SMB, detailedBolusInfo.getId()); final EventOverviewBolusProgress bolusingEvent = EventOverviewBolusProgress.INSTANCE; bolusingEvent.setT(t); - bolusingEvent.setStatus(rh.gs(R.string.insight_delivered, 0d, insulin)); + bolusingEvent.setStatus(rh.gs(R.string.bolus_delivered, 0d, insulin)); bolusingEvent.setPercent(0); rxBus.send(bolusingEvent); int trials = 0; @@ -629,14 +629,14 @@ public class LocalInsightPlugin extends PumpPluginBase implements Pump, Constrai trials = -1; int percentBefore = bolusingEvent.getPercent(); bolusingEvent.setPercent((int) (100D / activeBolus.getInitialAmount() * (activeBolus.getInitialAmount() - activeBolus.getRemainingAmount()))); - bolusingEvent.setStatus(rh.gs(R.string.insight_delivered, activeBolus.getInitialAmount() - activeBolus.getRemainingAmount(), activeBolus.getInitialAmount())); + bolusingEvent.setStatus(rh.gs(R.string.bolus_delivered, activeBolus.getInitialAmount() - activeBolus.getRemainingAmount(), activeBolus.getInitialAmount())); if (percentBefore != bolusingEvent.getPercent()) rxBus.send(bolusingEvent); } else { synchronized ($bolusLock) { if (bolusCancelled || trials == -1 || trials++ >= 5) { if (!bolusCancelled) { - bolusingEvent.setStatus(rh.gs(R.string.insight_delivered, insulin, insulin)); + bolusingEvent.setStatus(rh.gs(R.string.bolus_delivered, insulin, insulin)); bolusingEvent.setPercent(100); rxBus.send(bolusingEvent); } diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index 84aa19951d..afbd388401 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -698,7 +698,7 @@ class OmnipodDashPumpPlugin @Inject constructor( } val percent = (waited.toFloat() / estimatedDeliveryTimeSeconds) * 100 updateBolusProgressDialog( - rh.gs(R.string.dash_bolusdelivering, requestedBolusAmount), + rh.gs(R.string.bolus_delivered, percent*requestedBolusAmount/100, requestedBolusAmount), percent.toInt() ) } @@ -729,7 +729,7 @@ class OmnipodDashPumpPlugin @Inject constructor( val remainingUnits = podStateManager.lastBolus!!.bolusUnitsRemaining val percent = ((requestedBolusAmount - remainingUnits) / requestedBolusAmount) * 100 updateBolusProgressDialog( - rh.gs(R.string.bolusdelivering, requestedBolusAmount), + rh.gs(R.string.bolus_delivered, requestedBolusAmount - remainingUnits, requestedBolusAmount), percent.toInt() ) diff --git a/pump-common/src/main/res/values/strings.xml b/pump-common/src/main/res/values/strings.xml index 8bbb70d064..d51c9755f6 100644 --- a/pump-common/src/main/res/values/strings.xml +++ b/pump-common/src/main/res/values/strings.xml @@ -7,6 +7,7 @@ OK Pump Serial Number + %1$.2f U / %2$.2f U delivered From ff378579c4d3108ce7775e09e3e7b258d1aab402 Mon Sep 17 00:00:00 2001 From: osodebailar Date: Wed, 27 Jul 2022 09:45:09 +0200 Subject: [PATCH 10/38] fix button style --- .../androidaps/plugins/general/actions/ActionsFragment.kt | 2 +- .../androidaps/plugins/general/overview/OverviewFragment.kt | 2 +- core/src/main/res/values-night/styles.xml | 2 ++ core/src/main/res/values/attrs.xml | 2 ++ core/src/main/res/values/styles.xml | 2 ++ 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt index 92002eab4d..ff3fc89a4a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt @@ -312,7 +312,7 @@ class ActionsFragment : DaggerFragment() { for (customAction in customActions) { if (!customAction.isEnabled) continue - val btn = SingleClickButton(currentContext, null, android.R.attr.buttonStyle) + val btn = SingleClickButton(currentContext, null, R.attr.customBtnStyle) btn.text = rh.gs(customAction.name) val layoutParams = LinearLayout.LayoutParams( 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 8ecba9d5ad..d6ca34ab63 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 @@ -582,7 +582,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList for (event in events) if (event.isEnabled && event.trigger.shouldRun()) context?.let { context -> - SingleClickButton(context).also { + SingleClickButton(context, null, R.attr.customBtnStyle).also { it.setTextColor(rh.gac(context, R.attr.treatmentButton)) it.setTextSize(TypedValue.COMPLEX_UNIT_SP, 10f) it.layoutParams = LinearLayout.LayoutParams(0, ViewGroup.LayoutParams.MATCH_PARENT, 0.5f).also { l -> diff --git a/core/src/main/res/values-night/styles.xml b/core/src/main/res/values-night/styles.xml index 3a9fe781b5..dfd244db24 100644 --- a/core/src/main/res/values-night/styles.xml +++ b/core/src/main/res/values-night/styles.xml @@ -248,6 +248,8 @@ @color/white @style/CommonSpinnerItemStyle + + @style/GrayButton diff --git a/core/src/main/res/values/attrs.xml b/core/src/main/res/values/attrs.xml index 0c9e53b9b7..5c5146e42d 100644 --- a/core/src/main/res/values/attrs.xml +++ b/core/src/main/res/values/attrs.xml @@ -218,4 +218,6 @@ + + \ No newline at end of file diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index b831de330c..a471a947dc 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -249,6 +249,8 @@ @color/white @style/CommonSpinnerItemStyle + + @style/GrayButton