-
Notifications
You must be signed in to change notification settings - Fork 23
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
Watchface #7
Comments
Thats good to hear. Sadly beside copying all files from your Greatfit Watchface into my project, i don't know where to start. |
I am already working on the documentation... If you want to experiment a little, edit the following file, this is where AM/PM is shown (wifi/BT status are in development too): "init" runs once when the watchface is selected and then screen-on is constantly refreshed through the "draw" function. On the other hand, screen-off is made through "buildSlptViewComponent". Data are refreshed in "onDataUpdate" (when screen is on "draw" is constantly refreshed but when screen is off the refresh is not constant). There are 2 ways to show your data. You either save them through your widget somewhere (for example in Settings.System, if possible and then you load them like on line 63) and you just get them and show them OR you directly connect to your phone through the watchface (like your widget does). I recomend the first option. So, you somehow get the data you want to display in a variable and then in "draw" function you just draw them on the canvas, ex: canvas.drawText("my data", 10, 10, textPaint); //numbers are left and top positions, leave textPaint or define a new font-size etc In order for your data to be updated, you have to re-save the new data (if any) in the variable they are saved through "onDataUpdate" function. Screen off is a little more complicated. Start with the screen-on and i can help you then with the locked screen. |
Ha, even copying your files seems to be very complicate :-( |
atm i'm trying to write and read from settings |
This project can also include a watchface.
The data must be saved in a system value (and be updated) and then the watchface can show them. The only problem is the update interval (the locked screen updates in specific cases). A work around could be updating the watchface every time calories,heart rate or weather is updated...
The text was updated successfully, but these errors were encountered: