Skip to content

Conversation

@liamcharger
Copy link
Contributor

@liamcharger liamcharger commented Mar 30, 2024

This PR adds a Numeral watch face, with inspiration from Apple Watch's numeral watch face. An image is attached below.
InfiniSim_2024-03-31_045911

@liamcharger liamcharger changed the title Numeral watch face Watchface: Numerals Mar 30, 2024
@github-actions
Copy link

github-actions bot commented Mar 30, 2024

Build size and comparison to main:

Section Size Difference
text 386544B 1312B
data 944B 0B
bss 22640B 0B

Run in InfiniEmu

@NeroBurner NeroBurner added the new watchface This thread is about a new watchface label Oct 1, 2024
Copy link
Member

@mark9064 mark9064 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great from the screenshot! I'll give this a test run after any changes from feedback are in

@liamcharger liamcharger requested a review from mark9064 October 27, 2024 14:53
@mark9064
Copy link
Member

I'll test this on my PT shortly and review after

Copy link
Member

@mark9064 mark9064 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The font ranges at the moment are very large, and the watchface cannot load (too much memory)

With these changes it works and everything seems as expected 😄

@liamcharger
Copy link
Contributor Author

Gotcha, I'll make a commit when I have the chance!

@liamcharger liamcharger requested a review from mark9064 January 2, 2025 15:10
Copy link
Member

@mark9064 mark9064 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the slow review! I'm very busy, and there are many PRs. I think this is almost there!

Controllers::DateTime::Days currentDayOfWeek = Pinetime::Controllers::DateTime::Days::Unknown;
uint8_t currentDay = 0;
Utility::DirtyValue<bool> notificationState {};
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds>> currentDateTime {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of storing all of the current day/hour/etc as variables, how about having two time points:

Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::minutes>> currentDateTime;
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::days>> currentDate;

Then if the currentDateTime is updated, redraw hours and minutes / AM/PM. Then set currentDate to std::chrono::time_point_cast<std::chrono::days>(currentDateTime.Get());, and see if currentDate is updated. If so, then redraw the day, day of week etc

Make sure to remove the variables that are unused after this


dateDay = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(dateDay, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
lv_label_set_text(dateDay, "--");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is about to be set in Refresh(), is it possible to skip giving it a value here? Same goes for the day of week

lfs_file f = {};
if (filesystem.FileOpen(&f, "/fonts/rounded_large.bin", LFS_O_RDONLY) >= 0) {
filesystem.FileClose(&f);
font_large = lv_font_load("F:/fonts/rounded_large.bin");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be camelCase

labelTimeAMPM1 = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_text_static(labelTimeAMPM1, "");
lv_obj_set_style_local_text_font(labelTimeAMPM1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_small);
lv_obj_set_style_local_text_color(labelTimeAMPM1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this colour is being used a couple of times I think it would be best if were a static constexpr member of the class (i.e static constexpr lv_color_t AMPMColor = lv_color_hex(0x999999) or similar)

@CodeGuyEli
Copy link

Are there any plans to add this to the main firmware? I would love this as my watchface.

@mark9064
Copy link
Member

Waiting for @liamcharger to respond on review still. I think it's a good fit for InfiniTime :)

@liamcharger
Copy link
Contributor Author

Yep, I’ve just been busy :)

I fixed the conflicts and updated the branch with the GitHub UI, I’ll break into the code soon to finish the review :)

@CodeGuyEli
Copy link

CodeGuyEli commented Jan 20, 2026

When can we expect to see a 1.16.1 build with this watchface? (or maybe 1.17.0, I don't know the plan)

@liamcharger
Copy link
Contributor Author

It'll definitely won't be before 1.17. We would only push 1.16.1 update if there was a critical bug.

Anyways 1.17 would be a good bet. It just depends on how fast I finish out the review and what the maintainers decide to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new watchface This thread is about a new watchface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants