From a4edd962d93672a8e54bfff7f722d8de6cfc170e Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Mon, 4 Apr 2022 17:15:34 +0200 Subject: [PATCH 1/7] DanaRS: fix loading so library --- gradle/android_dependencies.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/android_dependencies.gradle b/gradle/android_dependencies.gradle index 43601e4ca3..6e06cbad5f 100644 --- a/gradle/android_dependencies.gradle +++ b/gradle/android_dependencies.gradle @@ -27,7 +27,7 @@ android { sourceSets { main { - jniLibs.srcDirs = ['libs'] + jniLibs.srcDirs = ['src/main/jniLibs'] } } From 12b759a3dd3e5e5128402d1dbfb7262b3cc57d94 Mon Sep 17 00:00:00 2001 From: osodebailar Date: Mon, 4 Apr 2022 20:04:35 +0200 Subject: [PATCH 2/7] fix basal overview color in dark mode and set widget trend arrow color --- app/src/main/java/info/nightscout/androidaps/Widget.kt | 7 ++++++- .../androidaps/plugins/general/overview/OverviewData.kt | 6 +++++- .../plugins/general/overview/OverviewFragment.kt | 2 +- core/src/main/res/values-night/colors.xml | 3 +++ core/src/main/res/values-night/styles.xml | 1 + core/src/main/res/values/attrs.xml | 1 + core/src/main/res/values/colors.xml | 3 +++ core/src/main/res/values/styles.xml | 3 ++- 8 files changed, 22 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/Widget.kt b/app/src/main/java/info/nightscout/androidaps/Widget.kt index 2d8268626e..e43f21e93e 100644 --- a/app/src/main/java/info/nightscout/androidaps/Widget.kt +++ b/app/src/main/java/info/nightscout/androidaps/Widget.kt @@ -6,6 +6,7 @@ import android.appwidget.AppWidgetProvider import android.content.ComponentName import android.content.Context import android.content.Intent +import android.graphics.Color import android.graphics.Paint import android.view.View import android.widget.RemoteViews @@ -105,7 +106,11 @@ class Widget : AppWidgetProvider() { } ) views.setImageViewResource(R.id.arrow, trendCalculator.getTrendArrow(overviewData.lastBg).directionToIcon()) - //binding.infoLayout.arrow.setColorFilter(overviewData.lastBgColor(context)) + views.setInt(R.id.arrow, "setColorFilter", when { + overviewData.isLow -> rh.gc(R.color.low) + overviewData.isHigh -> rh.gc(R.color.high) + else -> rh.gc(R.color.inrange) + }) val glucoseStatus = glucoseStatusProvider.glucoseStatusData if (glucoseStatus != null) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt index c7b937666e..ed72586168 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt @@ -196,9 +196,13 @@ class OverviewData @Inject constructor( } } ?: R.drawable.ic_cp_basal_no_tbr + // will be removed if a solution of getting the right color for widget is solved val temporaryBasalColor: Int get() = iobCobCalculator.getTempBasalIncludingConvertedExtended(dateUtil.now())?.let { rh.gc(R.color.basal) } - ?: rh.gc(R.color.defaulttextcolor) + ?: rh.gc(R.color.textAppearancemediumDark) + + fun temporaryBasalColor(context: Context?): Int = iobCobCalculator.getTempBasalIncludingConvertedExtended(dateUtil.now())?.let { rh.gac(context , R.attr.basal) } + ?: rh.gac(context, R.attr.textAppearancemediumColor) /* * EXTENDED BOLUS 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 c14de709e8..a6f34737ed 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 @@ -852,7 +852,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList @Suppress("UNUSED_PARAMETER") fun updateTemporaryBasal(from: String) { binding.infoLayout.baseBasal.text = overviewData.temporaryBasalText - binding.infoLayout.baseBasal.setTextColor(overviewData.temporaryBasalColor) + binding.infoLayout.baseBasal.setTextColor(overviewData.temporaryBasalColor(context)) binding.infoLayout.baseBasalIcon.setImageResource(overviewData.temporaryBasalIcon) binding.infoLayout.basalLayout.setOnClickListener { activity?.let { OKDialog.show(it, rh.gs(R.string.basal), overviewData.temporaryBasalDialogText) } diff --git a/core/src/main/res/values-night/colors.xml b/core/src/main/res/values-night/colors.xml index f4b913e290..b12d342936 100644 --- a/core/src/main/res/values-night/colors.xml +++ b/core/src/main/res/values-night/colors.xml @@ -234,6 +234,9 @@ #33969696 #EBEBEA + #000000 + #B3FFFFFF + #FFFF00 #00FFFF diff --git a/core/src/main/res/values-night/styles.xml b/core/src/main/res/values-night/styles.xml index b0b4a086b6..67d8b27049 100644 --- a/core/src/main/res/values-night/styles.xml +++ b/core/src/main/res/values-night/styles.xml @@ -225,6 +225,7 @@ @color/activity @color/plastic_grey + @color/textAppearancemediumDark