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

Refactor watch face to enum #1339

Merged
merged 11 commits into from
Apr 30, 2023
Merged

Conversation

minacode
Copy link
Contributor

@minacode minacode commented Sep 22, 2022

This PR introduces the same enum-implementation for watch faces that already exists for apps. I think it is cleaner than using uint8_t.
The implementation of CheckboxList uses uint32_t` internally, so there is a conversion in between.

  • test on hardware
  • set enum values explicitly

@minacode
Copy link
Contributor Author

I think we need to add another array to the CheckboxList with the values of each option. Right now, the values default to uint8_t indices, but we want to select watch faces. This also adds a generic type to the CheckboxList.

@minacode
Copy link
Contributor Author

minacode commented Oct 3, 2022

I guess I will put this PR on hold until #1351 is figured out.

@minacode minacode mentioned this pull request Oct 4, 2022
@NeroBurner NeroBurner marked this pull request as draft October 5, 2022 08:39
@minacode
Copy link
Contributor Author

minacode commented Nov 6, 2022

Testing results right now: pressing the settings button in the quick settings opens the quick settings again with an animation. The settings do not show at all.

@minacode
Copy link
Contributor Author

minacode commented Nov 26, 2022

New testing result: it runs all well, except the background image of the Infineat watch face is missing. The Casio watch face looks as expected.

Edit: My fault. I didn't remember that I turned off the background 😄
Then all should be good.

@minacode minacode marked this pull request as ready for review November 26, 2022 12:12
Copy link
Contributor

@Riksu9000 Riksu9000 left a comment

Choose a reason for hiding this comment

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

The commits should be fixed according to the commit conventions https://github.com/InfiniTimeOrg/InfiniTime/blob/develop/CONTRIBUTING.md#commit-conventions


namespace Pinetime {
namespace Applications {
enum class WatchFace : uint32_t {
Copy link
Contributor

Choose a reason for hiding this comment

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

By using uint8_t we should be able to avoid updating the settings version and avoid an unnecessary settings reset.

Copy link
Member

Choose a reason for hiding this comment

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

Yep, and to do that we would also need to explicitly give the enumerations values like with WakeUpMode, because otherwise the values are undefined.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

CheckboxList uses uint32_t. I still changed the enum to uint8_t since it should be fine.

@minacode
Copy link
Contributor Author

minacode commented Mar 4, 2023

Can I just squash them?

@github-actions
Copy link

github-actions bot commented Mar 4, 2023

Build size and comparison to main:

Section Size Difference
text 406376B -16B
data 940B 0B
bss 53544B 0B

@FintasticMan
Copy link
Member

I think you forgot to update the submodules in your local repo before committing.

@Riksu9000
Copy link
Contributor

All the commits seem to be fixing issues from previous commits, so they can all be squashed.

@minacode
Copy link
Contributor Author

minacode commented Apr 4, 2023

Given the current ideas regarding getting rid of the apps enum, I am not sure if this PR makes sense anymore.

@Riksu9000
Copy link
Contributor

I'm sure this PR would be merged if the issues were fixed.

@minacode
Copy link
Contributor Author

minacode commented Apr 5, 2023

Alright, here we go 😄

@minacode
Copy link
Contributor Author

minacode commented Apr 8, 2023

I tried it on my watch and there is a bug with the font on the casio watch face that doesn't happen when I'm on 1.12.
image

Copy link
Contributor

@Riksu9000 Riksu9000 left a comment

Choose a reason for hiding this comment

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

I don't think the issue relates to this PR. #1376

This can be squash merged.

@minacode
Copy link
Contributor Author

minacode commented Apr 11, 2023

Thank you. 😊 I wasn't aware of this issue anymore.

@JF002 JF002 merged commit 020a7fd into InfiniTimeOrg:main Apr 30, 2023
@JF002 JF002 added this to the 1.13.0 milestone Apr 30, 2023
@minacode minacode deleted the watch-face-enum branch May 1, 2023 18:24
NeroBurner pushed a commit to minacode/InfiniSim that referenced this pull request May 1, 2023
NeroBurner added a commit to InfiniTimeOrg/InfiniSim that referenced this pull request May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants