Merge pull request #2744 from Philoul/wear/new_custom_watchface

Wear CWF Fix delay in DayName and Month format after watchface loading
This commit is contained in:
Milos Kozak 2023-09-05 22:34:37 +02:00 committed by GitHub
commit 51ef849b5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -164,6 +164,8 @@ class CustomWatchface : BaseWatchFace() {
.takeIf { it.matches(Regex("E{1,4}")) } ?: "E" .takeIf { it.matches(Regex("E{1,4}")) } ?: "E"
monthFormat = json.optString(MONTHFORMAT.key, "MMM") monthFormat = json.optString(MONTHFORMAT.key, "MMM")
.takeIf { it.matches(Regex("M{1,4}")) } ?: "MMM" .takeIf { it.matches(Regex("M{1,4}")) } ?: "MMM"
binding.dayName.text = dateUtil.dayNameString(dayNameFormat) // Update daynName and month according to format on cwf loading
binding.month.text = dateUtil.monthString(monthFormat)
bgColor = when (singleBg.sgvLevel) { bgColor = when (singleBg.sgvLevel) {
1L -> highColor 1L -> highColor
0L -> midColor 0L -> midColor