From 5139148e3e3cc6ff9e4fd9af6420aaffec295151 Mon Sep 17 00:00:00 2001 From: Philoul Date: Fri, 13 Oct 2023 21:10:36 +0200 Subject: [PATCH] Wear CWF Remove SonarLint Warning --- .../kotlin/app/aaps/wear/watchfaces/CustomWatchface.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wear/src/main/kotlin/app/aaps/wear/watchfaces/CustomWatchface.kt b/wear/src/main/kotlin/app/aaps/wear/watchfaces/CustomWatchface.kt index ff18698aa0..527761d133 100644 --- a/wear/src/main/kotlin/app/aaps/wear/watchfaces/CustomWatchface.kt +++ b/wear/src/main/kotlin/app/aaps/wear/watchfaces/CustomWatchface.kt @@ -431,7 +431,7 @@ class CustomWatchface : BaseWatchFace() { ); companion object { - + val TRANSPARENT = "#00000000" fun init(cwf: CustomWatchface) = values().forEach { it.cwf = cwf // reset all customized drawable when new watchface is loaded @@ -519,7 +519,7 @@ class CustomWatchface : BaseWatchFace() { it.clearColorFilter() view.background = it } ?: apply { - view.setBackgroundColor(dynData?.getColor() ?: cwf.getColor(viewJson.optString(COLOR.key, "#0000000000"), Color.TRANSPARENT)) + view.setBackgroundColor(dynData?.getColor() ?: cwf.getColor(viewJson.optString(COLOR.key, TRANSPARENT), Color.TRANSPARENT)) } } ?: apply { view.text = "" } } @@ -542,7 +542,7 @@ class CustomWatchface : BaseWatchFace() { view.clearColorFilter() } if (view.drawable == null) - view.setBackgroundColor(dynData?.getColor() ?: cwf.getColor(viewJson.optString(COLOR.key, "#0000000000"), Color.TRANSPARENT)) + view.setBackgroundColor(dynData?.getColor() ?: cwf.getColor(viewJson.optString(COLOR.key, TRANSPARENT), Color.TRANSPARENT)) } } @@ -556,7 +556,7 @@ class CustomWatchface : BaseWatchFace() { it.clearColorFilter() view.background = it } ?: apply { - view.setBackgroundColor(dynData?.getColor() ?: cwf.getColor(viewJson.optString(COLOR.key, "#0000000000"), Color.TRANSPARENT)) + view.setBackgroundColor(dynData?.getColor() ?: cwf.getColor(viewJson.optString(COLOR.key, TRANSPARENT), Color.TRANSPARENT)) } } }