diff --git a/.github/workflows/CodeQL.yml b/.github/workflows/CodeQL.yml index 857db2f..6a8d382 100644 --- a/.github/workflows/CodeQL.yml +++ b/.github/workflows/CodeQL.yml @@ -13,10 +13,10 @@ name: "CodeQL" on: push: - branches: [ main ] + branches: [ master ] pull_request: # The branches below must be a subset of the branches above - branches: [ main ] + branches: [ master ] schedule: - cron: '41 16 * * 4' diff --git a/.github/workflows/FitbitBuild.yml b/.github/workflows/FitbitBuild.yml index 2bacd25..2643234 100644 --- a/.github/workflows/FitbitBuild.yml +++ b/.github/workflows/FitbitBuild.yml @@ -5,14 +5,14 @@ name: FitbitBuild on: push: - branches: [ main ] + branches: [ master ] pull_request: - branches: [ main ] + branches: [ master ] workflow_dispatch: jobs: - build: - name: Build + build-sdk4: + name: Build SDK4 runs-on: ubuntu-latest steps: @@ -24,6 +24,41 @@ jobs: - name: Setup node uses: actions/setup-node@v1 + - name: Select SDK 4 + run: cp package.sdk4.json package.json + + - name: Checkout Fitbit SDK + run: npm add --also=dev @fitbit/sdk + + - name: Checkout Fitbit SDK-CLI + run: npm add --also=dev @fitbit/sdk-cli + + - name: Run Build + run: npx fitbit-build --if-present + + - name: Upload artifact + uses: actions/upload-artifact@v2 + if: ${{ success() }} + with: + path: build/app.fba + if-no-files-found: error + + build-sdk5: + name: Build SDK5 + runs-on: ubuntu-latest + + steps: + - name: Checkout branch + uses: actions/checkout@v2 + with: + lfs: true + + - name: Setup node + uses: actions/setup-node@v1 + + - name: Select SDK 5 + run: cp package.sdk5.json package.json + - name: Checkout Fitbit SDK run: npm add --also=dev @fitbit/sdk diff --git a/.gitignore b/.gitignore index 687beb0..59238e6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /node_modules /build /package-lock.json +/package.json diff --git a/README.md b/README.md index 3dd861f..80041d8 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ [![](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-silver) -![version](https://img.shields.io/badge/version-%201.5.1-green) +![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-green) [![](https://img.shields.io/github/license/smirko-dev/fitbit-clockface.svg)](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) @@ -28,20 +28,22 @@ Icons are from https://materialdesignicons.com/ ([Apache license version 2.0](ht ## Screenshots -### Fitbit Ionic +![Activity](screenshots/activity.png) ![Event](screenshots/event.png) -![Ionic Appointment](screenshots/ionic-event.png) ![Ionic Activity](screenshots/ionic-activity.png) - -### Fitbit Versa - -![Versa 2 Appointment](screenshots/versa2-event.png) ![Versa 2 Activity](screenshots/versa2-activity.png) +## How to build -### Settings +Choose SDK version -![Settings](screenshots/settings.png) ![Activities](screenshots/activities.png) +| SDK | Device | +|-----|-----------------------------------| +| 4 | Versa, Versa Lite, Versa 2, Ionic | +| 5 | Versa 3, Sense | -## How to build +``` +cp package.sdkX.json package.json +``` +Run Fitbit CLI build ``` git clone git@github.com:smirko-dev/fitbit-clockface.git cd fitbit-clockface diff --git a/package.json b/package.sdk4.json similarity index 100% rename from package.json rename to package.sdk4.json diff --git a/package.sdk5.json b/package.sdk5.json new file mode 100644 index 0000000..bff0e8b --- /dev/null +++ b/package.sdk5.json @@ -0,0 +1,45 @@ +{ + "name": "compactclock", + "version": "1.5.2", + "license": "MIT", + "devDependencies": { + "@fitbit/sdk": "~5.0.0", + "@fitbit/sdk-cli": "^1.7.3" + }, + "bugs": { + "url": "https://github.com/smirko-dev/fitbit-clockface/issues" + }, + "repository": { + "type": "git", + "url": "https://github.com/smirko-dev/fitbit-clockface.git" + }, + "fitbit": { + "appUUID": "ae441b73-2660-407f-b796-a98d1d0583a0", + "appType": "clockface", + "appDisplayName": "CompactClock", + "iconFile": "resources/icon.png", + "wipeColor": "", + "requestedPermissions": [ + "access_calendar", + "run_background", + "access_activity" + ], + "buildTargets": [ + "atlas", + "vulcan" + ], + "i18n": { + "en-US": { + "name": "CompactClock" + }, + "de-DE": { + "name": "CompactClock" + } + }, + "defaultLanguage": "en-US" + }, + "scripts": { + "build": "fitbit-build", + "debug": "fitbit" + } +} diff --git a/resources/index.view b/resources/index.view new file mode 100644 index 0000000..d8c16d5 --- /dev/null +++ b/resources/index.view @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/resources/styles.css b/resources/styles.sdk4.css similarity index 100% rename from resources/styles.css rename to resources/styles.sdk4.css diff --git a/resources/styles.sdk5.css b/resources/styles.sdk5.css new file mode 100644 index 0000000..360dd05 --- /dev/null +++ b/resources/styles.sdk5.css @@ -0,0 +1,72 @@ +.background { + viewport-fill: black; +} + +#hourLabel { + font-size: 148; + font-family: Colfax-Thin; + text-length: 32; + text-anchor: end; + x: 60%; + y: 55%+20; + fill: #2490DD; +} + +#minuteLabel { + font-size: 96; + font-family: Colfax-Thin; + text-length: 32; + text-anchor: start; + x: 60%; + y: 55%+20; + fill: white; +} + +#dateLabel { + font-size: 20; + font-family: Colfax-Regular; + text-length: 32; + text-anchor: start; + x: 12%; + y: 10%; + fill: white; +} + +#appointmentsLabel { + font-size: 28; + font-family: Colfax-Regular; + text-length: 128; + text-anchor: start; + x: 12%; + y: 75%; + width: 90%; + fill: white; +} + +#batteryLabel { + font-size: 20; + font-family: Colfax-Regular; + text-length: 32; + text-anchor: start; + x: 85%; + y: 10%; + fill: white; +} + +#activityLabel { + font-size: 28; + font-family: Colfax-Regular; + text-length: 32; + text-anchor: start; + x: 35%+30; + y: 80%+25; + fill: white; +} + +.activityIcon { + fill: #2490DD +} + +.batteryIcon { + fill: #FFFFFF +} \ No newline at end of file diff --git a/resources/widget.defs b/resources/widget.defs new file mode 100644 index 0000000..d92e82b --- /dev/null +++ b/resources/widget.defs @@ -0,0 +1,7 @@ + + + + + + + diff --git a/resources/widgets.gui b/resources/widgets.gui index 719d63c..b8fbee6 100644 --- a/resources/widgets.gui +++ b/resources/widgets.gui @@ -1,6 +1,6 @@ - + diff --git a/screenshots/activities.png b/screenshots/activities.png deleted file mode 100644 index 781768e..0000000 --- a/screenshots/activities.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ae45b7a05f7b5817ce3df4331bd6ac197149b5eb4c4a6a04473ec34dd23f68ee -size 6659 diff --git a/screenshots/versa2-activity.png b/screenshots/activity.png similarity index 100% rename from screenshots/versa2-activity.png rename to screenshots/activity.png diff --git a/screenshots/versa2-event.png b/screenshots/event.png similarity index 100% rename from screenshots/versa2-event.png rename to screenshots/event.png diff --git a/screenshots/ionic-activity.png b/screenshots/ionic-activity.png deleted file mode 100644 index 605b57a..0000000 --- a/screenshots/ionic-activity.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:15435c99f29d70d32e7921cb4e4ff7e830c59764f2d2d04ee04fdd576cd6e680 -size 16407 diff --git a/screenshots/ionic-event.png b/screenshots/ionic-event.png deleted file mode 100644 index 1bcd5bf..0000000 --- a/screenshots/ionic-event.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:21f9b423c41831c2d8ec09d8974547c3a3ab0601986ddd55931b22b4a51343ac -size 20460 diff --git a/screenshots/settings.png b/screenshots/settings.png deleted file mode 100644 index c5bf8f1..0000000 --- a/screenshots/settings.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:105335cbc60698e56f8f45da480369ecb809c08b062d2b0eb8979299c7851634 -size 10335