-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Documentation/doc clock face #2281
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
Open
mzrinsky
wants to merge
7
commits into
InfiniTimeOrg:main
Choose a base branch
from
mzrinsky:documentation/doc-clock-face
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
27e876f
Adding Documentation for tips on adding new watch face
bmsleight eaf27f6
Update README.md - based upon
bmsleight 136e4d0
Updated Watchfaces based upon feedback
bmsleight 74eac71
Updated to WatchFaceNew based upon feedback from @minacode
bmsleight af0bc71
Merge remote-tracking branch 'itorg/main' into documentation/doc-cloc…
mzrinsky dbfab3f
Updating the docs for new watch faces.
mzrinsky 2e9ba73
Some rework items.
mzrinsky File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,97 @@ | ||||||
# Add Watchfaces | ||||||
|
||||||
This page will help you to add a new Watch Face to InfiniTime. | ||||||
|
||||||
## Theory | ||||||
|
||||||
This example uses the existing Digital Watch Face, and copies it to a new watch face as a starting point. | ||||||
|
||||||
## Files | ||||||
|
||||||
- displayapp/UserApps.h | ||||||
- displayapp/apps/Apps.h.in | ||||||
- displayapp/apps/CMakeLists.txt | ||||||
- displayapp/screens/WatchFaceNew.cpp | ||||||
- displayapp/screens/WatchFaceNew.h | ||||||
- CMakeLists.txt | ||||||
|
||||||
### Branch and Copy | ||||||
|
||||||
Use git to fork and get a local copy (commands not shown). | ||||||
|
||||||
Then with all the submodules updated add a branch and copy the watch face files | ||||||
|
||||||
```bash | ||||||
git submodule update --init | ||||||
git switch -c Watchface_New | ||||||
cp ./src/displayapp/screens/WatchFaceDigital.cpp ./src/displayapp/screens/WatchFaceNew.cpp | ||||||
cp ./src/displayapp/screens/WatchFaceDigital.h ./src/displayapp/screens/WatchFaceNew.h | ||||||
``` | ||||||
|
||||||
### Amend Files | ||||||
|
||||||
Use sed to update `WatchFaceDigital` in the newly copied files with `WatchFaceNew` as well as update the `WatchFace::Digital` type to `WatchFace::NewType`. | ||||||
|
||||||
```bash | ||||||
sed -i 's/WatchFaceDigital/WatchFaceNew/' src/displayapp/screens/WatchFaceNew.cpp src/displayapp/screens/WatchFaceNew.h | ||||||
sed -i 's/WatchFace::Digital/WatchFace::NewType/' src/displayapp/screens/WatchFaceNew.h | ||||||
``` | ||||||
|
||||||
In UserApps.h add include for the new Watch Face. | ||||||
|
||||||
./src/displayapp/UserApps.h: | ||||||
|
||||||
```cpp | ||||||
... | ||||||
#include "displayapp/screens/WatchFaceNew.h" | ||||||
``` | ||||||
|
||||||
In Apps.h.in add the type from WatchFaceNew.h. | ||||||
|
||||||
./src/displayapp/apps/Apps.h.in: | ||||||
|
||||||
```cpp | ||||||
enum class WatchFace : uint8_t { | ||||||
... | ||||||
CasioStyleG7710, | ||||||
NewType, | ||||||
``` | ||||||
|
||||||
In CMakeLists.txt add the type to the DEFAULT_WATCHFACE_TYPES so that it is included in the firmware. | ||||||
|
||||||
./src/displayapp/apps/CMakeLists.txt: | ||||||
|
||||||
```cmake | ||||||
... | ||||||
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::CasioStyleG7710") | ||||||
set(DEFAULT_WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}, WatchFace::NewType") | ||||||
``` | ||||||
|
||||||
In CMakeLists.txt include the WatchFaceNew.cpp source file. | ||||||
|
||||||
./src/CMakeLists.txt: | ||||||
|
||||||
```cpp | ||||||
... | ||||||
displayapp/screens/WatchFacePineTimeStyle.cpp | ||||||
displayapp/screens/WatchFaceCasioStyleG7710.cpp | ||||||
displayapp/screens/WatchFaceNew.cpp | ||||||
``` | ||||||
|
||||||
## Test Copied Watch Face | ||||||
|
||||||
At this point - assuming you have [InfiniTime simulator](https://github.com/InfiniTimeOrg/InfiniSim) locally installed. It is a good time to test. | ||||||
|
||||||
If you already have a `build/CMakeCache.txt` it will prevent your new watch face from being included in the build, so you will need to pass the `--fresh` argument to `cmake` or remove `build/CMakeCache.txt` before building. (The value of DEFAULT_WATCHFACE_TYPES is cached.) | ||||||
|
||||||
## Amending the Watch Face to Suit | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
Start editing and ammended WatchFaceNew.cpp to suit your tastes. To save space on the firmware, use existing fonts. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
No need to talk about amending here. Editing covers all of the needed work. |
||||||
|
||||||
## Finish | ||||||
|
||||||
You should now be able to [build](../buildAndProgram.md) the firmware | ||||||
and flash it to your PineTime. Yay! | ||||||
|
||||||
Please remember to pay attention to the [UI guidelines](../ui_guidelines.md) | ||||||
when designing an app or Watch Face that you want to be included in InfiniTime. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to be imply this requires sed. You can tell the reader to copy the files and replace the text and then show the sed as a suggestion. Some people will want to do that in their editor or honestly not know the Unix tooling. (yeah, I know, but not everyone loves the terminal like us ....)