Skip to content

background for analog watch face in lvgl - #1824

Merged
FintasticMan merged 3 commits into
InfiniTimeOrg:mainfrom
minacode:gauge
Aug 15, 2023
Merged

background for analog watch face in lvgl#1824
FintasticMan merged 3 commits into
InfiniTimeOrg:mainfrom
minacode:gauge

Conversation

@minacode

@minacode minacode commented Aug 8, 2023

Copy link
Copy Markdown
Contributor

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

github-actions Bot commented Aug 8, 2023

Copy link
Copy Markdown

Build size and comparison to main:

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

@FintasticMan FintasticMan left a comment

Copy link
Copy Markdown
Member

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.

Comment thread src/displayapp/screens/WatchFaceAnalog.cpp Outdated
@FintasticMan FintasticMan added maintenance Background work UI/UX User interface/User experience labels Aug 8, 2023

@FintasticMan FintasticMan left a comment

Copy link
Copy Markdown
Member

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

minacode commented Aug 8, 2023

Copy link
Copy Markdown
Contributor Author

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

@NeroBurner

Copy link
Copy Markdown
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

minacode commented Aug 9, 2023

Copy link
Copy Markdown
Contributor Author

Which number do you need?

Memory heap
Free 19576
Min free 9896

@FintasticMan

FintasticMan commented Aug 9, 2023

Copy link
Copy Markdown
Member

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

minacode commented Aug 9, 2023

Copy link
Copy Markdown
Contributor Author

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

@FintasticMan

Copy link
Copy Markdown
Member

xPortGetFreeHeapSize()

@88572

88572 commented Aug 9, 2023

Copy link
Copy Markdown
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

minacode commented Aug 9, 2023

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
Member

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

@Boteium

Boteium commented Aug 12, 2023

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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

@JF002

JF002 commented Aug 13, 2023

Copy link
Copy Markdown
Collaborator

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!

@JF002 JF002 left a comment

Copy link
Copy Markdown
Collaborator

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!

@FintasticMan FintasticMan left a comment

Copy link
Copy Markdown
Member

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
@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 <minamoto9@web.de>
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