From 6add71230f25a40b7466eb2b997d177fc81a787c Mon Sep 17 00:00:00 2001 From: rICTx-T1D Date: Thu, 8 Oct 2020 22:25:18 +0200 Subject: [PATCH] Show week number, when turn on in watchface setting menu. --- .../androidaps/watchfaces/RICTxWF01.java | 17 ++++++++++++++++ .../res/layout/rect_activity_rictxwf01.xml | 20 ++++++++++++++++++- .../res/layout/round_activity_rictxwf01.xml | 20 ++++++++++++++++++- wear/src/main/res/values/strings.xml | 1 + .../main/res/xml/rictxwf01configuration.xml | 7 +++++++ 5 files changed, 63 insertions(+), 2 deletions(-) diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/RICTxWF01.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/RICTxWF01.java index 8d7583912b..772af26400 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/RICTxWF01.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/RICTxWF01.java @@ -14,6 +14,10 @@ import androidx.core.content.ContextCompat; import com.ustwo.clockwise.common.WatchFaceTime; import com.ustwo.clockwise.common.WatchMode; + +import java.text.SimpleDateFormat; +import java.util.Date; + import info.nightscout.androidaps.R; import info.nightscout.androidaps.interaction.menus.MainMenuActivity; @@ -149,8 +153,21 @@ public class RICTxWF01 extends BaseWatchFace { mMinute.setTextSize(26); mHour.setLetterSpacing((float) 0); mMinute.setLetterSpacing((float) 0); + + /* display week number */ + Boolean isShowWeekNumber = sharedPrefs.getBoolean("show_weeknumber", false); + Log.i("---------------------------------","weeknumber refresh "); + TextView mWeekNumber= layoutView.findViewById(R.id.weeknumber); + if (isShowWeekNumber) { + mWeekNumber.setVisibility(View.VISIBLE); + mWeekNumber.setText("(" + (new SimpleDateFormat("ww")).format(new Date()) + ")"); + } else { + mWeekNumber.setVisibility(View.GONE); + mWeekNumber.setText(""); + } } + /* @ToDo optimize font-size --> when direction and time-ago is off, increase font-size of sgv */ } diff --git a/wear/src/main/res/layout/rect_activity_rictxwf01.xml b/wear/src/main/res/layout/rect_activity_rictxwf01.xml index 3e56dff497..728d66f733 100644 --- a/wear/src/main/res/layout/rect_activity_rictxwf01.xml +++ b/wear/src/main/res/layout/rect_activity_rictxwf01.xml @@ -308,14 +308,32 @@ + + diff --git a/wear/src/main/res/layout/round_activity_rictxwf01.xml b/wear/src/main/res/layout/round_activity_rictxwf01.xml index 1905d71253..8d4d99011c 100644 --- a/wear/src/main/res/layout/round_activity_rictxwf01.xml +++ b/wear/src/main/res/layout/round_activity_rictxwf01.xml @@ -308,14 +308,32 @@ + + diff --git a/wear/src/main/res/values/strings.xml b/wear/src/main/res/values/strings.xml index dbff78b9d0..ec76e27583 100644 --- a/wear/src/main/res/values/strings.xml +++ b/wear/src/main/res/values/strings.xml @@ -152,5 +152,6 @@ Choose your color Choose your color saturation vibrate hourly + Show Week number diff --git a/wear/src/main/res/xml/rictxwf01configuration.xml b/wear/src/main/res/xml/rictxwf01configuration.xml index 99a685fa80..7c84e1572a 100644 --- a/wear/src/main/res/xml/rictxwf01configuration.xml +++ b/wear/src/main/res/xml/rictxwf01configuration.xml @@ -30,6 +30,13 @@ app:wear_iconOff="@drawable/settings_off" app:wear_iconOn="@drawable/settings_on" /> + +