From c496b132dd5ac2ab6d0efdfa523ac7ed2b497fa9 Mon Sep 17 00:00:00 2001 From: Philoul Date: Sat, 12 Aug 2023 17:41:44 +0200 Subject: [PATCH] Add 2 freetext views in CustomWatchface --- .../androidaps/watchfaces/CustomWatchface.kt | 4 ++++ wear/src/main/res/layout/activity_custom.xml | 22 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/CustomWatchface.kt b/wear/src/main/java/info/nightscout/androidaps/watchfaces/CustomWatchface.kt index ffdaba882a..5cb6f497d0 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/CustomWatchface.kt +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/CustomWatchface.kt @@ -168,6 +168,8 @@ class CustomWatchface : BaseWatchFace() { ) if (viewjson.has("fontColor")) view.setTextColor(getColor(viewjson.getString("fontColor"))) + if (viewjson.has("textvalue")) + view.text = viewjson.getString("textvalue") } if (view is ImageView) { @@ -399,6 +401,8 @@ class CustomWatchface : BaseWatchFace() { BACKGROUND(CustomWatchfaceDrawableDataKey.BACKGROUND.key, R.id.background, null), CHART("chart", R.id.chart, null), COVER_CHART(CustomWatchfaceDrawableDataKey.COVERCHART.key, R.id.cover_chart, null), + FREETEXT1("freetext1", R.id.freetext1, null), + FREETEXT2("freetext2", R.id.freetext2, null), IOB1("iob1", R.id.iob1, R.string.key_show_iob), IOB2("iob2", R.id.iob2, R.string.key_show_iob), COB1("cob1", R.id.cob1, R.string.key_show_cob), diff --git a/wear/src/main/res/layout/activity_custom.xml b/wear/src/main/res/layout/activity_custom.xml index 3a7466f97b..553dc1fdae 100644 --- a/wear/src/main/res/layout/activity_custom.xml +++ b/wear/src/main/res/layout/activity_custom.xml @@ -34,6 +34,28 @@ android:visibility="gone" android:orientation="vertical" /> + + + +