Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

background for analog watch face in lvgl #1824

Merged
merged 3 commits into from
Aug 15, 2023

Conversation

minacode
Copy link
Contributor

@minacode minacode commented Aug 8, 2023

Alternative to #1819.

This commit removes the background image for the WatchFaceAnalog and replaces it with lvgl widgets. It aims to keep the original look.

The refresh is almost instant now.

I am not sure at how much places the background image has to be removed. If someone knows more about that, please have a look at it.

Colors are up to debate 😁

  • runs currently on my watch without problems

InfiniSim_2023-08-08_123955

This commit removes the background image for the WatchFaceAnalog and replaces it with lvgl widgets. It aims to keep the original look.
@github-actions
Copy link

github-actions bot commented Aug 8, 2023

Build size and comparison to main:

Section Size Difference
text 395204B -14096B
data 996B 0B
bss 63372B 0B

Copy link
Member

@FintasticMan FintasticMan left a comment

Choose a reason for hiding this comment

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

Looks good! You should just be able to remove the bg_clock.c file from CMakeLists.txt, then delete the file itself.

src/displayapp/screens/WatchFaceAnalog.cpp Outdated Show resolved Hide resolved
@FintasticMan FintasticMan added maintenance Background work UI/UX User interface/User experience labels Aug 8, 2023
Copy link
Member

@FintasticMan FintasticMan left a comment

Choose a reason for hiding this comment

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

I quite like this with the current colours. It might be nice to keep the 'PineTime' text, but I'm not sure we have the right font to make it look good. I would like some other people's opinions on how it looks before I approve this.

@FintasticMan FintasticMan requested a review from a team August 8, 2023 22:23
@minacode
Copy link
Contributor Author

minacode commented Aug 8, 2023

I tried it with 'PineTime' first and can confirm that it does not look good with the current font 😄

@NeroBurner
Copy link
Contributor

It would be interesting what the ram usage at runtime difference between this new and the old one with the background image is

@minacode
Copy link
Contributor Author

minacode commented Aug 9, 2023

Which number do you need?

Memory heap
Free 19576
Min free 9896

@FintasticMan
Copy link
Member

FintasticMan commented Aug 9, 2023

It would be better to use a label to display the current free memory on the watch face itself, because the face is unloaded when you go to the about page to look at the memory. (assuming you don't have a debugger connected)

@minacode
Copy link
Contributor Author

minacode commented Aug 9, 2023

Makes sense. How can I get the current free memory?

@FintasticMan
Copy link
Member

xPortGetFreeHeapSize()

@everypizza1
Copy link
Contributor

I tried it with 'PineTime' first and can confirm that it does not look good with the current font 😄

Personally, I would like Fredoka 600 from Google Fonts.

@minacode
Copy link
Contributor Author

minacode commented Aug 9, 2023

Tbh, I like the watch face more without some brand label. Isn't it also possible (or at least a goal) to run InfiniTime on non-PineTime watches?

@FintasticMan
Copy link
Member

You're right, it is possible to run InfiniTime on other watches, currently only variations of the Colmi P8.

@Boteium
Copy link

Boteium commented Aug 12, 2023

Great Job !
It's a really clever use of lv_lmeter.
I would never think of it and would implement this in several lvgl objects.

@minacode
Copy link
Contributor Author

Here are the measurements:
New watch face: 16904 once, then 16744 constantly
Old watch face: 17536 once, then 17472 constantly

@JF002
Copy link
Collaborator

JF002 commented Aug 13, 2023

Great job! This effectively frees ~14KB in flash, which is not insignificant at all!

Here is a picture showing the original analog watchface and this one:
infinitime-analog-comparison

They look quite similar, IMO, except for the font size, obviously.

This PR also improve the drawing speed of the watchface :

infinitime-analog-comparison-l.mp4

RAM usage at runtime looks good. It allocates ~2.8KB in RAM (from the freeRTOS heap). The casio watchface (the one with the heaviest RAM usage) allocates ~12KB, so I guess we're good!

Copy link
Collaborator

@JF002 JF002 left a comment

Choose a reason for hiding this comment

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

This new implementation of the watch face looks good! I think the small visual differences are very much compensated by the amount of freed flash memory!

Copy link
Member

@FintasticMan FintasticMan left a comment

Choose a reason for hiding this comment

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

I agree.

@FintasticMan FintasticMan merged commit 6d0d8c7 into InfiniTimeOrg:main Aug 15, 2023
6 of 7 checks passed
@minacode minacode deleted the gauge branch August 15, 2023 11:37
@JF002 JF002 added this to the 1.14.0 milestone Aug 17, 2023
Zetabite pushed a commit to Zetabite/InfiniTime that referenced this pull request Nov 12, 2023
* change background image to widgets

This commit removes the background image for the WatchFaceAnalog and replaces it with lvgl widgets. It aims to keep the original look.

* remove comments and background image

---------

Co-authored-by: minacode <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Background work UI/UX User interface/User experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants