InfiniTime.git

commit f9f8d7eeadbcc78a5a487f2dd1cb2f24888c8a57

Author: Jean-François Milants <jf@codingfield.com>

Merge branch 'ITCactus-watchface-casio-digital-G7710' into develop

 src/CMakeLists.txt | 1 
 src/components/settings/Settings.h | 16 
 src/displayapp/screens/CheckboxList.cpp | 1 
 src/displayapp/screens/Clock.cpp | 16 
 src/displayapp/screens/Clock.h | 1 
 src/displayapp/screens/WatchFaceCasioStyleG7710.cpp | 335 ++++++++++++++
 src/displayapp/screens/WatchFaceCasioStyleG7710.h | 109 ++++
 src/displayapp/screens/WatchFaceInfineat.cpp | 8 
 src/displayapp/screens/settings/SettingWatchFace.cpp | 2 


diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0bcb788fae001197997a9184b97d65e55b924079..e59c0d814b8e87754d0df0989b98984f17bd0e2e 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -430,6 +430,7 @@         displayapp/screens/WatchFaceDigital.cpp
         displayapp/screens/WatchFaceInfineat.cpp
         displayapp/screens/WatchFaceTerminal.cpp
         displayapp/screens/WatchFacePineTimeStyle.cpp
+        displayapp/screens/WatchFaceCasioStyleG7710.cpp
 
         ##
 




diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h
index 79f121d186c6746d33dc118f0ed39d19a41b88ed..e39ed2f9850478efd573ff6fbdf9f3719cc4d86c 100644
--- a/src/components/settings/Settings.h
+++ b/src/components/settings/Settings.h
@@ -123,6 +123,14 @@       void SetAppMenu(uint8_t menu) {
         appMenu = menu;
       };
 
+      void SetWatchfacesMenu(uint8_t menu) {
+        watchFacesMenu = menu;
+      };
+
+      uint8_t GetWatchfacesMenu() const {
+        return watchFacesMenu;
+      };
+
       uint8_t GetAppMenu() const {
         return appMenu;
       };
@@ -132,14 +140,6 @@         settingsMenu = menu;
       };
       uint8_t GetSettingsMenu() const {
         return settingsMenu;
-      };
-
-      void SetWatchfacesMenu(uint8_t menu) {
-        watchFacesMenu = menu;
-      };
-
-      uint8_t GetWatchfacesMenu() const {
-        return watchFacesMenu;
       };
 
       void SetClockType(ClockType clocktype) {




diff --git a/src/displayapp/screens/CheckboxList.cpp b/src/displayapp/screens/CheckboxList.cpp
index b89add43335cb42a421a59d018949b820202761d..952d86da8a03241f3ee42231131438f3fa1aac87 100644
--- a/src/displayapp/screens/CheckboxList.cpp
+++ b/src/displayapp/screens/CheckboxList.cpp
@@ -98,7 +98,6 @@ }
 
 CheckboxList::~CheckboxList() {
   lv_obj_clean(lv_scr_act());
-  settingsController.SaveSettings();
 }
 
 void CheckboxList::UpdateSelected(lv_obj_t* object, lv_event_t event) {




diff --git a/src/displayapp/screens/Clock.cpp b/src/displayapp/screens/Clock.cpp
index 737770f18023caa60c979bcb4826d39763dd3bb9..bc00a4abbefa452ff3d6f7aad3dbe74d52989e0d 100644
--- a/src/displayapp/screens/Clock.cpp
+++ b/src/displayapp/screens/Clock.cpp
@@ -13,6 +13,7 @@ #include "displayapp/screens/WatchFaceTerminal.h"
 #include "displayapp/screens/WatchFaceInfineat.h"
 #include "displayapp/screens/WatchFaceAnalog.h"
 #include "displayapp/screens/WatchFacePineTimeStyle.h"
+#include "displayapp/screens/WatchFaceCasioStyleG7710.h"
 
 using namespace Pinetime::Applications::Screens;
 
@@ -50,6 +51,9 @@           return WatchFaceTerminalScreen();
           break;
         case 4:
           return WatchFaceInfineatScreen();
+          break;
+        case 5:
+          return WatchFaceCasioStyleG7710();
           break;
       }
       return WatchFaceDigitalScreen();
@@ -120,3 +124,15 @@                                                       settingsController,
                                                       motionController,
                                                       filesystem);
 }
+
+std::unique_ptr<Screen> Clock::WatchFaceCasioStyleG7710() {
+  return std::make_unique<Screens::WatchFaceCasioStyleG7710>(app,
+                                                             dateTimeController,
+                                                             batteryController,
+                                                             bleController,
+                                                             notificatioManager,
+                                                             settingsController,
+                                                             heartRateController,
+                                                             motionController,
+                                                             filesystem);
+}




diff --git a/src/displayapp/screens/Clock.h b/src/displayapp/screens/Clock.h
index e5605c5f547a82607f3d90e942a421ab31df47b7..613fef57eaf97a0fa91810b1c4a8bafeb174899f 100644
--- a/src/displayapp/screens/Clock.h
+++ b/src/displayapp/screens/Clock.h
@@ -51,6 +51,7 @@         std::unique_ptr WatchFaceAnalogScreen();
         std::unique_ptr<Screen> WatchFacePineTimeStyleScreen();
         std::unique_ptr<Screen> WatchFaceTerminalScreen();
         std::unique_ptr<Screen> WatchFaceInfineatScreen();
+        std::unique_ptr<Screen> WatchFaceCasioStyleG7710();
       };
     }
   }




diff --git a/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp b/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..f9a01abde37168e5370cef1e433e07de8357683e
--- /dev/null
+++ b/src/displayapp/screens/WatchFaceCasioStyleG7710.cpp
@@ -0,0 +1,335 @@
+#include "displayapp/screens/WatchFaceCasioStyleG7710.h"
+
+#include <date/date.h>
+#include <lvgl/lvgl.h>
+#include <cstdio>
+#include "displayapp/screens/BatteryIcon.h"
+#include "displayapp/screens/BleIcon.h"
+#include "displayapp/screens/NotificationIcon.h"
+#include "displayapp/screens/Symbols.h"
+#include "components/battery/BatteryController.h"
+#include "components/ble/BleController.h"
+#include "components/ble/NotificationManager.h"
+#include "components/heartrate/HeartRateController.h"
+#include "components/motion/MotionController.h"
+#include "components/settings/Settings.h"
+using namespace Pinetime::Applications::Screens;
+
+WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(DisplayApp* app,
+                                                   Controllers::DateTime& dateTimeController,
+                                                   Controllers::Battery& batteryController,
+                                                   Controllers::Ble& bleController,
+                                                   Controllers::NotificationManager& notificatioManager,
+                                                   Controllers::Settings& settingsController,
+                                                   Controllers::HeartRateController& heartRateController,
+                                                   Controllers::MotionController& motionController,
+                                                   Controllers::FS& filesystem)
+  : Screen(app),
+    currentDateTime {{}},
+    dateTimeController {dateTimeController},
+    batteryController {batteryController},
+    bleController {bleController},
+    notificatioManager {notificatioManager},
+    settingsController {settingsController},
+    heartRateController {heartRateController},
+    motionController {motionController} {
+
+  lfs_file f = {};
+  if (filesystem.FileOpen(&f, "/fonts/lv_font_dots_40.bin", LFS_O_RDONLY) >= 0) {
+    filesystem.FileClose(&f);
+    font_dot40 = lv_font_load("F:/fonts/lv_font_dots_40.bin");
+  }
+
+  if (filesystem.FileOpen(&f, "/fonts/7segments_40.bin", LFS_O_RDONLY) >= 0) {
+    filesystem.FileClose(&f);
+    font_segment40 = lv_font_load("F:/fonts/7segments_40.bin");
+  }
+
+  if (filesystem.FileOpen(&f, "/fonts/7segments_115.bin", LFS_O_RDONLY) >= 0) {
+    filesystem.FileClose(&f);
+    font_segment115 = lv_font_load("F:/fonts/7segments_115.bin");
+  }
+
+  label_battery_vallue = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_align(label_battery_vallue, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, 0, 0);
+  lv_obj_set_style_local_text_color(label_battery_vallue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_label_set_text_static(label_battery_vallue, "00%");
+
+  batteryIcon.Create(lv_scr_act());
+  batteryIcon.SetColor(color_text);
+  lv_obj_align(batteryIcon.GetObject(), label_battery_vallue, LV_ALIGN_OUT_LEFT_MID, -5, 0);
+
+  batteryPlug = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_set_style_local_text_color(batteryPlug, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_label_set_text_static(batteryPlug, Symbols::plug);
+  lv_obj_align(batteryPlug, batteryIcon.GetObject(), LV_ALIGN_OUT_LEFT_MID, -5, 0);
+
+  bleIcon = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_set_style_local_text_color(bleIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_label_set_text_static(bleIcon, Symbols::bluetooth);
+  lv_obj_align(bleIcon, batteryPlug, LV_ALIGN_OUT_LEFT_MID, -5, 0);
+
+  notificationIcon = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false));
+  lv_obj_align(notificationIcon, bleIcon, LV_ALIGN_OUT_LEFT_MID, -5, 0);
+
+  label_day_of_week = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_align(label_day_of_week, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 10, 64);
+  lv_obj_set_style_local_text_color(label_day_of_week, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_obj_set_style_local_text_font(label_day_of_week, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_dot40);
+  lv_label_set_text_static(label_day_of_week, "SUN");
+
+  label_week_number = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_align(label_week_number, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 5, 22);
+  lv_obj_set_style_local_text_color(label_week_number, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_obj_set_style_local_text_font(label_week_number, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_dot40);
+  lv_label_set_text_static(label_week_number, "WK26");
+
+  label_day_of_year = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_align(label_day_of_year, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 100, 30);
+  lv_obj_set_style_local_text_color(label_day_of_year, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_obj_set_style_local_text_font(label_day_of_year, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_segment40);
+  lv_label_set_text_static(label_day_of_year, "181-184");
+
+  lv_style_init(&style_line);
+  lv_style_set_line_width(&style_line, LV_STATE_DEFAULT, 2);
+  lv_style_set_line_color(&style_line, LV_STATE_DEFAULT, color_text);
+  lv_style_set_line_rounded(&style_line, LV_STATE_DEFAULT, true);
+
+  lv_style_init(&style_border);
+  lv_style_set_line_width(&style_border, LV_STATE_DEFAULT, 6);
+  lv_style_set_line_color(&style_border, LV_STATE_DEFAULT, color_text);
+  lv_style_set_line_rounded(&style_border, LV_STATE_DEFAULT, true);
+
+  line_icons = lv_line_create(lv_scr_act(), nullptr);
+  lv_line_set_points(line_icons, line_icons_points, 3);
+  lv_obj_add_style(line_icons, LV_LINE_PART_MAIN, &style_line);
+  lv_obj_align(line_icons, nullptr, LV_ALIGN_IN_TOP_RIGHT, -10, 18);
+
+  line_day_of_week_number = lv_line_create(lv_scr_act(), nullptr);
+  lv_line_set_points(line_day_of_week_number, line_day_of_week_number_points, 4);
+  lv_obj_add_style(line_day_of_week_number, LV_LINE_PART_MAIN, &style_border);
+  lv_obj_align(line_day_of_week_number, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 8);
+
+  line_day_of_year = lv_line_create(lv_scr_act(), nullptr);
+  lv_line_set_points(line_day_of_year, line_day_of_year_points, 3);
+  lv_obj_add_style(line_day_of_year, LV_LINE_PART_MAIN, &style_line);
+  lv_obj_align(line_day_of_year, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 60);
+
+  label_date = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_align(label_date, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 100, 70);
+  lv_obj_set_style_local_text_color(label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_obj_set_style_local_text_font(label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_segment40);
+  lv_label_set_text_static(label_date, "6-30");
+
+  line_date = lv_line_create(lv_scr_act(), nullptr);
+  lv_line_set_points(line_date, line_date_points, 3);
+  lv_obj_add_style(line_date, LV_LINE_PART_MAIN, &style_line);
+  lv_obj_align(line_date, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 100);
+
+  label_time = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_set_style_local_text_color(label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_obj_set_style_local_text_font(label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_segment115);
+  lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_CENTER, 0, 40);
+
+  line_time = lv_line_create(lv_scr_act(), nullptr);
+  lv_line_set_points(line_time, line_time_points, 3);
+  lv_obj_add_style(line_time, LV_LINE_PART_MAIN, &style_line);
+  lv_obj_align(line_time, nullptr, LV_ALIGN_IN_BOTTOM_RIGHT, 0, -25);
+
+  label_time_ampm = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_set_style_local_text_color(label_time_ampm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_label_set_text_static(label_time_ampm, "");
+  lv_obj_align(label_time_ampm, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 5, -5);
+
+  backgroundLabel = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_set_click(backgroundLabel, true);
+  lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP);
+  lv_obj_set_size(backgroundLabel, 240, 240);
+  lv_obj_set_pos(backgroundLabel, 0, 0);
+  lv_label_set_text_static(backgroundLabel, "");
+
+  heartbeatIcon = lv_label_create(lv_scr_act(), nullptr);
+  lv_label_set_text_static(heartbeatIcon, Symbols::heartBeat);
+  lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_obj_align(heartbeatIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 5, -2);
+
+  heartbeatValue = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_set_style_local_text_color(heartbeatValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_label_set_text_static(heartbeatValue, "");
+  lv_obj_align(heartbeatValue, heartbeatIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
+
+  stepValue = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_set_style_local_text_color(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_label_set_text_static(stepValue, "0");
+  lv_obj_align(stepValue, lv_scr_act(), LV_ALIGN_IN_BOTTOM_RIGHT, -5, -2);
+
+  stepIcon = lv_label_create(lv_scr_act(), nullptr);
+  lv_obj_set_style_local_text_color(stepIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+  lv_label_set_text_static(stepIcon, Symbols::shoe);
+  lv_obj_align(stepIcon, stepValue, LV_ALIGN_OUT_LEFT_MID, -5, 0);
+
+  taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
+  Refresh();
+}
+
+WatchFaceCasioStyleG7710::~WatchFaceCasioStyleG7710() {
+  lv_task_del(taskRefresh);
+
+  lv_style_reset(&style_line);
+  lv_style_reset(&style_border);
+
+  if (font_dot40 != nullptr) {
+    lv_font_free(font_dot40);
+  }
+
+  if (font_segment40 != nullptr) {
+    lv_font_free(font_segment40);
+  }
+
+  if (font_segment115 != nullptr) {
+    lv_font_free(font_segment115);
+  }
+
+  lv_obj_clean(lv_scr_act());
+}
+
+void WatchFaceCasioStyleG7710::Refresh() {
+  powerPresent = batteryController.IsPowerPresent();
+  if (powerPresent.IsUpdated()) {
+    lv_label_set_text_static(batteryPlug, BatteryIcon::GetPlugIcon(powerPresent.Get()));
+  }
+
+  batteryPercentRemaining = batteryController.PercentRemaining();
+  if (batteryPercentRemaining.IsUpdated()) {
+    auto batteryPercent = batteryPercentRemaining.Get();
+    batteryIcon.SetBatteryPercentage(batteryPercent);
+    lv_label_set_text_fmt(label_battery_vallue, "%d%%", batteryPercent);
+  }
+
+  bleState = bleController.IsConnected();
+  bleRadioEnabled = bleController.IsRadioEnabled();
+  if (bleState.IsUpdated() || bleRadioEnabled.IsUpdated()) {
+    lv_label_set_text_static(bleIcon, BleIcon::GetIcon(bleState.Get()));
+  }
+  lv_obj_realign(label_battery_vallue);
+  lv_obj_realign(batteryIcon.GetObject());
+  lv_obj_realign(batteryPlug);
+  lv_obj_realign(bleIcon);
+  lv_obj_realign(notificationIcon);
+
+  notificationState = notificatioManager.AreNewNotificationsAvailable();
+  if (notificationState.IsUpdated()) {
+    lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(notificationState.Get()));
+  }
+
+  currentDateTime = dateTimeController.CurrentDateTime();
+
+  if (currentDateTime.IsUpdated()) {
+    auto newDateTime = currentDateTime.Get();
+
+    auto dp = date::floor<date::days>(newDateTime);
+    auto time = date::make_time(newDateTime - dp);
+    auto yearMonthDay = date::year_month_day(dp);
+
+    auto year = static_cast<int>(yearMonthDay.year());
+    auto month = static_cast<Pinetime::Controllers::DateTime::Months>(static_cast<unsigned>(yearMonthDay.month()));
+    auto day = static_cast<unsigned>(yearMonthDay.day());
+    auto dayOfWeek = static_cast<Pinetime::Controllers::DateTime::Days>(date::weekday(yearMonthDay).iso_encoding());
+
+    uint8_t hour = time.hours().count();
+    uint8_t minute = time.minutes().count();
+    auto weekNumberFormat = "%V";
+
+    if (displayedHour != hour || displayedMinute != minute) {
+      displayedHour = hour;
+      displayedMinute = minute;
+
+      if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) {
+        char ampmChar[2] = "A";
+        if (hour == 0) {
+          hour = 12;
+        } else if (hour == 12) {
+          ampmChar[0] = 'P';
+        } else if (hour > 12) {
+          hour = hour - 12;
+          ampmChar[0] = 'P';
+        }
+        lv_label_set_text(label_time_ampm, ampmChar);
+        lv_label_set_text_fmt(label_time, "%2d:%02d", hour, minute);
+        lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_CENTER, 0, 40);
+      } else {
+        lv_label_set_text_fmt(label_time, "%02d:%02d", hour, minute);
+        lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_CENTER, 0, 40);
+      }
+    }
+
+    if ((year != currentYear) || (month != currentMonth) || (dayOfWeek != currentDayOfWeek) || (day != currentDay)) {
+      if (settingsController.GetClockType() == Controllers::Settings::ClockType::H24) {
+        // 24h mode: ddmmyyyy, first DOW=Monday;
+        lv_label_set_text_fmt(label_date, "%3d-%2d", day, month);
+        weekNumberFormat = "%V"; // Replaced by the week number of the year (Monday as the first day of the week) as a decimal number
+                                 // [01,53]. If the week containing 1 January has four or more days in the new year, then it is considered
+                                 // week 1. Otherwise, it is the last week of the previous year, and the next week is week 1. Both January
+                                 // 4th and the first Thursday of January are always in week 1. [ tm_year, tm_wday, tm_yday]
+      } else {
+        // 12h mode: mmddyyyy, first DOW=Sunday;
+        lv_label_set_text_fmt(label_date, "%3d-%2d", month, day);
+        weekNumberFormat = "%U"; // Replaced by the week number of the year as a decimal number [00,53]. The first Sunday of January is the
+                                 // first day of week 1; days in the new year before this are in week 0. [ tm_year, tm_wday, tm_yday]
+      }
+
+      uint8_t weekNumber;
+      uint16_t dayOfYearNumber, daysTillEndOfYearNumber;
+
+      time_t ttTime =
+        std::chrono::system_clock::to_time_t(std::chrono::time_point_cast<std::chrono::system_clock::duration>(currentDateTime.Get()));
+      tm* tmTime = std::localtime(&ttTime);
+
+      dayOfYearNumber = tmTime->tm_yday + 1; //  tm_yday  day of year [0,365] => yday+1
+      daysTillEndOfYearNumber = (yearMonthDay.year().is_leap() ? 366 : 365) - dayOfYearNumber;
+
+      char buffer[8];
+      strftime(buffer, 8, weekNumberFormat, tmTime);
+      weekNumber = atoi(buffer);
+
+      lv_label_set_text_fmt(label_day_of_week, "%s", dateTimeController.DayOfWeekShortToString());
+      lv_label_set_text_fmt(label_day_of_year, "%3d-%3d", dayOfYearNumber, daysTillEndOfYearNumber);
+      lv_label_set_text_fmt(label_week_number, "WK%02d", weekNumber);
+
+      lv_obj_realign(label_day_of_week);
+      lv_obj_realign(label_day_of_year);
+      lv_obj_realign(label_week_number);
+      lv_obj_realign(label_date);
+
+      currentYear = year;
+      currentMonth = month;
+      currentDayOfWeek = dayOfWeek;
+      currentDay = day;
+    }
+  }
+
+  heartbeat = heartRateController.HeartRate();
+  heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped;
+  if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) {
+    if (heartbeatRunning.Get()) {
+      lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
+      lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get());
+    } else {
+      lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x1B1B1B));
+      lv_label_set_text_static(heartbeatValue, "");
+    }
+
+    lv_obj_realign(heartbeatIcon);
+    lv_obj_realign(heartbeatValue);
+  }
+
+  stepCount = motionController.NbSteps();
+  motionSensorOk = motionController.IsSensorOk();
+  if (stepCount.IsUpdated() || motionSensorOk.IsUpdated()) {
+    lv_label_set_text_fmt(stepValue, "%lu", stepCount.Get());
+    lv_obj_realign(stepValue);
+    lv_obj_realign(stepIcon);
+  }
+}




diff --git a/src/displayapp/screens/WatchFaceCasioStyleG7710.h b/src/displayapp/screens/WatchFaceCasioStyleG7710.h
new file mode 100644
index 0000000000000000000000000000000000000000..c3821205b4288e3877c07fd228bc96e1840e3496
--- /dev/null
+++ b/src/displayapp/screens/WatchFaceCasioStyleG7710.h
@@ -0,0 +1,109 @@
+#pragma once
+
+#include <displayapp/screens/BatteryIcon.h>
+#include <lvgl/src/lv_core/lv_obj.h>
+#include <chrono>
+#include <cstdint>
+#include <memory>
+#include "displayapp/screens/Screen.h"
+#include "components/datetime/DateTimeController.h"
+#include "components/ble/BleController.h"
+
+namespace Pinetime {
+  namespace Controllers {
+    class Settings;
+    class Battery;
+    class Ble;
+    class NotificationManager;
+    class HeartRateController;
+    class MotionController;
+  }
+
+  namespace Applications {
+    namespace Screens {
+
+      class WatchFaceCasioStyleG7710 : public Screen {
+      public:
+        WatchFaceCasioStyleG7710(DisplayApp* app,
+                                 Controllers::DateTime& dateTimeController,
+                                 Controllers::Battery& batteryController,
+                                 Controllers::Ble& bleController,
+                                 Controllers::NotificationManager& notificatioManager,
+                                 Controllers::Settings& settingsController,
+                                 Controllers::HeartRateController& heartRateController,
+                                 Controllers::MotionController& motionController,
+                                 Controllers::FS& filesystem);
+        ~WatchFaceCasioStyleG7710() override;
+
+        void Refresh() override;
+
+      private:
+        uint8_t displayedHour = -1;
+        uint8_t displayedMinute = -1;
+
+        uint16_t currentYear = 1970;
+        Controllers::DateTime::Months currentMonth = Pinetime::Controllers::DateTime::Months::Unknown;
+        Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown;
+        uint8_t currentDay = 0;
+
+        DirtyValue<uint8_t> batteryPercentRemaining {};
+        DirtyValue<bool> powerPresent {};
+        DirtyValue<bool> bleState {};
+        DirtyValue<bool> bleRadioEnabled {};
+        DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime {};
+        DirtyValue<bool> motionSensorOk {};
+        DirtyValue<uint32_t> stepCount {};
+        DirtyValue<uint8_t> heartbeat {};
+        DirtyValue<bool> heartbeatRunning {};
+        DirtyValue<bool> notificationState {};
+
+        lv_point_t line_icons_points[3] {{0, 5}, {117, 5}, {122, 0}};
+        lv_point_t line_day_of_week_number_points[4] {{0, 0}, {100, 0}, {95, 95}, {0, 95}};
+        lv_point_t line_day_of_year_points[3] {{0, 5}, {130, 5}, {135, 0}};
+        lv_point_t line_date_points[3] {{0, 5}, {135, 5}, {140, 0}};
+        lv_point_t line_time_points[3] {{0, 0}, {230, 0}, {235, 5}};
+
+        lv_color_t color_text = lv_color_hex(0x98B69A);
+
+        lv_style_t style_line;
+        lv_style_t style_border;
+
+        lv_obj_t* label_time;
+        lv_obj_t* line_time;
+        lv_obj_t* label_time_ampm;
+        lv_obj_t* label_date;
+        lv_obj_t* line_date;
+        lv_obj_t* label_day_of_week;
+        lv_obj_t* label_week_number;
+        lv_obj_t* line_day_of_week_number;
+        lv_obj_t* label_day_of_year;
+        lv_obj_t* line_day_of_year;
+        lv_obj_t* backgroundLabel;
+        lv_obj_t* bleIcon;
+        lv_obj_t* batteryPlug;
+        lv_obj_t* label_battery_vallue;
+        lv_obj_t* heartbeatIcon;
+        lv_obj_t* heartbeatValue;
+        lv_obj_t* stepIcon;
+        lv_obj_t* stepValue;
+        lv_obj_t* notificationIcon;
+        lv_obj_t* line_icons;
+
+        BatteryIcon batteryIcon;
+
+        Controllers::DateTime& dateTimeController;
+        Controllers::Battery& batteryController;
+        Controllers::Ble& bleController;
+        Controllers::NotificationManager& notificatioManager;
+        Controllers::Settings& settingsController;
+        Controllers::HeartRateController& heartRateController;
+        Controllers::MotionController& motionController;
+
+        lv_task_t* taskRefresh;
+        lv_font_t* font_dot40 = nullptr;
+        lv_font_t* font_segment40 = nullptr;
+        lv_font_t* font_segment115 = nullptr;
+      };
+    }
+  }
+}




diff --git a/src/displayapp/screens/WatchFaceInfineat.cpp b/src/displayapp/screens/WatchFaceInfineat.cpp
index e3ed1bf7964c919f8235f3f24072beec3d670195..ae3f3dbb36aebc1c3b5e2900f0391f3e0b796d27 100644
--- a/src/displayapp/screens/WatchFaceInfineat.cpp
+++ b/src/displayapp/screens/WatchFaceInfineat.cpp
@@ -27,7 +27,7 @@                                      Controllers::Ble& bleController,
                                      Controllers::NotificationManager& notificationManager,
                                      Controllers::Settings& settingsController,
                                      Controllers::MotionController& motionController,
-                                     Controllers::FS& fs)
+                                     Controllers::FS& filesystem)
   : Screen(app),
     currentDateTime {{}},
     dateTimeController {dateTimeController},
@@ -37,11 +37,13 @@     notificationManager {notificationManager},
     settingsController {settingsController},
     motionController {motionController} {
   lfs_file f = {};
-  if (fs.FileOpen(&f, "/fonts/teko.bin", LFS_O_RDONLY) >= 0) {
+  if (filesystem.FileOpen(&f, "/fonts/teko.bin", LFS_O_RDONLY) >= 0) {
+    filesystem.FileClose(&f);
     font_teko = lv_font_load("F:/fonts/teko.bin");
   }
 
-  if (fs.FileOpen(&f, "/fonts/bebas.bin", LFS_O_RDONLY) >= 0) {
+  if (filesystem.FileOpen(&f, "/fonts/bebas.bin", LFS_O_RDONLY) >= 0) {
+    filesystem.FileClose(&f);
     font_bebas = lv_font_load("F:/fonts/bebas.bin");
   }
 




diff --git a/src/displayapp/screens/settings/SettingWatchFace.cpp b/src/displayapp/screens/settings/SettingWatchFace.cpp
index bd2f349c3efea20bad7970221d35a025a8559f2a..411cc898c9a57b9a4e03386580ced3595c9641ff 100644
--- a/src/displayapp/screens/settings/SettingWatchFace.cpp
+++ b/src/displayapp/screens/settings/SettingWatchFace.cpp
@@ -49,7 +49,7 @@                                                  watchfaces);
 }
 
 std::unique_ptr<Screen> SettingWatchFace::CreateScreen2() {
-  std::array<const char*, 4> watchfaces {"Infineat face", "", "", ""};
+  std::array<const char*, 4> watchfaces {"Infineat face", "Casio G7710", "", ""};
   return std::make_unique<Screens::CheckboxList>(1,
                                                  2,
                                                  app,