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

Consolidate common watch face code #431

Open
jonvmey opened this issue Jun 13, 2021 · 3 comments
Open

Consolidate common watch face code #431

jonvmey opened this issue Jun 13, 2021 · 3 comments
Labels
enhancement Enhancement to an existing app/feature

Comments

@jonvmey
Copy link
Contributor

jonvmey commented Jun 13, 2021

I'm thinking about refactoring the common parts of WatchFaceDigital and WatchFaceAnalog into a common base class. This should help reduce overall code size a little by eliminating duplicated code for similar functionality and make it easier for people to create new watch faces since they can start with some core features and not need to re-implement them themselves.

Everything related to drawing the watch face would be left up to the derived classes since that's the main thing that distinguishes them. The state management for things like date/time, battery charge level, BLE status, notifications, etc. would be provided by the base class.

Just looking for feedback on whether or not this seems worthwhile.

@Avamander
Copy link
Collaborator

I think this would be a good approach.

Though there's a very real chance that PineTimeStyle might be merged, so it might be a good idea to either wait for that to be merged first.

@kieranc
Copy link
Contributor

kieranc commented Jun 14, 2021

I agree that this is a good idea, with a view to easily swappable watchfaces in the future

@Avamander Avamander added the enhancement Enhancement to an existing app/feature label Oct 2, 2021
@Avamander Avamander mentioned this issue Oct 4, 2022
1 task
@riban-bw
Copy link

This may resolve issues with different behaviour between screens. Currently the analogue face does not use the StatusIcons class so it will not follow any changes made in that class. As an example, I changed the analaogue face to show a blue icon when BLE connected, grey when disconnected and hidden when disabled which only works in that face. Behaviour changes as you change views, e.g. accessing settings reverts to previous (white if connected, hidden if disconnected or disabled) behaviour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to an existing app/feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants