Skip to content

Commit

Permalink
Layout changes (#22)
Browse files Browse the repository at this point in the history
* Added weather icons

* Update README.md

* First impl draft; Updated icons

* Fixed weather update

* Updated icons

* Updated version

* Updated icons; Fixed weather mapping

* Updated from SDK5 to SDK6

* Added permission check

* Updated logs

* Updated settings title

* Fixed minor stuff

* Fixed build artifacts

* Fixed info updates

* Fixed default weather icon

* Added battery settings

* Changed info layout

* Updated version; Fixed ru-RU.po

* Removed permission check

* Added permission check + warnings

* Fixed some stuff

* Updated docu

* Fixed typo

* Fixed layout

* Fixed Ionic layout

* Cleanup constraint

Co-authored-by: smirko-dev <[email protected]>
  • Loading branch information
smirko-dev and smirko-dev authored Mar 5, 2022
1 parent 33b62dc commit 76d7313
Show file tree
Hide file tree
Showing 50 changed files with 551 additions and 131 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/FitbitBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,18 @@ jobs:
- name: Run Build
run: npx fitbit-build --if-present

- name: Copy App
run: cp build/app.fba build/app.sdk4.fba

- name: Upload artifact
uses: actions/upload-artifact@v2
if: ${{ success() }}
with:
path: build/app.fba
path: build/app.sdk4.fba
if-no-files-found: error

build-sdk5:
name: Build SDK5
build-sdk6:
name: Build SDK6
runs-on: ubuntu-latest

steps:
Expand All @@ -56,8 +59,8 @@ jobs:
- name: Setup node
uses: actions/setup-node@v1

- name: Select SDK 5
run: cp package.sdk5.json package.json
- name: Select SDK 6
run: cp package.sdk6.json package.json

- name: Checkout Fitbit SDK
run: npm add --also=dev @fitbit/sdk
Expand All @@ -68,9 +71,12 @@ jobs:
- name: Run Build
run: npx fitbit-build --if-present

- name: Copy App
run: cp build/app.fba build/app.sdk6.fba

- name: Upload artifact
uses: actions/upload-artifact@v2
if: ${{ success() }}
with:
path: build/app.fba
path: build/app.sdk6.fba
if-no-files-found: error
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,23 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Version 1.7.0

### Changed
- Replaced battery toggle by info selection (battery, weather, none)

### Removed
- Weather from activity selection

## Version 1.6.0

### Added
- Added weather info
- Added show battery settings

### Changed
- Updated from SDK5 to SDK6

## Version 1.5.2

### Added
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![](https://img.shields.io/badge/Fitbit%20App%20Gallery-%2300B0B9?style=flat&logo=fitbit&logoColor=white)](https://gallery.fitbit.com/details/ae441b73-2660-407f-b796-a98d1d0583a0)
![languages](https://img.shields.io/badge/languages-JavaScript%20|%20CSS-blue)
![platform](https://img.shields.io/badge/platforms-Ionic%20|%20Versa%20|%20Versa%202%20|%20Versa%20Lite%20|%20Versa%203%20|%20Sense-silver)
[![version](https://img.shields.io/badge/version-%201.5.2-blue)](https://github.com/smirko-dev/fitbit-clockface/blob/master/CHANGELOG.md)
[![version](https://img.shields.io/badge/version-%201.7.0-blue)](https://github.com/smirko-dev/fitbit-clockface/blob/master/CHANGELOG.md)
[![](https://img.shields.io/badge/license-MIT-blue)](https://github.com/smirko-dev/fitbit-clockface/blob/master/LICENSE)
[![FitbitBuild Actions Status](https://github.com/smirko-dev/fitbit-clockface/workflows/FitbitBuild/badge.svg)](https://github.com/smirko-dev/fitbit-clockface/actions)
[![CodeQL Actions Status](https://github.com/smirko-dev/fitbit-clockface/workflows/CodeQL/badge.svg)](https://github.com/smirko-dev/fitbit-clockface/actions)
Expand All @@ -14,17 +14,23 @@ This is a simple clock face for Fitbit.
It comes with
- time (12/24hr format), date (including weekday)
- languages: de-DE, en-US
- battery icon (Ionic: and status in percentage)
- next calendar event of the current day
- user activity in case of no events (selectable in settings menu)
- additional info
- battery icon (Ionic: and status in percentage)
- current weather
- user activity in case of no events
- steps
- distance
- floors
- calories
- six color schemes (selectable in settings menu)
- touch to hide calendar event temporarily

Find the latest published version in the [Fitbit gallery](https://gallery.fitbit.com/details/ae441b73-2660-407f-b796-a98d1d0583a0).

The clockface is based on https://github.com/Fitbit/sdk-calendar-clock/ and https://github.com/Fitbit/sdk-weather-clock.

Icons are from https://materialdesignicons.com/ ([Apache license version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html)) and from https://github.com/Fitbit/sdk-design-assets.
Icons are from https://materialdesignicons.com/ ([Apache license version 2.0](https://www.apache.org/licenses/LICENSE-2.0.html)) and from https://github.com/Fitbit/sdk-design-assets ([Design Asset License](https://github.com/Fitbit/sdk-design-assets/blob/master/LICENCE.txt)).

## Screenshots

Expand All @@ -37,7 +43,7 @@ Choose SDK version
| SDK | Device |
|-----|-----------------------------------|
| 4 | Versa, Versa Lite, Versa 2, Ionic |
| 5 | Versa 3, Sense |
| 6 | Versa 3, Sense |

```
cp package.sdkX.json package.json
Expand Down
19 changes: 11 additions & 8 deletions app/appointment.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { inbox } from "file-transfer";
import { readFileSync } from "fs";

import { dataFile, dataType } from "../common/constants";
import { calendarFile, calendarType } from "../common/constants";
import { toEpochSec } from "../common/utils";

let data;
let handleCalendarUpdatedCallback;
let handleCallback;

export function initialize(callback) {
handleCalendarUpdatedCallback = callback;
handleCallback = callback;
data = loadData();
inbox.addEventListener("newfile", fileHandler);
fileHandler();
Expand Down Expand Up @@ -43,14 +43,17 @@ function fileHandler() {
let fileName;
do {
fileName = inbox.nextFile();
data = loadData();
updatedData();
if (fileName === calendarFile) {
console.log('Load ' + fileName);
data = loadData();
updatedData();
}
} while (fileName);
}

function loadData() {
try {
return readFileSync(`/private/data/${dataFile}`, dataType);
return readFileSync(`/private/data/${calendarFile}`, calendarType);
} catch (ex) {
console.error(`Appointment: loadData() failed. ${ex}`);
return;
Expand All @@ -66,7 +69,7 @@ function existsData() {
}

function updatedData() {
if (typeof handleCalendarUpdatedCallback === "function" && existsData()) {
handleCalendarUpdatedCallback();
if (typeof handleCallback === "function" && existsData()) {
handleCallback();
}
}
22 changes: 11 additions & 11 deletions app/i18n/de-DE.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,37 @@ msgid "saturday"
msgstr "Samstag"

msgid "january"
msgstr "Januar"
msgstr "Jan"

msgid "february"
msgstr "Februar"
msgstr "Feb"

msgid "march"
msgstr "März"
msgstr "Mär"

msgid "april"
msgstr "April"
msgstr "Apr"

msgid "may"
msgstr "Mai"

msgid "june"
msgstr "Juni"
msgstr "Jun"

msgid "july"
msgstr "Juli"
msgstr "Jul"

msgid "august"
msgstr "August"
msgstr "Aug"

msgid "september"
msgstr "September"
msgstr "Sep"

msgid "october"
msgstr "Oktober"
msgstr "Okt"

msgid "november"
msgstr "November"
msgstr "Nov"

msgid "december"
msgstr "Dezember"
msgstr "Dez"
22 changes: 11 additions & 11 deletions app/i18n/en-US.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,37 @@ msgid "saturday"
msgstr "Saturday"

msgid "january"
msgstr "January"
msgstr "Jan"

msgid "february"
msgstr "February"
msgstr "Feb"

msgid "march"
msgstr "March"
msgstr "Mar"

msgid "april"
msgstr "April"
msgstr "Apr"

msgid "may"
msgstr "May"

msgid "june"
msgstr "June"
msgstr "Jun"

msgid "july"
msgstr "July"
msgstr "Jul"

msgid "august"
msgstr "August"
msgstr "Aug"

msgid "september"
msgstr "September"
msgstr "Sep"

msgid "october"
msgstr "October"
msgstr "Oct"

msgid "november"
msgstr "November"
msgstr "Nov"

msgid "december"
msgstr "December"
msgstr "Dec"
22 changes: 11 additions & 11 deletions app/i18n/ru-RU.po
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,37 @@ msgid "saturday"
msgstr "суббота"

msgid "january"
msgstr "январь"
msgstr "янв"

msgid "february"
msgstr "февраль"
msgstr "фев"

msgid "march"
msgstr "март"
msgstr "мар"

msgid "april"
msgstr "апрель"
msgstr "апр"

msgid "may"
msgstr "май"

msgid "june"
msgstr "июнь"
msgstr "июн"

msgid "july"
msgstr "июль"
msgstr "июл"

msgid "august"
msgstr "август"
msgstr "авг"

msgid "september"
msgstr "сентябрь"
msgstr "сент"

msgid "october"
msgstr "октябрь"
msgstr "окт"

msgid "november"
msgstr "ноябрь"
msgstr "ноя"

msgid "december"
msgstr "декабрь"
msgstr "дек"
Loading

0 comments on commit 76d7313

Please sign in to comment.