Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed Barcode-screenshot.png
Binary file not shown.
Binary file added Barcodes2-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Barcodes app for Fitbit Ionic/Versa
# Barcodes app for Fitbit Versa 3/Sense

![screenshot](Barcode-screenshot.png)
![screenshot](Barcodes2-screenshot.png)

Features:
- Customize the color of each barcode
- Customize the name of each barcode
- Supports ascii characters in the barcode
- Supports EAN-13 (hence UPC-A), Code-128 and Code-39 standards
- Store up to 5 barcodes on the Ionic
- Store up to 5 barcodes
- Cycle through barcodes by tapping the screen between the barcode and title
- Direct link to app store (open with phone):
https://gam.fitbit.com/gallery/app/20ba8b5a-f3f9-4f8c-a5a3-10d9eacbd846
https://gallery.fitbit.com/details/58726c9d-92b2-4a76-b7f0-5f591c27cdf0
24 changes: 24 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var barcode = document.getElementById("barcode");
var bartext = document.getElementById("bartext");
var cNodes = new Array(15*11);
const WIDTH = document.getElementById("main").width;
const myButton = document.getElementById("myButton");

function init() {
for(let i = 0; i < 15; i++) {
Expand Down Expand Up @@ -105,6 +106,29 @@ function onKeyPress(e) {
}
}

// Below is code for the final build of the Barcode app for FitBit OS 5.0
let button = document.getElementById("button");
button.onactivate = function(evt) {
if(settings.cards) {
let max = settings.cards.length;
selected--;
if(selected < 0) selected = max - 1;
if(selected >= max) selected = 0;

let item = settings.cards[selected];

barname.text = item.name || "";
frgd.style.fill = item.color || "#12D612";

if(clickTimer) clearTimeout(clickTimer);

clickTimer = setTimeout(() => {
clickTimer = null;
bartext.text = setBarcode(item.code, item.type);
}, 350);
}
}

function pendingFiles() {
let temp;
while(temp = inbox.nextFile()) {
Expand Down
2 changes: 1 addition & 1 deletion companion/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ function setCard(name, value) {
cards[i][name] = value;

} else if(name === "bright") {
bright = (value === "true");
bright = (value === "max");
}
}

Expand Down
18 changes: 13 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
{
"devDependencies": {
"@fitbit/sdk": "~5.0.0"
},
"fitbit": {
"appUUID": "20ba8b5a-f3f9-4f8c-a5a3-10d9eacbd846",
"appUUID": "58726c9d-92b2-4a76-b7f0-5f591c27cdf0",
"appType": "app",
"appDisplayName": "Barcodes",
"appDisplayName": "Barcodes2",
"iconFile": "resources/icon.png",
"wipeColor": "#4caf50",
"requestedPermissions": [],
"buildTargets": [
"atlas",
"vulcan"
],
"i18n": {
"en": {
"name": "Barcodes"
"en-US": {
"name": "Barcodes2"
}
}
},
"defaultLanguage": "en-US"
}
}
7 changes: 7 additions & 0 deletions resources/index.gui → resources/index.view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
<circle cx="100%-20" cy="20" r="20" fill="inherit" />
</g>

<svg>
<use id="button" href="#text-button" y="65" height="100%" fill="fb-white" font-family="System-Regular" font-size="50">
<set href="#text" attributeName="fill" to="fb-black" />
<set href="#text" attributeName="y" to="20" />
</use>
</svg>

<text id="caption" x="50%" y="48">...</text>

<textarea id="intro" x="8%" width="84%">Go into app settings on your phone to add barcodes.</textarea>
Expand Down
8 changes: 8 additions & 0 deletions resources/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,11 @@
text-anchor: middle;
text-length: 40;
}

.application-fill { fill: fb-yellow; }
.foreground-fill { fill: fb-white; }
.background-fill { fill: fb-black; }

#myButton #text {
text-buffer: "BUTTON";
}
8 changes: 8 additions & 0 deletions resources/widget.defs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<svg>
<defs>
<link rel="stylesheet" href="styles.css" />
<link rel="stylesheet" href="extra.css" />
<link rel="import" href="/mnt/sysassets/system_widget.defs" />
<link rel="import" href="/mnt/sysassets/widgets/text_button.defs" />
</defs>
</svg>
7 changes: 0 additions & 7 deletions resources/widgets.gui

This file was deleted.